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 void
accept
(CqnVisitor visitor) Traverses the expression tree represented by this token with a givenvisitor
.default CqnArithmeticExpression
Casts this expression to aCqnArithmeticExpression
.default CqnCaseExpression
Casts this expression to aCqnCaseExpression
.default CqnExpression
Casts this value toCqnExpression
.default CqnArithmeticNegation
Casts this expression to aCqnArithmeticNegation
.default CqnPredicate
Casts this expression to aCqnPredicate
.default boolean
Returnstrue
if this is aCqnArithmeticExpression
.default boolean
Returnstrue
if this is aCqnCaseExpression
.default boolean
Returnstrue
if this is aCqnExpression
.default boolean
Returnstrue
if this is aCqnArithmeticNegation
.default boolean
Returnstrue
if this is aCqnPredicate
.default String
toJson()
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:CqnValue
Returnstrue
if this is aCqnExpression
.- Specified by:
isExpression
in interfaceCqnValue
- Returns:
true
if this is an expression, otherwisefalse
-
asExpression
Description copied from interface:CqnValue
Casts this value toCqnExpression
.- Specified by:
asExpression
in interfaceCqnValue
- Returns:
- this value as an expression
-
isArithmeticExpression
default boolean isArithmeticExpression()Returnstrue
if this is aCqnArithmeticExpression
.- Returns:
true
if this is an arithmetic expression, otherwisefalse
-
isCaseExpression
default boolean isCaseExpression()Returnstrue
if this is aCqnCaseExpression
.- Returns:
true
if 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()Returnstrue
if this is aCqnArithmeticNegation
.- Returns:
true
if 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()Returnstrue
if this is aCqnPredicate
.- Returns:
true
if 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:
toJson
in interfaceJSONizable
-
accept
Description copied from interface:CqnToken
Traverses 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'saccept
methods. Afterwards this token is passed to the visitor'svisit
method specific for this token's type.- Specified by:
accept
in interfaceCqnToken
- Parameters:
visitor
- theCqnVisitor
-