public abstract class AbstractScriptHelper extends Object implements ScriptHelper
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
AbstractScriptHelper() |
| Modifier and Type | Method and Description |
|---|---|
Object |
call(Object obj,
String methodCall)
Call a method on the given object.
|
protected Object |
doCall(Object obj,
String methodCall) |
Object |
eval(String expr)
Evaluate the given expression.
|
Bindings |
getBindings()
Get current script bindings.
|
void |
setBindings(Bindings bindings)
Set script bindings.
|
boolean |
test(String expr)
Evaluate a boolean expression.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitevalpublic Bindings getBindings()
ScriptHelpergetBindings in interface ScriptHelperpublic void setBindings(Bindings bindings)
ScriptHelpersetBindings in interface ScriptHelperbindings - new script bindings.public final boolean test(String expr)
ScriptHelpertest in interface ScriptHelperexpr - a boolean expressionpublic Object call(Object obj, String methodCall)
ScriptHelperThe methodCall is a string expression containing arguments to be passed. For example:
scriptHelper.call(bean, "test(var1, var2, var3)");This is a convenient method to call:
scriptHelper.call(bean, "test", new Object[] { var1, var2, var3 });
call in interface ScriptHelperobj - the object on which method should be calledmethodCall - method call expressionpublic Object eval(String expr)
ScriptHelpereval in interface ScriptHelperexpr - the expression to evaluate