public class BinaryExpressionImpl extends Object implements BinaryExpression
| Modifier and Type | Field and Description |
|---|---|
protected EdmType |
edmType |
protected CommonExpression |
leftSide |
protected org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator |
operatorInfo |
protected CommonExpression |
rightSide |
protected Token |
token |
| Constructor and Description |
|---|
BinaryExpressionImpl(org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator operatorInfo,
CommonExpression leftSide,
CommonExpression rightSide,
Token token) |
| Modifier and Type | Method and Description |
|---|---|
Object |
accept(ExpressionVisitor visitor)
Method
Visitable.accept(ExpressionVisitor) is called when traversing the expression tree. |
EdmType |
getEdmType() |
ExpressionKind |
getKind() |
CommonExpression |
getLeftOperand() |
BinaryOperator |
getOperator() |
CommonExpression |
getRightOperand() |
Token |
getToken() |
String |
getUriLiteral()
Returns the URI literal which lead to the creation of this expression.
|
CommonExpression |
setEdmType(EdmType edmType)
Set the edmType of this expression node
|
protected final org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator operatorInfo
protected final CommonExpression leftSide
protected final CommonExpression rightSide
protected final Token token
protected EdmType edmType
public BinaryExpressionImpl(org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator operatorInfo,
CommonExpression leftSide,
CommonExpression rightSide,
Token token)
public BinaryOperator getOperator()
getOperator in interface BinaryExpressionBinaryOperatorpublic CommonExpression getLeftOperand()
getLeftOperand in interface BinaryExpressionpublic CommonExpression getRightOperand()
getRightOperand in interface BinaryExpressionpublic EdmType getEdmType()
getEdmType in interface CommonExpressionCommonExpression.getEdmType() method
for an expression representing the "concat" method will return always
"Edm.String".This type information is set while parsing the $filter or $orderby
expressions and used to do a first validation of the expression.
For calculating operators like "add, sub, mul" this type
information is purely based on input and output types of the
operator as defined in the OData specification.
So for $filter=2 add 7 the CommonExpression.getEdmType() method of the binary expression
will return Edm.Byte and not Edm.Int16 because the parser performs no real
addition.
However, the application may change this type while evaluating the expression tree.
public CommonExpression setEdmType(EdmType edmType)
CommonExpressionsetEdmType in interface CommonExpressionedmType - Type to be setpublic ExpressionKind getKind()
getKind in interface CommonExpressionExpressionKindpublic String getUriLiteral()
CommonExpressiongetUriLiteral in interface CommonExpressionpublic Object accept(ExpressionVisitor visitor) throws ExceptionVisitExpression, ODataApplicationException
VisitableVisitable.accept(ExpressionVisitor) is called when traversing the expression tree. This method is invoked on
each
expression used as node in an expression tree. The implementations should
behave as follows:
ExpressionVisitor instance and provide the stored objects to that
instance
accept in interface Visitablevisitor - Object ( implementing ExpressionVisitor) whose methods are called during traversing a expression node of
the expression tree.ExceptionVisitExpression - Exception occurred the OData library while traversing the treeODataApplicationException - Exception thrown by the application who implemented the visitorpublic Token getToken()
Copyright © 2020. All rights reserved.