Package org.apache.commons.el
Class ConditionalExpression
java.lang.Object
org.apache.commons.el.Expression
org.apache.commons.el.ConditionalExpression
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?)
- Author:
- Shawn Bayern
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Expression
(package private) Expression
(package private) Expression
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalExpression
(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch) Constructor -
Method Summary
Modifier and TypeMethodDescriptionEvaluates the conditional expression and returns the literal resultReturns the expression in the expression language syntaxvoid
setCondition
(Expression pCondition) void
setFalseBranch
(Expression pFalseBranch) void
setTrueBranch
(Expression pTrueBranch)
-
Field Details
-
mCondition
Expression mCondition -
mTrueBranch
Expression mTrueBranch -
mFalseBranch
Expression mFalseBranch
-
-
Constructor Details
-
ConditionalExpression
public ConditionalExpression(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch) Constructor
-
-
Method Details
-
getCondition
-
setCondition
-
getTrueBranch
-
setTrueBranch
-
getFalseBranch
-
setFalseBranch
-
getExpressionString
Returns the expression in the expression language syntax- Specified by:
getExpressionString
in classExpression
-
evaluate
public Object evaluate(javax.servlet.jsp.el.VariableResolver vr, javax.servlet.jsp.el.FunctionMapper f, Logger l) throws javax.servlet.jsp.el.ELException Evaluates the conditional expression and returns the literal result- Specified by:
evaluate
in classExpression
- Throws:
javax.servlet.jsp.el.ELException
-