Package org.apache.el

Class ValueExpressionImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.Class<?> getExpectedType()
      Returns the expected type of the result of this expression.
      java.lang.String getExpressionString()
      Returns the type the result of the expression will be coerced to after evaluation.
      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.
      ValueReference getValueReference​(ELContext context)
      Returns a reference to the resolved property for this expression.
      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.
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

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

      • ValueExpressionImpl

        public ValueExpressionImpl()
        Constructs a new ValueExpressionImpl.
      • ValueExpressionImpl

        public ValueExpressionImpl​(java.lang.String expr,
                                   org.apache.el.parser.Node node,
                                   FunctionMapper fnMapper,
                                   VariableMapper varMapper,
                                   java.lang.Class<?> expectedType)
        Constructs a new ValueExpressionImpl.
        Parameters:
        expr - The expression string
        node - The AST node
        fnMapper - The function mapper
        varMapper - The variable mapper
        expectedType - The expected return type
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in class 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()
        Returns the type the result of the expression will be coerced to after evaluation.
        Specified by:
        getExpressionString in class Expression
        Returns:
        the expectedType passed to the ExpressionFactory.createValueExpression method that created this ValueExpression.
        See Also:
        Expression.getExpressionString()
      • getValue

        public <T> T getValue​(ELContext context)
                       throws PropertyNotFoundException,
                              ELException
        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
        Throws:
        PropertyNotFoundException - If a property/variable resolution failed because no match was found or a match was found but was not readable
        ELException - Wraps any exception throw whilst resolving a property or variable
      • 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
      • 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
      • writeExternal

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getValueReference

        public ValueReference getValueReference​(ELContext context)
        Description copied from class: jakarta.el.ValueExpression
        Returns a reference to the resolved property for this expression.

        This default implementation always returns null. Subclasses should override this method to provide the resolved base object and property.

        Overrides:
        getValueReference in class ValueExpression
        Parameters:
        context - The EL context for this evaluation
        Returns:
        This default implementation always returns null