Details
-
Improvement
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
1.1
-
None
Description
JexlContext need provide additional methods, such as
1) Object getProperty(Object object, String propName);
2) void setProperty(Object object, String propName, Object propValue);
3) Object invokeMethod(Object object, String methodName, Object[] params);
where object can be null for the non-object properties/methods.
ASTIdentifier, ASTArrayAccess, ASTAssignment, and ASTMethod can use them for unresolvable properties/methods.
This is similar to what are changed by myFacese over commons EL to support friendly VariableResolver and PropertyResolver for applications.
I use "ObjectinvokeMethod()" instead of "Method getMethod(object, methodNae)", because a method may not be implemented as a java method. Such as in commons validator, validators are registered in the configuration file of validation forms.