Package com.sap.cds.ql.cqn
Interface CqnExpression
- All Superinterfaces:
CqnToken,CqnValue,JSONizable
- All Known Subinterfaces:
BooleanFunction,BooleanValue,CqnArithmeticExpression,CqnArithmeticNegation,CqnBetweenPredicate,CqnCaseExpression,CqnComparisonPredicate,CqnConnectivePredicate,CqnContainmentTest,CqnEtagPredicate,CqnExistsSubquery,CqnInPredicate,CqnInSubquery,CqnMatchPredicate,CqnNegation,CqnPassThroughSearchPredicate,CqnPredicate,CqnSearchPredicate,CqnSearchTermPredicate,Predicate
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(CqnVisitor visitor) Traverses the expression tree represented by this token with a givenvisitor.default CqnArithmeticExpressionCasts this expression to aCqnArithmeticExpression.default CqnCaseExpressionCasts this expression to aCqnCaseExpression.default CqnExpressionCasts this value toCqnExpression.default CqnArithmeticNegationCasts this expression to aCqnArithmeticNegation.default CqnPredicateCasts this expression to aCqnPredicate.default booleanReturnstrueif this is aCqnArithmeticExpression.default booleanReturnstrueif this is aCqnCaseExpression.default booleanReturnstrueif this is aCqnExpression.default booleanReturnstrueif this is aCqnArithmeticNegation.default booleanReturnstrueif this is aCqnPredicate.default StringtoJson()Methods inherited from interface com.sap.cds.ql.cqn.CqnValue
as, asFunction, asList, asLiteral, asNullValue, asParameter, asPlain, asRef, isFunction, isList, isLiteral, isNullValue, isParameter, isPlain, isRef, ofLiteral, ofRef, type
-
Method Details
-
isExpression
default boolean isExpression()Description copied from interface:CqnValueReturnstrueif this is aCqnExpression.- Specified by:
isExpressionin interfaceCqnValue- Returns:
trueif this is an expression, otherwisefalse
-
asExpression
Description copied from interface:CqnValueCasts this value toCqnExpression.- Specified by:
asExpressionin interfaceCqnValue- Returns:
- this value as an expression
-
isArithmeticExpression
default boolean isArithmeticExpression()Returnstrueif this is aCqnArithmeticExpression.- Returns:
trueif this is an arithmetic expression, otherwisefalse
-
isCaseExpression
default boolean isCaseExpression()Returnstrueif this is aCqnCaseExpression.- Returns:
trueif this is a case expression, otherwisefalse
-
asArithmeticExpression
Casts this expression to aCqnArithmeticExpression.- Returns:
- this as an arithmetic expression
- Throws:
ClassCastException- if this expression is not an arithmetic expression
-
asCaseExpression
Casts this expression to aCqnCaseExpression.- Returns:
- this as a case expression
- Throws:
ClassCastException- if this expression is not a case expression
-
isNegation
default boolean isNegation()Returnstrueif this is aCqnArithmeticNegation.- Returns:
trueif this is a negation expression, otherwisefalse
-
asNegation
Casts this expression to aCqnArithmeticNegation.- Returns:
- this as a negation expression
- Throws:
ClassCastException- if this expression is not an arithmetic negation
-
isPredicate
default boolean isPredicate()Returnstrueif this is aCqnPredicate.- Returns:
trueif this is a predicate, otherwisefalse
-
asPredicate
Casts this expression to aCqnPredicate.- Returns:
- this as a predicate
- Throws:
ClassCastException- if this expression is not a predicate
-
toJson
- Specified by:
toJsonin interfaceJSONizable
-
accept
Description copied from interface:CqnTokenTraverses the expression tree represented by this token with a givenvisitor. The traversal order is depth-first. If this token has child nodes they are traversed first by dispatching the visitor to the children'sacceptmethods. Afterwards this token is passed to the visitor'svisitmethod specific for this token's type.- Specified by:
acceptin interfaceCqnToken- Parameters:
visitor- theCqnVisitor
-