public class TernaryExpression
extends Expression
Represents a ternary expression (booleanExpression) ? expression : expression
| Fields inherited from class | Fields |
|---|---|
class Expression |
EMPTY_ARRAY |
| Constructor and description |
|---|
TernaryExpression(BooleanExpression booleanExpression, Expression truthExpression, Expression falseExpression)Creates {@code booleanExpression ? |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public BooleanExpression |
getBooleanExpression()The condition of this conditional. |
|
public Expression |
getFalseExpression()The expression used when the condition is false. |
|
public String |
getText() |
|
public Expression |
getTrueExpression()The expression used when the condition is true. |
|
public ClassNode |
getType() |
|
public String |
toString() |
|
public Expression |
transformExpression(ExpressionTransformer transformer) |
|
public void |
visit(GroovyCodeVisitor visitor) |
| Methods inherited from class | Name |
|---|---|
class Expression |
getType, setType, transformExpression, transformExpressions, transformExpressions |
class AnnotatedNode |
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit |
Creates booleanExpression ? truthExpression : falseExpression.
booleanExpression - the conditiontruthExpression - the expression used when the condition is truefalseExpression - the expression used when the condition is falseThe condition of this conditional.
The expression used when the condition is false.
The expression used when the condition is true.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.