Class AbstractScriptExecutor
java.lang.Object
org.springframework.integration.scripting.jsr223.AbstractScriptExecutor
- All Implemented Interfaces:
ScriptExecutor
- Direct Known Subclasses:
DefaultScriptExecutor,KotlinScriptExecutor,PythonScriptExecutor
public abstract class AbstractScriptExecutor extends Object implements ScriptExecutor
Base Class for
ScriptExecutor.- Since:
- 2.1
- Author:
- David Turanski, Mark Fisher, Artem Bilan, Gary Russell
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScriptExecutor(String language)protectedAbstractScriptExecutor(ScriptEngine scriptEngine) -
Method Summary
Modifier and Type Method Description ObjectexecuteScript(ScriptSource scriptSource, Map<String,Object> variables)Execute a script from the providedScriptSourcewith an optional bindingvariables.ScriptEnginegetScriptEngine()protected abstract ObjectpostProcess(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, waitMethods inherited from interface org.springframework.integration.scripting.ScriptExecutor
executeScript
-
Field Details
-
Constructor Details
-
Method Details
-
getScriptEngine
-
executeScript
Description copied from interface:ScriptExecutorExecute a script from the providedScriptSourcewith an optional bindingvariables.- Specified by:
executeScriptin 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
-