@PublicAPI public class SimpleScript extends Script<Object>
ARGUMENTS_NAME, DEFAULT_OUTPUT_MAX_SIZE, id, logger, MD5, parameters, script, scriptEngineLookupName, url
Constructor and Description |
---|
SimpleScript(File file,
Serializable[] parameters)
Create a script from a file.
|
SimpleScript(Script<?> original)
Copy constructor
|
SimpleScript(String script,
String engineName)
Directly create a script with a string.
|
SimpleScript(String script,
String engineName,
Serializable[] parameters)
Directly create a script with a string.
|
SimpleScript(URL url,
Serializable[] parameters)
Create a script from an URL.
|
SimpleScript(URL url,
String engineName,
Serializable[] parameters)
Create a script from an URL.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getDefaultScriptName() |
String |
getId()
String identifying the script.
|
protected Reader |
getReader()
The reader used to read the script.
|
protected ScriptResult<Object> |
getResult(Object evalResult,
Bindings bindings)
Return the variable awaited from the script execution
|
protected void |
prepareSpecialBindings(Bindings bindings)
There is no parameter to give to the selection script.
|
createScriptEngine, digest, display, equals, execute, execute, fetchScript, fetchScriptWithExceptionHandling, fetchUrlIfNeeded, getEngineName, getParameters, getScript, getScriptName, getScriptUrl, hashCode, overrideDefaultScriptName, prepareBindings, readFile, setScript, toString
public SimpleScript(String script, String engineName) throws InvalidScriptException
script
- a String containing script codeengineName
- script's engine execution name.InvalidScriptException
- if the creation fails.public SimpleScript(File file, Serializable[] parameters) throws InvalidScriptException
file
- a file containing script code.parameters
- execution parametersInvalidScriptException
- if creation fails.public SimpleScript(URL url, Serializable[] parameters) throws InvalidScriptException
url
- an URL containing script code.parameters
- execution parametersInvalidScriptException
- if the creation fails.public SimpleScript(URL url, String engineName, Serializable[] parameters) throws InvalidScriptException
url
- an URL containing script code.engineName
- script's engine execution name.parameters
- execution parametersInvalidScriptException
- if the creation fails.public SimpleScript(String script, String engineName, Serializable[] parameters) throws InvalidScriptException
script
- a String containing script codeengineName
- script's engine execution name.parameters
- execution parametersInvalidScriptException
- if the creation fails.public SimpleScript(Script<?> original) throws InvalidScriptException
original
- script to copyInvalidScriptException
protected String getDefaultScriptName()
getDefaultScriptName
in class Script<Object>
public String getId()
Script
getId
in class Script<Object>
Script.getId()
protected Reader getReader()
Script
protected ScriptResult<Object> getResult(Object evalResult, Bindings bindings)
Script
getResult
in class Script<Object>
Script.getResult(Object, Bindings)
protected void prepareSpecialBindings(Bindings bindings)
prepareSpecialBindings
in class Script<Object>