Class AbstractScriptExecutor
java.lang.Object
org.springframework.integration.scripting.jsr223.AbstractScriptExecutor
- All Implemented Interfaces:
ScriptExecutor
- Direct Known Subclasses:
DefaultScriptExecutor
,KotlinScriptExecutor
,PythonScriptExecutor
Base Class for
ScriptExecutor
.- Since:
- 2.1
- Author:
- David Turanski, Mark Fisher, Artem Bilan, Gary Russell
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractScriptExecutor
(String language) protected
AbstractScriptExecutor
(ScriptEngine scriptEngine) -
Method Summary
Modifier and TypeMethodDescriptionexecuteScript
(ScriptSource scriptSource, Map<String, Object> variables) Execute a script from the providedScriptSource
with an optional bindingvariables
.protected abstract Object
postProcess
(Object result, ScriptEngine scriptEngine, String script, Bindings bindings) Subclasses may implement this to provide any special handling requiredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.scripting.ScriptExecutor
executeScript
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractScriptExecutor
-
AbstractScriptExecutor
-
-
Method Details
-
getScriptEngine
-
executeScript
Description copied from interface:ScriptExecutor
Execute a script from the providedScriptSource
with an optional bindingvariables
.- Specified by:
executeScript
in interfaceScriptExecutor
- Parameters:
scriptSource
- The script source.variables
- The variables.- Returns:
- The result of the execution.
-
postProcess
protected abstract Object postProcess(Object result, ScriptEngine scriptEngine, String script, Bindings bindings) Subclasses may implement this to provide any special handling required- Parameters:
result
- the result.scriptEngine
- the engine.script
- the script.bindings
- the bindings.- Returns:
- modified result
-