Class ArtifactMatchExpression


  • public class ArtifactMatchExpression
    extends AbstractRuleMatchExpression
    Implements an artifact match expression.
    Author:
    Holger Eichelberger
    • Field Detail

      • resolved

        private transient java.lang.Object resolved
    • Constructor Detail

      • ArtifactMatchExpression

        public ArtifactMatchExpression​(Expression expression)
                                throws VilException
        Creates a new collection match expression.
        Parameters:
        expression - an expression which evaluates to a collection
        Throws:
        VilException - in case that the expression does not evaluate to a collection
    • Method Detail

      • getExpression

        public Expression getExpression()
        Returns the artifact expression.
        Returns:
        the artifact expression
      • determineExpected

        public java.lang.Object determineExpected​(AbstractRuleMatchExpression rhsExpr,
                                                  java.lang.Object rhsValue)
        Description copied from class: AbstractRuleMatchExpression
        Determines the expected value on the left side (represented by this object) based on the actual value for the corresponding right side.
        Specified by:
        determineExpected in class AbstractRuleMatchExpression
        Parameters:
        rhsExpr - the (resolved) RHS expression
        rhsValue - the RHS value
        Returns:
        the expected LHS value (null denotes no expectation)
      • contributesTo

        public boolean contributesTo​(AbstractRuleMatchExpression expression)
        Description copied from class: AbstractRuleMatchExpression
        Returns whether this rule match expression may contribute to the fulfillment of expression.
        Specified by:
        contributesTo in class AbstractRuleMatchExpression
        Parameters:
        expression - the expression to be considered (typically a RHS expression, while this is a LHS expression)
        Returns:
        true if this rule may contribute, false else
      • evaluate

        public Collection<?> evaluate​(IExpressionVisitor evaluator)
                               throws VilException
        Description copied from class: AbstractRuleMatchExpression
        Evaluates this expression. Some subtypes may define some kind of value resolution, e.g., for match expressions. This must be called before!
        Specified by:
        evaluate in class AbstractRuleMatchExpression
        Parameters:
        evaluator - the expression evaluator (in case that an actual expression must be evaluated as part of this evaluation).
        Returns:
        the evaluation result
        Throws:
        VilException - in case that evaluation fails
      • resolve

        void resolve​(java.lang.Object resolved)
        Resolves the expression.
        Parameters:
        resolved - the resolved object