com.caucho.el
Class ConditionalExpr

java.lang.Object
  extended by javax.el.Expression
      extended by javax.el.ValueExpression
          extended by com.caucho.el.Expr
              extended by com.caucho.el.ConditionalExpr
All Implemented Interfaces:
java.io.Serializable

public class ConditionalExpr
extends Expr

Represents a conditional expression

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.el.Expr
L, log
 
Constructor Summary
ConditionalExpr(Expr test, Expr trueExpr, Expr falseExpr)
          Creates the conditional expression.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true for equal strings.
 boolean evalBoolean(ELContext env)
          Evaluate the expression as a boolean
 double evalDouble(ELContext env)
          Evaluate the expression as a double
 long evalLong(ELContext env)
          Evaluate the expression as a long
 java.lang.String evalString(ELContext env)
          Evaluate the expression as a string
 java.lang.Object getValue(ELContext env)
          Evaluate the expression as an object.
 boolean isConstant()
          Returns true if this is a constant expression.
 void printCreate(WriteStream os)
          Prints the Java code to recreate the expr
 java.lang.String toString()
          Returns a readable representation of the expr.
 
Methods inherited from class com.caucho.el.Expr
coerceToType, createField, createField, createMethod, error, evalBigDecimal, evalBigInteger, evalCharacter, evalObject, evalPeriod, evalStringWithNull, getExpectedType, getExpressionString, getMethodInfo, getType, hashCode, invocationError, invoke, isDouble, isDoubleString, isLiteralText, isReadOnly, print, print, printEscaped, printEscapedString, setProperty, setValue, toBigDecimal, toBigInteger, toBoolean, toCharacter, toDouble, toEnum, toLong, toStream, toStream, toStream, toStreamEscaped, toStreamEscaped, toStreamEscaped, toString, toString, toString, toString, toString, toStringWithNull
 
Methods inherited from class javax.el.ValueExpression
getValueReference
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionalExpr

public ConditionalExpr(Expr test,
                       Expr trueExpr,
                       Expr falseExpr)
Creates the conditional expression.

Parameters:
test - the conditional expressions test.
trueExpr - the true subexpression
falseExpr - the false subexpression
Method Detail

isConstant

public boolean isConstant()
Returns true if this is a constant expression.

Overrides:
isConstant in class Expr

getValue

public java.lang.Object getValue(ELContext env)
                          throws ELException
Evaluate the expression as an object.

Specified by:
getValue in class Expr
Parameters:
env - the variable environment
Returns:
the result as an object
Throws:
ELException

evalLong

public long evalLong(ELContext env)
              throws ELException
Evaluate the expression as a long

Overrides:
evalLong in class Expr
Parameters:
env - the variable environment
Returns:
the result as an long
Throws:
ELException

evalDouble

public double evalDouble(ELContext env)
                  throws ELException
Evaluate the expression as a double

Overrides:
evalDouble in class Expr
Parameters:
env - the variable environment
Returns:
the result as an double
Throws:
ELException

evalString

public java.lang.String evalString(ELContext env)
                            throws ELException
Evaluate the expression as a string

Overrides:
evalString in class Expr
Parameters:
env - the variable environment
Returns:
the result as a string
Throws:
ELException

evalBoolean

public boolean evalBoolean(ELContext env)
                    throws ELException
Evaluate the expression as a boolean

Overrides:
evalBoolean in class Expr
Parameters:
env - the variable environment
Returns:
the result as a boolean
Throws:
ELException

printCreate

public void printCreate(WriteStream os)
                 throws java.io.IOException
Prints the Java code to recreate the expr

Overrides:
printCreate in class Expr
Parameters:
os - the output stream to the *.java file
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)
Returns true for equal strings.

Overrides:
equals in class Expr

toString

public java.lang.String toString()
Returns a readable representation of the expr.

Specified by:
toString in class Expr