Package org.camunda.bpm.engine.impl.juel
Class TreeMethodExpression
- java.lang.Object
- 
- org.camunda.bpm.engine.impl.javax.el.Expression
- 
- org.camunda.bpm.engine.impl.javax.el.MethodExpression
- 
- org.camunda.bpm.engine.impl.juel.TreeMethodExpression
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public final class TreeMethodExpression extends MethodExpression A method expression is ready to be evaluated (by calling eitherinvoke(ELContext, Object[])orgetMethodInfo(ELContext)). Instances of this class are usually created using anExpressionFactoryImpl.- Author:
- Christoph Beck
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description TreeMethodExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, java.lang.String expr, java.lang.Class<?> returnType, java.lang.Class<?>[] paramTypes)Create a new method expression.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.PrintWriter writer)Print the parse tree.booleanequals(java.lang.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.java.lang.StringgetExpressionString()Returns the original String used to create this Expression, unmodified.MethodInfogetMethodInfo(ELContext context)Evaluates the expression and answers information about the methodinthashCode()Returns the hash code for this Expression.java.lang.Objectinvoke(ELContext context, java.lang.Object[] paramValues)Evaluates the expression and invokes the method.booleanisDeferred()Answertrueif this is a deferred expression (starting with#{)booleanisLiteralText()Returns whether this expression was created from only literal text.booleanisParmetersProvided()Return whether this MethodExpression was created with parameters.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
TreeMethodExpressionpublic TreeMethodExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, java.lang.String expr, java.lang.Class<?> returnType, java.lang.Class<?>[] paramTypes) Create a new method expression. The expression must be an lvalue expression or literal text. The expected return type may benull, meaning "don't care". If it is an lvalue expression, the parameter types must not benull. If it is literal text, the expected return type must not bevoid.- 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- nullfor lvalues)
 
 
- 
 - 
Method Detail- 
getMethodInfopublic MethodInfo getMethodInfo(ELContext context) throws ELException Evaluates the expression and answers information about the method- Specified by:
- getMethodInfoin class- MethodExpression
- Parameters:
- context- used to resolve properties (- base.propertyand- base[property])
- Returns:
- method information or nullfor literal expressions
- Throws:
- ELException- if evaluation fails (e.g. suitable method not found)
 
 - 
getExpressionStringpublic java.lang.String getExpressionString() Description copied from class:ExpressionReturns the original String used to create this Expression, unmodified. This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed). This method does not provide sufficient information to re-create an expression. Two different expressions can have exactly the same expression string but different function mappings. Serialization should be used to save and restore the state of an Expression.- Specified by:
- getExpressionStringin class- Expression
- Returns:
- The original expression String.
 
 - 
invokepublic java.lang.Object invoke(ELContext context, java.lang.Object[] paramValues) throws ELException Evaluates the expression and invokes the method.- Specified by:
- invokein class- MethodExpression
- Parameters:
- context- used to resolve properties (- base.propertyand- base[property])
- paramValues-
- Returns:
- method result or nullif this is a literal text expression
- Throws:
- ELException- if evaluation fails (e.g. suitable method not found)
 
 - 
isLiteralTextpublic boolean isLiteralText() Description copied from class:ExpressionReturns whether this expression was created from only literal text. This method must return true if and only if the expression string this expression was created from contained no unescaped EL delimeters (${...} or #{...}).- Specified by:
- isLiteralTextin class- Expression
- Returns:
- trueif this is a literal text expression
 
 - 
isParmetersProvidedpublic boolean isParmetersProvided() Description copied from class:MethodExpressionReturn whether this MethodExpression was created with parameters.This method must return trueif and only if parameters are specified in the EL, using the expr-a.expr-b(...) syntax.- Overrides:
- isParmetersProvidedin class- MethodExpression
- Returns:
- trueif this is a method invocation expression
 
 - 
isDeferredpublic boolean isDeferred() Answertrueif this is a deferred expression (starting with#{)
 - 
equalspublic boolean equals(java.lang.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- their builders are equal
- their structural id's are equal
- their bindings are equal
- their expected types match
- their parameter types are equal
 - Specified by:
- equalsin class- Expression
- Parameters:
- obj- the Object to test for equality.
- Returns:
- true if obj equals this Expression; false otherwise.
 
 - 
hashCodepublic int hashCode() Description copied from class:ExpressionReturns the hash code for this Expression. See the note in theExpression.equals(Object)method on how two expressions can be equal if their expression Strings are different. Recall that if two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Implementations must take special note and implement hashCode correctly.- Specified by:
- hashCodein class- Expression
- Returns:
- The hash code for this Expression.
- See Also:
- Expression.equals(Object),- Hashtable,- Object.hashCode()
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
dumppublic void dump(java.io.PrintWriter writer) Print the parse tree.- Parameters:
- writer-
 
 
- 
 
-