Package org.apache.el

Class ValueExpressionLiteral

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public final class ValueExpressionLiteral
    extends ValueExpression
    implements java.io.Externalizable
    A literal value expression that represents a constant value.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueExpressionLiteral()
      Constructs a new ValueExpressionLiteral for deserialization.
      ValueExpressionLiteral​(java.lang.Object value, java.lang.Class<?> expectedType)
      Constructs a new ValueExpressionLiteral.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      boolean equals​(ValueExpressionLiteral ve)
      Compares this literal value expression with another for equality.
      java.lang.Class<?> getExpectedType()
      Returns the expected type of the result of this expression.
      java.lang.String getExpressionString()
      Returns the original string representation of this EL expression as it was parsed.
      java.lang.Class<?> getType​(ELContext context)
      Returns the type of the result produced by evaluating this expression.
      <T> T getValue​(ELContext context)
      Evaluates this expression and returns the result.
      int hashCode()  
      boolean isLiteralText()
      Returns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.
      boolean isReadOnly​(ELContext context)
      Determines whether the property referenced by this expression is read-only.
      void readExternal​(java.io.ObjectInput in)  
      void setValue​(ELContext context, java.lang.Object value)
      Sets the value of the property referenced by this expression.
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValueExpressionLiteral

        public ValueExpressionLiteral()
        Constructs a new ValueExpressionLiteral for deserialization.
      • ValueExpressionLiteral

        public ValueExpressionLiteral​(java.lang.Object value,
                                      java.lang.Class<?> expectedType)
        Constructs a new ValueExpressionLiteral.
        Parameters:
        value - The literal value
        expectedType - The expected return type
    • Method Detail

      • getValue

        public <T> T getValue​(ELContext context)
        Description copied from class: jakarta.el.ValueExpression
        Evaluates this expression and returns the result.
        Specified by:
        getValue in class ValueExpression
        Type Parameters:
        T - The expected type for the result of evaluating this value expression
        Parameters:
        context - The EL context for this evaluation
        Returns:
        The result of evaluating this value expression
      • setValue

        public void setValue​(ELContext context,
                             java.lang.Object value)
        Description copied from class: jakarta.el.ValueExpression
        Sets the value of the property referenced by this expression.
        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
      • isReadOnly

        public boolean isReadOnly​(ELContext context)
        Description copied from class: jakarta.el.ValueExpression
        Determines whether the property referenced by this expression is read-only.
        Specified by:
        isReadOnly in class ValueExpression
        Parameters:
        context - The EL context for this evaluation
        Returns:
        true if this expression is read only otherwise false
      • getType

        public java.lang.Class<?> getType​(ELContext context)
        Description copied from class: jakarta.el.ValueExpression
        Returns the type of the result produced by evaluating this expression.
        Specified by:
        getType in class ValueExpression
        Parameters:
        context - The EL context for this evaluation
        Returns:
        The type of the result of this value expression
      • getExpectedType

        public java.lang.Class<?> getExpectedType()
        Description copied from class: jakarta.el.ValueExpression
        Returns the expected type of the result of this expression.
        Specified by:
        getExpectedType in class ValueExpression
        Returns:
        The expected result type, or Object.class if no specific type is expected
      • getExpressionString

        public java.lang.String getExpressionString()
        Description copied from class: jakarta.el.Expression
        Returns the original string representation of this EL expression as it was parsed.
        Specified by:
        getExpressionString in class Expression
        Returns:
        the string representation of this expression
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class Expression
      • equals

        public boolean equals​(ValueExpressionLiteral ve)
        Compares this literal value expression with another for equality.
        Parameters:
        ve - The other literal value expression
        Returns:
        true if the values are equal, false otherwise
      • isLiteralText

        public boolean isLiteralText()
        Description copied from class: jakarta.el.Expression
        Returns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.
        Specified by:
        isLiteralText in class Expression
        Returns:
        true if this expression is a literal text, false otherwise
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException