public class FilterParserImpl extends Object implements FilterParser
| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator> |
availableBinaryOperators |
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoMethod> |
availableMethods |
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator> |
availableUnaryOperators |
protected String |
curExpression |
protected EdmEntityType |
resourceEntityType |
protected TokenList |
tokenList |
| Constructor and Description |
|---|
FilterParserImpl(EdmEntityType resourceEntityType)
Creates a new FilterParser implementation
|
FilterParserImpl(EdmEntityType resourceEntityType,
boolean strictFilter)
Creates a new FilterParser implementation
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.olingo.odata2.core.uri.expression.InfoMethod |
isMethod(Token token,
Token lookToken) |
protected org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator |
isUnaryOperator(Token token)
Check if a token is a UnaryOperator ( e.g.
|
FilterExpression |
parseFilterString(String filterExpression)
Parses a $filter expression string and creates an $orderby expression tree.
|
FilterExpression |
parseFilterString(String filterExpression,
boolean allowOnlyBinary) |
protected ActualBinaryOperator |
readBinaryOperator() |
protected CommonExpression |
readElement(CommonExpression leftExpression) |
protected CommonExpression |
readElement(CommonExpression leftExpression,
ActualBinaryOperator leftOperator)
Reads: Unary operators, Methods, Properties, ...
|
protected CommonExpression |
readElements(CommonExpression leftExpression,
int priority) |
protected CommonExpression |
readMethod(Token token,
org.apache.olingo.odata2.core.uri.expression.InfoMethod methodOperator) |
protected MethodExpression |
readParameters(org.apache.olingo.odata2.core.uri.expression.InfoMethod methodInfo,
MethodExpressionImpl methodExpression,
Token methodToken)
Read the parameters of a method expression
|
protected CommonExpression |
readParenthesis()
Reads the content between parenthesis.
|
protected CommonExpression |
readUnaryoperator(Token lookToken,
org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator unaryOperator) |
protected void |
validateBinaryOperatorTypes(BinaryExpression binaryExpression) |
protected void |
validateEdmProperty(CommonExpression leftExpression,
PropertyExpressionImpl property,
Token propertyToken,
ActualBinaryOperator actBinOp) |
protected void |
validateEdmPropertyOfStructuredType(EdmStructuralType parentType,
PropertyExpressionImpl property,
Token propertyToken) |
protected void |
validateMethodTypes(MethodExpression methodExpression,
Token methodToken) |
protected void |
validateUnaryOperatorTypes(UnaryExpression unaryExpression) |
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoBinaryOperator> availableBinaryOperators
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoMethod> availableMethods
protected static Map<String,org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator> availableUnaryOperators
protected EdmEntityType resourceEntityType
protected TokenList tokenList
protected String curExpression
public FilterParserImpl(EdmEntityType resourceEntityType)
resourceEntityType - EntityType of the resource on which the filter is appliedpublic FilterParserImpl(EdmEntityType resourceEntityType, boolean strictFilter)
resourceEntityType - EntityType of the resource on which the filter is appliedstrictFilter - boolean check to decide weather to validate filterpublic FilterExpression parseFilterString(String filterExpression) throws ExpressionParserException, ExpressionParserInternalError
FilterParserparseFilterString in interface FilterParserfilterExpression - The $filter expression string ( for example "city eq 'Sydney'" ) to be parsedExpressionVisitor and
VisitableExpressionParserException - Exception thrown due to errors while parsing the $filter expression stringExpressionParserInternalErrorpublic FilterExpression parseFilterString(String filterExpression, boolean allowOnlyBinary) throws ExpressionParserException, ExpressionParserInternalError
protected CommonExpression readElements(CommonExpression leftExpression, int priority) throws ExpressionParserException, ExpressionParserInternalError
protected CommonExpression readParenthesis() throws ExpressionParserException, ExpressionParserInternalError
TokenKind.OPENPAREN because it MUST be check in the calling method ( when read the method name and the '('
is read).ExpressionParserException - While reading the elements in the parenthesis an error occurredTokenizerMessage - The next token did not match the expected tokenExpressionParserInternalErrorprotected MethodExpression readParameters(org.apache.olingo.odata2.core.uri.expression.InfoMethod methodInfo, MethodExpressionImpl methodExpression, Token methodToken) throws ExpressionParserException, ExpressionParserInternalError
methodInfo - Signature information about the method whose parameters should be readmethodExpression - Method expression to which the read parameters are addedExpressionParserExceptionExpressionParserInternalErrorTokenizerExpectError - The next token did not match the expected tokenprotected CommonExpression readElement(CommonExpression leftExpression) throws ExpressionParserException, ExpressionParserInternalError
protected CommonExpression readElement(CommonExpression leftExpression, ActualBinaryOperator leftOperator) throws ExpressionParserException, ExpressionParserInternalError
readElements(CommonExpression, int)leftExpression - Used while parsing properties. In this case ( e.g. parsing "a/b") the property "a" ( as leftExpression of "/") is
relevant
to verify whether the property "b" exists inside the edmExpressionParserExceptionExpressionParserInternalErrorTokenizerMessageprotected CommonExpression readUnaryoperator(Token lookToken, org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator unaryOperator) throws ExpressionParserException, ExpressionParserInternalError
protected CommonExpression readMethod(Token token, org.apache.olingo.odata2.core.uri.expression.InfoMethod methodOperator) throws ExpressionParserException, ExpressionParserInternalError
protected ActualBinaryOperator readBinaryOperator()
protected org.apache.olingo.odata2.core.uri.expression.InfoUnaryOperator isUnaryOperator(Token token)
token - Token to be checkedInfoUnaryOperator containing information about the specific unary operatornull if the token is not an unary operatorprotected org.apache.olingo.odata2.core.uri.expression.InfoMethod isMethod(Token token, Token lookToken)
protected void validateEdmProperty(CommonExpression leftExpression, PropertyExpressionImpl property, Token propertyToken, ActualBinaryOperator actBinOp) throws ExpressionParserException, ExpressionParserInternalError
protected void validateEdmPropertyOfStructuredType(EdmStructuralType parentType, PropertyExpressionImpl property, Token propertyToken) throws ExpressionParserException, ExpressionParserInternalError
protected void validateUnaryOperatorTypes(UnaryExpression unaryExpression) throws ExpressionParserInternalError
ExpressionParserInternalErrorprotected void validateBinaryOperatorTypes(BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError
protected void validateMethodTypes(MethodExpression methodExpression, Token methodToken) throws ExpressionParserException, ExpressionParserInternalError
Copyright © 2020. All rights reserved.