Class TreeValueExpression

java.lang.Object
jakarta.el.Expression
jakarta.el.ValueExpression
org.camunda.bpm.impl.juel.TreeValueExpression
All Implemented Interfaces:
Serializable

public final class TreeValueExpression extends jakarta.el.ValueExpression
A value expression is ready to be evaluated (by calling either getType(ELContext), getValue(ELContext), isReadOnly(ELContext) or setValue(ELContext, Object). Instances of this class are usually created using an ExpressionFactoryImpl.
Author:
Christoph Beck
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TreeValueExpression(TreeStore store, jakarta.el.FunctionMapper functions, jakarta.el.VariableMapper variables, TypeConverter converter, String expr, Class<?> type)
    Create a new value expression.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dump(PrintWriter writer)
    Print the parse tree.
    boolean
    Expressions are compared using the concept of a structural id: variable and function names are anonymized such that two expressions with same tree structure will also have the same structural id and vice versa.
     
     
    getType(jakarta.el.ELContext context)
    Evaluates the expression as an lvalue and answers the result type.
    getValue(jakarta.el.ELContext context)
    Evaluates the expression as an rvalue and answers the result.
    jakarta.el.ValueReference
    getValueReference(jakarta.el.ELContext context)
     
    int
     
    boolean
    Answer true if this is a deferred expression (containing sub-expressions starting with #{)
    boolean
    Answer true if this could be used as an lvalue.
    boolean
     
    boolean
    isReadOnly(jakarta.el.ELContext context)
    Evaluates the expression as an lvalue and determines if setValue(ELContext, Object) will always fail.
    void
    setValue(jakarta.el.ELContext context, Object value)
    Evaluates the expression as an lvalue and assigns the given value.
     

    Methods inherited from class java.lang.Object

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

    • TreeValueExpression

      public TreeValueExpression(TreeStore store, jakarta.el.FunctionMapper functions, jakarta.el.VariableMapper variables, TypeConverter converter, String expr, Class<?> type)
      Create a new value expression.
      Parameters:
      store - used to get the parse tree from.
      functions - the function mapper used to bind functions
      variables - the variable mapper used to bind variables
      expr - the expression string
      type - the expected type (may be null)
  • Method Details

    • getExpectedType

      public Class<?> getExpectedType()
      Specified by:
      getExpectedType in class jakarta.el.ValueExpression
    • getExpressionString

      public String getExpressionString()
      Specified by:
      getExpressionString in class jakarta.el.Expression
    • getType

      public Class<?> getType(jakarta.el.ELContext context) throws jakarta.el.ELException
      Evaluates the expression as an lvalue and answers the result type.
      Specified by:
      getType in class jakarta.el.ValueExpression
      Parameters:
      context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
      Returns:
      lvalue evaluation type or null for rvalue expressions
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)
    • getValue

      public Object getValue(jakarta.el.ELContext context) throws jakarta.el.ELException
      Evaluates the expression as an rvalue and answers the result.
      Specified by:
      getValue in class jakarta.el.ValueExpression
      Parameters:
      context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
      Returns:
      rvalue evaluation result
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)
    • isReadOnly

      public boolean isReadOnly(jakarta.el.ELContext context) throws jakarta.el.ELException
      Evaluates the expression as an lvalue and determines if setValue(ELContext, Object) will always fail.
      Specified by:
      isReadOnly in class jakarta.el.ValueExpression
      Parameters:
      context - used to resolve properties (base.property and base[property]) and to determine the result from the last base/property pair
      Returns:
      true if setValue(ELContext, Object) always fails.
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. property not found, type conversion failed, ...)
    • setValue

      public void setValue(jakarta.el.ELContext context, Object value) throws jakarta.el.ELException
      Evaluates the expression as an lvalue and assigns the given value.
      Specified by:
      setValue in class jakarta.el.ValueExpression
      Parameters:
      context - used to resolve properties (base.property and base[property]) and to perform the assignment to the last base/property pair
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. property not found, type conversion failed, assignment failed...)
    • isLiteralText

      public boolean isLiteralText()
      Specified by:
      isLiteralText in class jakarta.el.Expression
      Returns:
      true if this is a literal text expression
    • getValueReference

      public jakarta.el.ValueReference getValueReference(jakarta.el.ELContext context)
      Overrides:
      getValueReference in class jakarta.el.ValueExpression
    • isLeftValue

      public boolean isLeftValue()
      Answer true if this could be used as an lvalue. This is the case for eval expressions consisting of a simple identifier or a nonliteral prefix, followed by a sequence of property operators (. or [])
    • isDeferred

      public boolean isDeferred()
      Answer true if this is a deferred expression (containing sub-expressions starting with #{)
    • equals

      public boolean equals(Object obj)
      Expressions are compared using the concept of a structural id: variable and function names are anonymized such that two expressions with same tree structure will also have the same structural id and vice versa. Two value expressions are equal if
      1. their structural id's are equal
      2. their bindings are equal
      3. their expected types are equal
      Specified by:
      equals in class jakarta.el.Expression
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class jakarta.el.Expression
    • toString

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

      public void dump(PrintWriter writer)
      Print the parse tree.
      Parameters:
      writer -