Class AbstractRuleMatchExpression

    • Constructor Detail

      • AbstractRuleMatchExpression

        public AbstractRuleMatchExpression()
    • Method Detail

      • getEntryType

        public abstract TypeDescriptor<?> getEntryType()
        Returns the entry type over which this match expression will be able to iterate.
        Returns:
        the entry type
      • determineExpected

        public abstract java.lang.Object determineExpected​(AbstractRuleMatchExpression rhsExpr,
                                                           java.lang.Object rhsValue)
                                                    throws VilException
        Determines the expected value on the left side (represented by this object) based on the actual value for the corresponding right side.
        Parameters:
        rhsExpr - the (resolved) RHS expression
        rhsValue - the RHS value
        Returns:
        the expected LHS value (null denotes no expectation)
        Throws:
        VilException - in case that determining the expected object fails
      • accept

        public java.lang.Object accept​(IExpressionVisitor visitor)
                                throws VilException
        Description copied from class: Expression
        Visits the expression.
        Specified by:
        accept in class Expression
        Parameters:
        visitor - the visitor
        Returns:
        the result of visiting this expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • accept

        protected abstract java.lang.Object accept​(IMatchVisitor visitor)
                                            throws VilException
        Accepts the given visitor for visiting.
        Parameters:
        visitor - the match visitor used for visiting
        Returns:
        the result of visiting (may be null)
        Throws:
        VilException - in case of visiting / evaluation errors
      • contributesTo

        public abstract boolean contributesTo​(AbstractRuleMatchExpression expression)
        Returns whether this rule match expression may contribute to the fulfillment of expression.
        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 abstract Collection<?> evaluate​(IExpressionVisitor evaluator)
                                        throws VilException
        Evaluates this expression. Some subtypes may define some kind of value resolution, e.g., for match expressions. This must be called before!
        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