FileDocCategorySizeDatePackage
MethodExpressionLiteral.javaAPI DocGlassfish v2 API4251Fri May 04 22:31:18 BST 2007com.sun.el

MethodExpressionLiteral

public class MethodExpressionLiteral extends MethodExpression implements Externalizable

Fields Summary
private Class
expectedType
private String
expr
private Class[]
paramTypes
Constructors Summary
public MethodExpressionLiteral()

        // do nothing
    
public MethodExpressionLiteral(String expr, Class expectedType, Class[] paramTypes)

        this.expr = expr;
        this.expectedType = expectedType;
        this.paramTypes = paramTypes;
    
Methods Summary
public booleanequals(java.lang.Object obj)

        return (obj instanceof MethodExpressionLiteral && this.hashCode() == obj.hashCode());
    
public java.lang.StringgetExpressionString()

        return this.expr;
    
public javax.el.MethodInfogetMethodInfo(javax.el.ELContext context)

        return new MethodInfo(this.expr, this.expectedType, this.paramTypes);
    
public inthashCode()

        return this.expr.hashCode();
    
public java.lang.Objectinvoke(javax.el.ELContext context, java.lang.Object[] params)

        if (this.expectedType == null) {
            return this.expr;
        }

        try {
            return ELSupport.coerceToType(this.expr, this.expectedType);
        } catch (Exception ex) {
            throw new ELException (ex);
        }
    
public booleanisLiteralText()

        return true;
    
public voidreadExternal(java.io.ObjectInput in)

        this.expr = in.readUTF();
        String type = in.readUTF();
        if (!"".equals(type)) {
            this.expectedType = ReflectionUtil.forName(type);
        }
        this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
                .readObject()));
    
public voidwriteExternal(java.io.ObjectOutput out)

        out.writeUTF(this.expr);
        out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
                : "");
        out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));