Is there any way to do a jexl method invocation whithout specifying the
object?
This is how I have done it until now:
String jexlExp = "foo.bar()";
Expression e = ExpressionFactory.createExpression(jexlExp);
JexlContext jc = JexlHelper.createContext();
jc.getVars().put("foo", new Foo());
Object o = e.evaluate(jc);
System.out.println(o.toString());
But I want something like this:(This code produces errors)
String jexlExp = "bar()";
Expression e = ExpressionFactory.createExpression(jexlExp);
JexlContext jc = JexlHelper.createContext();
Object o = e.evaluate(jc);
System.out.println(o.toString());
I want the evaluate method to know(in some way) that each method in
the jexl expression always refers to the class Foo (without specifying it
)