public class ConditionalExpression extends Expression
Represents a conditional expression. I've decided not to produce an abstract base "TernaryOperatorExpression" class since (a) future ternary operators are unlikely and (b) it's not clear that there would be a meaningful way to abstract them. (For instance, would they all be right- associative? Would they all have two fixed operator symbols?)
| Constructor and Description |
|---|
ConditionalExpression(Expression pCondition,
Expression pTrueBranch,
Expression pFalseBranch)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
bindFunctions(FunctionMapper functions)
Returns an expression with all
FunctionInvocations replaced by
BoundFunctionInvocations. |
Object |
evaluate(VariableResolver vr,
FunctionMapper f)
Evaluates the conditional expression and returns the literal result
|
Expression |
getCondition() |
String |
getExpressionString()
Returns the expression in the expression language syntax
|
Expression |
getFalseBranch() |
Expression |
getTrueBranch() |
void |
setCondition(Expression pCondition) |
void |
setFalseBranch(Expression pFalseBranch) |
void |
setTrueBranch(Expression pTrueBranch) |
public ConditionalExpression(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch)
public Expression getCondition()
public void setCondition(Expression pCondition)
public Expression getTrueBranch()
public void setTrueBranch(Expression pTrueBranch)
public Expression getFalseBranch()
public void setFalseBranch(Expression pFalseBranch)
public String getExpressionString()
getExpressionString in class Expressionpublic Object evaluate(VariableResolver vr, FunctionMapper f) throws ELException
evaluate in class ExpressionELExceptionpublic Expression bindFunctions(FunctionMapper functions) throws ELException
ExpressionFunctionInvocations replaced by
BoundFunctionInvocations.bindFunctions in class Expressionfunctions - the functions to use in this transformationFunctionInvocations replaced by
BoundFunctionInvocations.ELException - if any of the functions in this Expression are
not present in functionsCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.