public abstract class AbstractScriptExecutor extends Object implements ScriptExecutor
ScriptExecutor
Modifier and Type | Field and Description |
---|---|
protected String |
language |
protected Log |
logger |
protected ScriptEngine |
scriptEngine |
Modifier | Constructor and Description |
---|---|
protected |
AbstractScriptExecutor(String language) |
Modifier and Type | Method and Description |
---|---|
Object |
executeScript(ScriptSource scriptSource) |
Object |
executeScript(ScriptSource scriptSource,
Map<String,Object> variables) |
protected abstract Object |
postProcess(Object result,
ScriptEngine scriptEngine,
String script,
Bindings bindings)
Subclasses may implement this to provide any special handling required
|
protected final Log logger
protected final ScriptEngine scriptEngine
protected final String language
protected AbstractScriptExecutor(String language)
public Object executeScript(ScriptSource scriptSource)
executeScript
in interface ScriptExecutor
scriptSource
- The script source.public Object executeScript(ScriptSource scriptSource, Map<String,Object> variables)
executeScript
in interface ScriptExecutor
scriptSource
- The script source.variables
- The variables.protected abstract Object postProcess(Object result, ScriptEngine scriptEngine, String script, Bindings bindings)
result
- the result.scriptEngine
- the engine.script
- the script.bindings
- the bindings.