public class OrderByExpressionImpl extends Object implements OrderByExpression
| Constructor and Description |
|---|
OrderByExpressionImpl(String orderbyString) |
| Modifier and Type | Method and Description |
|---|---|
Object |
accept(ExpressionVisitor visitor)
Method
Visitable.accept(ExpressionVisitor) is called when traversing the expression tree. |
void |
addOrder(OrderExpression orderNode) |
EdmType |
getEdmType() |
String |
getExpressionString() |
ExpressionKind |
getKind() |
List<OrderExpression> |
getOrders() |
int |
getOrdersCount() |
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
|
public OrderByExpressionImpl(String orderbyString)
public String getExpressionString()
getExpressionString in interface OrderByExpressionpublic List<OrderExpression> getOrders()
getOrders in interface OrderByExpressionFor example: The orderby expression build from "$orderby=name asc, age desc" would contain to order expression.
public int getOrdersCount()
getOrdersCount in interface OrderByExpressionpublic void addOrder(OrderExpression orderNode)
public ExpressionKind getKind()
getKind in interface CommonExpressionExpressionKindpublic 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 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 visitorCopyright © 2020. All rights reserved.