com.caucho.el
Class PathExpr

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

public class PathExpr
extends Expr

Represents a field reference that may also be a dotted property, e.g. smtp.mail.host.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.el.Expr
L, log
 
Constructor Summary
PathExpr(Expr expr, java.lang.String path)
          Creates a new path expression.
 
Method Summary
 Expr createField(java.lang.String field)
          Creates a field reference using this expression as the base object.
 Expr createMethod(Expr[] args)
          Creates a method call using this as the obj.method expression
 boolean equals(java.lang.Object o)
          Returns true for equal strings.
 MethodInfo getMethodInfo(ELContext env, java.lang.Class<?> retType, java.lang.Class<?>[] argTypes)
          Returns the method info.
 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.
 ValueReference getValueReference(ELContext context)
           
 java.lang.Object invoke(ELContext env, java.lang.Class<?>[] argTypes, java.lang.Object[] args)
          Evaluates the expression, returning an object.
 boolean isReadOnly(ELContext env)
          Evaluate the expression as an object.
 void printCreate(WriteStream os)
          Prints the code to create an LongLiteral.
 void setValue(ELContext env, java.lang.Object value)
          Evaluate the expression as an object.
 java.lang.String toString()
          Returns a readable representation of the expr.
 
Methods inherited from class com.caucho.el.Expr
coerceToType, createField, error, evalBigDecimal, evalBigInteger, evalBoolean, evalCharacter, evalDouble, evalLong, evalObject, evalPeriod, evalString, evalStringWithNull, getExpectedType, getExpressionString, hashCode, invocationError, isConstant, isDouble, isDoubleString, isLiteralText, print, print, printEscaped, printEscapedString, setProperty, toBigDecimal, toBigInteger, toBoolean, toCharacter, toDouble, toEnum, toLong, toStream, toStream, toStream, toStreamEscaped, toStreamEscaped, toStreamEscaped, toString, toString, toString, toString, toString, toStringWithNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathExpr

public PathExpr(Expr expr,
                java.lang.String path)
Creates a new path expression.

Parameters:
expr - the underlying expression
path - the property name to use if null
Method Detail

createField

public Expr createField(java.lang.String field)
Creates a field reference using this expression as the base object.

Overrides:
createField in class Expr
Parameters:
field - the string reference for the field.

createMethod

public Expr createMethod(Expr[] args)
Creates a method call using this as the obj.method expression

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

getType

public java.lang.Class<?> getType(ELContext env)
                           throws PropertyNotFoundException,
                                  ELException
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

isReadOnly

public boolean isReadOnly(ELContext env)
                   throws ELException
Evaluate the expression as an object.

Overrides:
isReadOnly in class Expr
Parameters:
env - the variable environment
Returns:
the evaluated object
Throws:
ELException

setValue

public void setValue(ELContext env,
                     java.lang.Object value)
              throws ELException
Evaluate the expression as an object.

Overrides:
setValue in class Expr
Parameters:
env - the variable environment
Throws:
ELException

getValueReference

public ValueReference getValueReference(ELContext context)
Overrides:
getValueReference in class ValueExpression

getMethodInfo

public MethodInfo getMethodInfo(ELContext env,
                                java.lang.Class<?> retType,
                                java.lang.Class<?>[] argTypes)
                         throws ELException
Returns the method info.

Overrides:
getMethodInfo in class Expr
Parameters:
env - the variable environment
Returns:
the value of the expression as an object
Throws:
ELException

invoke

public java.lang.Object invoke(ELContext env,
                               java.lang.Class<?>[] argTypes,
                               java.lang.Object[] args)
                        throws ELException
Evaluates the expression, returning an object.

Overrides:
invoke in class Expr
Parameters:
env - the variable environment
Returns:
the value of the expression as an 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