Interface ExpressionVisitor


  • public interface ExpressionVisitor
    Interface ExpressionVisitor is used to traverse a $filter or $orderby expression tree. Any class instance implementing this interface can be passed to the method Visitable.accept(ExpressionVisitor) of an expression node to start the traversing. While traversing, the appropriate methods of the visitor implementation will be called.
    • Method Detail

      • visitFilterExpression

        Object visitFilterExpression​(FilterExpression filterExpression,
                                     String expressionString,
                                     Object expression)
        Visits a filter expression
        Parameters:
        filterExpression - The visited filter expression node
        expressionString - The $filter expression string used to build the filter expression tree
        expression - The expression node representing the first operator,method,literal or property of the expression tree
        Returns:
        The overall result of evaluating the whole filter expression tree
      • visitBinary

        Object visitBinary​(BinaryExpression binaryExpression,
                           BinaryOperator operator,
                           Object leftSide,
                           Object rightSide)
        Visits a binary expression
        Parameters:
        binaryExpression - The visited binary expression node
        operator - The operator used in the binary expression
        leftSide - The result of visiting the left expression node
        rightSide - The result of visiting the right expression node
        Returns:
        Returns the result from evaluating operator, leftSide and rightSide
      • visitOrderByExpression

        Object visitOrderByExpression​(OrderByExpression orderByExpression,
                                      String expressionString,
                                      List<Object> orders)
        Visits a orderby expression
        Parameters:
        orderByExpression - The visited orderby expression node
        expressionString - The $orderby expression string used to build the orderby expression tree
        orders - The result of visiting the orders of the orderby expression
        Returns:
        The overall result of evaluating the orderby expression tree
      • visitOrder

        Object visitOrder​(OrderExpression orderExpression,
                          Object filterResult,
                          SortOrder sortOrder)
        Visits a order expression
        Parameters:
        orderExpression - The visited order expression node
        filterResult - The result of visiting the filter expression contained in the order
        sortOrder - The sort order
        Returns:
        The overall result of evaluating the order
      • visitLiteral

        Object visitLiteral​(LiteralExpression literal,
                            EdmLiteral edmLiteral)
        Visits a literal expression
        Parameters:
        literal - The visited literal expression node
        edmLiteral - The detected EDM literal (value and type)
        Returns:
        The value of the literal
      • visitMethod

        Object visitMethod​(MethodExpression methodExpression,
                           MethodOperator method,
                           List<Object> parameters)
        Visits a method expression
        Parameters:
        methodExpression - The visited method expression node
        method - The method used in the method expression
        parameters - The result of visiting the parameters of the method
        Returns:
        Returns the result from evaluating the method and the method parameters
      • visitMember

        Object visitMember​(MemberExpression memberExpression,
                           Object path,
                           Object property)
        Visits a member expression (e.g. <path property>/<member property>)
        Parameters:
        memberExpression - The visited member expression node
        path - The result of visiting the path property expression node (the left side of the property operator)
        property - The result of visiting the member property expression node
        Returns:
        Returns the value of the corresponding property (which may be a single EDM value or a structured EDM value)
      • visitProperty

        Object visitProperty​(PropertyExpression propertyExpression,
                             String uriLiteral,
                             EdmTyped edmProperty)
        Visits a property expression
        Parameters:
        propertyExpression - The visited property expression node
        uriLiteral - The URI literal of the property
        edmProperty - The EDM property matching the property name used in the expression String
        Returns:
        Returns the value of the corresponding property ( which may be a single EDM value or a structured EDM value)
      • visitUnary

        Object visitUnary​(UnaryExpression unaryExpression,
                          UnaryOperator operator,
                          Object operand)
        Visits a unary expression
        Parameters:
        unaryExpression - The visited unary expression node
        operator - The operator used in the unary expression
        operand - The result of visiting the operand expression node
        Returns:
        Returns the result from evaluating operator and operand