public interface ScriptInvocationHandler
Implementations can be registered with a ScriptableDataSet to be called before and after script contained in a data set field is executed. This can be used to add commonly used import statements for all scripts of a given language or to post-process the result of a script execution.
Implementations must define a default constructor, if they shall be used as standard handler for a language.
| Modifier and Type | Method and Description |
|---|---|
String |
getLanguageName()
Must return the name of the scripting language for which this handler can be registered, as expected by the JSR
223 scripting engine manager, e.g.
|
Object |
postInvoke(Object object)
Will be called after a script contained in a field of a data set is executed.
|
String |
preInvoke(String script)
Will be called before a script contained in a field of a data set is executed.
|
void |
setScriptEngine(ScriptEngine engine)
Makes the scripting engine available to handler implementations.
|
String getLanguageName()
String preInvoke(String script)
script - The script to be executed.Object postInvoke(Object object)
object - The result of the script execution.void setScriptEngine(ScriptEngine engine)
engine - The scripting engine used to execute the current script.Copyright © 2011–2020 hazendaz. All rights reserved.