org.apache.commons.el

Class 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

(package private) Expression
mCondition
(package private) Expression
mFalseBranch
(package private) Expression
mTrueBranch

Constructor Summary

ConditionalExpression(Expression pCondition, Expression pTrueBranch, Expression pFalseBranch)
Constructor

Method Summary

Object
evaluate(VariableResolver vr, FunctionMapper f, Logger l)
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)

Methods inherited from class org.apache.commons.el.Expression

evaluate, getExpressionString

Field Details

mCondition

(package private)  Expression mCondition

mFalseBranch

(package private)  Expression mFalseBranch

mTrueBranch

(package private)  Expression mTrueBranch

Constructor Details

ConditionalExpression

public ConditionalExpression(Expression pCondition,
                             Expression pTrueBranch,
                             Expression pFalseBranch)
Constructor

Method Details

evaluate

public Object evaluate(VariableResolver vr,
                       FunctionMapper f,
                       Logger l)
            throws ELException
Evaluates the conditional expression and returns the literal result
Overrides:
evaluate in interface Expression

getCondition

public Expression getCondition()

getExpressionString

public String getExpressionString()
Returns the expression in the expression language syntax
Overrides:
getExpressionString in interface Expression

getFalseBranch

public Expression getFalseBranch()

getTrueBranch

public Expression getTrueBranch()

setCondition

public void setCondition(Expression pCondition)

setFalseBranch

public void setFalseBranch(Expression pFalseBranch)

setTrueBranch

public void setTrueBranch(Expression pTrueBranch)

Copyright (c) 2001-2002 - Apache Software Foundation