public final class TreeMethodExpression extends MethodExpression
invoke(ELContext, Object[]) or getMethodInfo(ELContext)).
Instances of this class are usually created using an ExpressionFactoryImpl.| Constructor and Description |
|---|
TreeMethodExpression(TreeStore store,
FunctionMapper functions,
VariableMapper variables,
TypeConverter converter,
String expr,
Class<?> returnType,
Class<?>[] paramTypes)
Create a new method expression.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dump(PrintWriter writer)
Print the parse tree.
|
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.
|
String |
getExpressionString() |
MethodInfo |
getMethodInfo(ELContext context)
Evaluates the expression and answers information about the method
|
int |
hashCode() |
Object |
invoke(ELContext context,
Object[] paramValues)
Evaluates the expression and invokes the method.
|
boolean |
isDeferred()
Answer
true if this is a deferred expression (starting with #{) |
boolean |
isLiteralText() |
boolean |
isParmetersProvided() |
String |
toString() |
public TreeMethodExpression(TreeStore store, FunctionMapper functions, VariableMapper variables, TypeConverter converter, String expr, Class<?> returnType, Class<?>[] paramTypes)
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.store - used to get the parse tree from.functions - the function mapper used to bind functionsvariables - the variable mapper used to bind variablesexpr - the expression stringreturnType - the expected return type (may be null)paramTypes - the expected parameter types (must not be null for lvalues)public MethodInfo getMethodInfo(ELContext context) throws ELException
getMethodInfo in class MethodExpressioncontext - used to resolve properties (base.property and base[property])null for literal expressionsELException - if evaluation fails (e.g. suitable method not found)public String getExpressionString()
getExpressionString in class Expressionpublic Object invoke(ELContext context, Object[] paramValues) throws ELException
invoke in class MethodExpressioncontext - used to resolve properties (base.property and base[property])paramValues - null if this is a literal text expressionELException - if evaluation fails (e.g. suitable method not found)public boolean isLiteralText()
isLiteralText in class Expressiontrue if this is a literal text expressionpublic boolean isParmetersProvided()
isParmetersProvided in class MethodExpressiontrue if this is a method invocation expressionpublic boolean isDeferred()
true if this is a deferred expression (starting with #{)public boolean equals(Object obj)
equals in class Expressionpublic int hashCode()
hashCode in class Expressionpublic void dump(PrintWriter writer)
writer - Copyright © 2006-2014 Odysseus Software GmbH. All Rights Reserved.