Package com.axelor.script
Class AbstractScriptHelper
java.lang.Object
com.axelor.script.AbstractScriptHelper
- All Implemented Interfaces:
ScriptHelper
- Direct Known Subclasses:
CompositeScriptHelper
,ELScriptHelper
,GroovyScriptHelper
,JavaScriptScriptHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCall a method on the given object.protected Object
Evaluate the given expression.Get current script bindings.void
setBindings
(Bindings bindings) Set script bindings.final boolean
Evaluate a boolean expression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.axelor.script.ScriptHelper
eval
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
AbstractScriptHelper
public AbstractScriptHelper()
-
-
Method Details
-
getBindings
Description copied from interface:ScriptHelper
Get current script bindings.- Specified by:
getBindings
in interfaceScriptHelper
- Returns:
- bindings
-
setBindings
Description copied from interface:ScriptHelper
Set script bindings.- Specified by:
setBindings
in interfaceScriptHelper
- Parameters:
bindings
- new script bindings.
-
test
Description copied from interface:ScriptHelper
Evaluate a boolean expression.- Specified by:
test
in interfaceScriptHelper
- Parameters:
expr
- a boolean expression- Returns:
- true or false
-
call
Description copied from interface:ScriptHelper
Call a method on the given object.The 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 });
- Specified by:
call
in interfaceScriptHelper
- Parameters:
obj
- the object on which method should be calledmethodCall
- method call expression- Returns:
- return value of the method
-
doCall
-
eval
Description copied from interface:ScriptHelper
Evaluate the given expression.- Specified by:
eval
in interfaceScriptHelper
- Parameters:
expr
- the expression to evaluate- Returns:
- expression result
-