Package org.apache.commons.el
Class ConditionalExpression
- java.lang.Object
-
- org.apache.commons.el.Expression
-
- org.apache.commons.el.ConditionalExpression
-
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?)
- Author:
- Shawn Bayern
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ExpressionmCondition(package private) ExpressionmFalseBranch(package private) ExpressionmTrueBranch
-
Constructor Summary
Constructors Constructor Description ConditionalExpression(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectevaluate(javax.servlet.jsp.el.VariableResolver vr, javax.servlet.jsp.el.FunctionMapper f, Logger l)Evaluates the conditional expression and returns the literal resultExpressiongetCondition()java.lang.StringgetExpressionString()Returns the expression in the expression language syntaxExpressiongetFalseBranch()ExpressiongetTrueBranch()voidsetCondition(Expression pCondition)voidsetFalseBranch(Expression pFalseBranch)voidsetTrueBranch(Expression pTrueBranch)
-
-
-
Field Detail
-
mCondition
Expression mCondition
-
mTrueBranch
Expression mTrueBranch
-
mFalseBranch
Expression mFalseBranch
-
-
Constructor Detail
-
ConditionalExpression
public ConditionalExpression(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch)
Constructor
-
-
Method Detail
-
getCondition
public Expression getCondition()
-
setCondition
public void setCondition(Expression pCondition)
-
getTrueBranch
public Expression getTrueBranch()
-
setTrueBranch
public void setTrueBranch(Expression pTrueBranch)
-
getFalseBranch
public Expression getFalseBranch()
-
setFalseBranch
public void setFalseBranch(Expression pFalseBranch)
-
getExpressionString
public java.lang.String getExpressionString()
Returns the expression in the expression language syntax- Specified by:
getExpressionStringin classExpression
-
evaluate
public java.lang.Object evaluate(javax.servlet.jsp.el.VariableResolver vr, javax.servlet.jsp.el.FunctionMapper f, Logger l) throws javax.servlet.jsp.el.ELExceptionEvaluates the conditional expression and returns the literal result- Specified by:
evaluatein classExpression- Throws:
javax.servlet.jsp.el.ELException
-
-