Interface ExpressionVisitor
-
public interface ExpressionVisitorInterfaceExpressionVisitoris used to traverse a $filter or $orderby expression tree. Any class instance implementing this interface can be passed to the methodVisitable.accept(ExpressionVisitor)of an expression node to start the traversing. While traversing, the appropriate methods of the visitor implementation will be called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectvisitBinary(BinaryExpression binaryExpression, BinaryOperator operator, Object leftSide, Object rightSide)Visits a binary expressionObjectvisitFilterExpression(FilterExpression filterExpression, String expressionString, Object expression)Visits a filter expressionObjectvisitLiteral(LiteralExpression literal, EdmLiteral edmLiteral)Visits a literal expressionObjectvisitMember(MemberExpression memberExpression, Object path, Object property)Visits a member expression (e.g.ObjectvisitMethod(MethodExpression methodExpression, MethodOperator method, List<Object> parameters)Visits a method expressionObjectvisitOrder(OrderExpression orderExpression, Object filterResult, SortOrder sortOrder)Visits a order expressionObjectvisitOrderByExpression(OrderByExpression orderByExpression, String expressionString, List<Object> orders)Visits a orderby expressionObjectvisitProperty(PropertyExpression propertyExpression, String uriLiteral, EdmTyped edmProperty)Visits a property expressionObjectvisitUnary(UnaryExpression unaryExpression, UnaryOperator operator, Object operand)Visits a unary expression
-
-
-
Method Detail
-
visitFilterExpression
Object visitFilterExpression(FilterExpression filterExpression, String expressionString, Object expression)
Visits a filter expression- Parameters:
filterExpression- The visited filter expression nodeexpressionString- The $filter expression string used to build the filter expression treeexpression- 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 nodeoperator- The operator used in the binary expressionleftSide- The result of visiting the left expression noderightSide- 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 nodeexpressionString- The $orderby expression string used to build the orderby expression treeorders- 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 nodefilterResult- The result of visiting the filter expression contained in the ordersortOrder- 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 nodeedmLiteral- 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 nodemethod- The method used in the method expressionparameters- 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 nodepath- 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 nodeuriLiteral- The URI literal of the propertyedmProperty- 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 nodeoperator- The operator used in the unary expressionoperand- The result of visiting the operand expression node- Returns:
- Returns the result from evaluating operator and operand
-
-