Class TreeMethodExpression

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

public final class TreeMethodExpression extends jakarta.el.MethodExpression
A method expression is ready to be evaluated (by calling either invoke(ELContext, Object[]) or getMethodInfo(ELContext)). Instances of this class are usually created using an ExpressionFactoryImpl.
Author:
Christoph Beck
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TreeMethodExpression(TreeStore store, jakarta.el.FunctionMapper functions, jakarta.el.VariableMapper variables, TypeConverter converter, String expr, Class<?> returnType, Class<?>[] paramTypes)
    Create a new method 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.
     
    jakarta.el.MethodInfo
    getMethodInfo(jakarta.el.ELContext context)
    Evaluates the expression and answers information about the method
    int
     
    invoke(jakarta.el.ELContext context, Object[] paramValues)
    Evaluates the expression and invokes the method.
    boolean
    Answer true if this is a deferred expression (starting with #{)
    boolean
     
    boolean
     
     

    Methods inherited from class jakarta.el.MethodExpression

    getMethodReference

    Methods inherited from class java.lang.Object

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

    • TreeMethodExpression

      public TreeMethodExpression(TreeStore store, jakarta.el.FunctionMapper functions, jakarta.el.VariableMapper variables, TypeConverter converter, String expr, Class<?> returnType, Class<?>[] paramTypes)
      Create a new method expression. The expression must be an lvalue expression or literal text. The expected return type may be null, meaning "don't care". If it is an lvalue expression, the parameter types must not be null. If it is literal text, the expected return type must not be void.
      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
      returnType - the expected return type (may be null)
      paramTypes - the expected parameter types (must not be null for lvalues)
  • Method Details

    • getMethodInfo

      public jakarta.el.MethodInfo getMethodInfo(jakarta.el.ELContext context) throws jakarta.el.ELException
      Evaluates the expression and answers information about the method
      Specified by:
      getMethodInfo in class jakarta.el.MethodExpression
      Parameters:
      context - used to resolve properties (base.property and base[property])
      Returns:
      method information or null for literal expressions
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. suitable method not found)
    • getExpressionString

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

      public Object invoke(jakarta.el.ELContext context, Object[] paramValues) throws jakarta.el.ELException
      Evaluates the expression and invokes the method.
      Specified by:
      invoke in class jakarta.el.MethodExpression
      Parameters:
      context - used to resolve properties (base.property and base[property])
      paramValues -
      Returns:
      method result or null if this is a literal text expression
      Throws:
      jakarta.el.ELException - if evaluation fails (e.g. suitable method not found)
    • isLiteralText

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

      public boolean isParametersProvided()
      Overrides:
      isParametersProvided in class jakarta.el.MethodExpression
      Returns:
      true if this is a method invocation expression
    • isDeferred

      public boolean isDeferred()
      Answer true if this is a deferred expression (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 method expressions are equal if
      1. their builders are equal
      2. their structural id's are equal
      3. their bindings are equal
      4. their expected types match
      5. their parameter 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 -