com.caucho.el
Class ArrayExpr

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

public class ArrayExpr
extends Expr

Represents an array reference:

 a[b]
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.el.Expr
L, log
 
Constructor Summary
ArrayExpr(Expr left, Expr right)
          Creates a new array expression.
 
Method Summary
 Expr createMethod(Expr[] args)
          Creates a method for constant arrays.
 boolean equals(java.lang.Object o)
          Returns true for equal strings.
 Expr getExpr()
          Returns the base expression.
 Expr getIndex()
          Returns the index expression.
 java.lang.Class<?> getType(ELContext env)
          Evaluates the expression as applicable to the provided context, and returns the most general type that can be accepted by the setValue(javax.el.ELContext, java.lang.Object) method.
 java.lang.Object getValue(ELContext env)
          Evaluate the expression as an object.
 void printCreate(WriteStream os)
          Prints the code to create an LongLiteral.
 java.lang.String toString()
          Returns a readable representation of the expr.
 
Methods inherited from class com.caucho.el.Expr
coerceToType, createField, createField, error, evalBigDecimal, evalBigInteger, evalBoolean, evalCharacter, evalDouble, evalLong, evalObject, evalPeriod, evalString, evalStringWithNull, getExpectedType, getExpressionString, getMethodInfo, hashCode, invocationError, invoke, isConstant, 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

ArrayExpr

public ArrayExpr(Expr left,
                 Expr right)
Creates a new array expression.

Parameters:
left - the object expression
right - the index expression.
Method Detail

getExpr

public Expr getExpr()
Returns the base expression.


getIndex

public Expr getIndex()
Returns the index expression.


createMethod

public Expr createMethod(Expr[] args)
Creates a method for constant arrays.

Overrides:
createMethod in class Expr
Parameters:
args - the arguments for the method

getType

public java.lang.Class<?> getType(ELContext env)
Evaluates the expression as applicable to the provided context, and returns the most general type that can be accepted by the setValue(javax.el.ELContext, java.lang.Object) method.

Overrides:
getType in class Expr
Parameters:
env -
Returns:
Throws:
PropertyNotFoundException
ELException

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 evaluated object
Throws:
ELException

printCreate

public void printCreate(WriteStream os)
                 throws java.io.IOException
Prints the code to create an LongLiteral.

Overrides:
printCreate in class Expr
Parameters:
os - stream to the generated *.java code
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