Class TernaryOperator
java.lang.Object
org.apache.sling.scripting.sightly.compiler.expression.nodes.TernaryOperator
- All Implemented Interfaces:
- ExpressionNode
Defines the HTL ternary operator (e.g. 
condition ? then : else).- 
Constructor SummaryConstructorsConstructorDescriptionTernaryOperator(ExpressionNode condition, ExpressionNode thenBranch, ExpressionNode elseBranch) Creates the operator.
- 
Method SummaryModifier and TypeMethodDescription<T> Taccept(NodeVisitor<T> visitor) Accept a visitor to process this node.Returns the condition of this operator.Returns the "else" branch.Returns the "then" branch.toString()
- 
Constructor Details- 
TernaryOperatorpublic TernaryOperator(ExpressionNode condition, ExpressionNode thenBranch, ExpressionNode elseBranch) Creates the operator.- Parameters:
- condition- the operator's condition
- thenBranch- the "then" branch
- elseBranch- the "else" branch
 
 
- 
- 
Method Details- 
getConditionReturns the condition of this operator.- Returns:
- the condition of this operator
 
- 
getThenBranchReturns the "then" branch.- Returns:
- the "then" branch
 
- 
getElseBranchReturns the "else" branch.- Returns:
- the "else" branch
 
- 
acceptDescription copied from interface:ExpressionNodeAccept a visitor to process this node.- Specified by:
- acceptin interface- ExpressionNode
- Type Parameters:
- T- the type of the visitor
- Parameters:
- visitor- The visitor
- Returns:
- the node after it has been evaluated by the visitor
 
- 
toString
 
-