Package com.axelor.script
Interface ScriptHelper
- All Known Implementing Classes:
AbstractScriptHelper
,CompositeScriptHelper
,ELScriptHelper
,GroovyScriptHelper
,JavaScriptScriptHelper
public interface ScriptHelper
The DataScriptHelper interface to implement dynamic script evaluation support.
-
Method Summary
Modifier and TypeMethodDescriptionCall a method on the given object.Evaluate the given expression.Evaluate the given expression with the given bindings.Get current script bindings.void
setBindings
(Bindings bindings) Set script bindings.boolean
Evaluate a boolean expression.
-
Method Details
-
getBindings
Bindings getBindings()Get current script bindings.- Returns:
- bindings
-
setBindings
Set script bindings.- Parameters:
bindings
- new script bindings.
-
eval
Evaluate the given expression.- Parameters:
expr
- the expression to evaluate- Returns:
- expression result
-
eval
Evaluate the given expression with the given bindings.- Parameters:
expr
- the expression to evaluatebindings
- the context bindings- Returns:
- expression result
- Throws:
Exception
-
test
Evaluate a boolean expression.- Parameters:
expr
- a boolean expression- Returns:
- true or false
-
call
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 });
- Parameters:
obj
- the object on which method should be calledmethodCall
- method call expression- Returns:
- return value of the method
-