FileDocCategorySizeDatePackage
ValueExpressionLiteral.javaAPI DocApache Tomcat 6.0.143560Fri Jul 20 04:20:34 BST 2007org.apache.el

ValueExpressionLiteral

public final class ValueExpressionLiteral extends ValueExpression implements Externalizable

Fields Summary
private static final long
serialVersionUID
private Object
value
private Class
expectedType
Constructors Summary
public ValueExpressionLiteral()


      
        super();
    
public ValueExpressionLiteral(Object value, Class expectedType)

        this.value = value;
        this.expectedType = expectedType;
    
Methods Summary
public booleanequals(org.apache.el.ValueExpressionLiteral ve)

        return (ve != null && (this.value != null && ve.value != null && (this.value == ve.value || this.value
                .equals(ve.value))));
    
public booleanequals(java.lang.Object obj)

        return (obj instanceof ValueExpressionLiteral && this
                .equals((ValueExpressionLiteral) obj));
    
public java.lang.ClassgetExpectedType()

        return this.expectedType;
    
public java.lang.StringgetExpressionString()

        return (this.value != null) ? this.value.toString() : null;
    
public java.lang.ClassgetType(javax.el.ELContext context)

        return (this.value != null) ? this.value.getClass() : null;
    
public java.lang.ObjectgetValue(javax.el.ELContext context)

        if (this.expectedType != null) {
            return ELSupport.coerceToType(this.value, this.expectedType);
        }
        return this.value;
    
public inthashCode()

        return (this.value != null) ? this.value.hashCode() : 0;
    
public booleanisLiteralText()

        return true;
    
public booleanisReadOnly(javax.el.ELContext context)

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

        this.value = in.readObject();
        String type = in.readUTF();
        if (!"".equals(type)) {
            this.expectedType = ReflectionUtil.forName(type);
        }
    
public voidsetValue(javax.el.ELContext context, java.lang.Object value)

        throw new PropertyNotWritableException(MessageFactory.get(
                "error.value.literal.write", this.value));
    
public voidwriteExternal(java.io.ObjectOutput out)

        out.writeObject(this.value);
        out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
                : "");