Class ObjectValueExpression

All Implemented Interfaces:
Serializable

public final class ObjectValueExpression extends ValueExpression
Object wrapper expression.
Author:
Christoph Beck
See Also:
  • Constructor Details

    • ObjectValueExpression

      public ObjectValueExpression(TypeConverter converter, Object object, Class<?> type)
      Wrap an object into a value expression.
      Parameters:
      converter - type converter
      object - the object to wrap
      type - the expected type this object will be coerced in getValue(ELContext).
  • Method Details

    • equals

      public boolean equals(Object obj)
      Two object value expressions are equal if and only if their wrapped objects are equal.
      Specified by:
      equals in class Expression
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Expression
    • getValue

      public Object getValue(ELContext context)
      Answer the wrapped object, coerced to the expected type.
      Specified by:
      getValue in class ValueExpression
      Parameters:
      context - The EL context for this evaluation
      Returns:
      The result of evaluating this value expression
    • getExpressionString

      public String getExpressionString()
      Answer null.
      Specified by:
      getExpressionString in class Expression
    • isLiteralText

      public boolean isLiteralText()
      Answer false.
      Specified by:
      isLiteralText in class Expression
    • getType

      public Class<?> getType(ELContext context)
      Answer null.
      Specified by:
      getType in class ValueExpression
      Parameters:
      context - The EL context for this evaluation
      Returns:
      The type of the result of this value expression
    • isReadOnly

      public boolean isReadOnly(ELContext context)
      Answer true.
      Specified by:
      isReadOnly in class ValueExpression
      Parameters:
      context - The EL context for this evaluation
      Returns:
      true if this expression is read only otherwise false
    • setValue

      public void setValue(ELContext context, Object value)
      Throw an exception.
      Specified by:
      setValue in class ValueExpression
      Parameters:
      context - The EL context for this evaluation
      value - The value to set the property to which this value expression refers
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getExpectedType

      public Class<?> getExpectedType()
      Specified by:
      getExpectedType in class ValueExpression