@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)
Directly 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, getOwner, getParameters, getScript, getScriptName, getScriptUrl, getSessionid, hashCode, isLazyFetch, overrideDefaultScriptName, prepareBindings, readFile, setOwner, setScript, setSessionid, toString
public SimpleScript(String script, String engineName)
script
- a String containing script codeengineName
- script's engine execution name.public SimpleScript(URL url, String engineName) throws InvalidScriptException
url
- representing a script source code.engineName
- 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)
script
- a String containing script codeengineName
- script's engine execution name.parameters
- execution parameterspublic SimpleScript(Script<?> original)
original
- script to copyprotected 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>