public class ScriptEngineScript extends AbstractScript
If you have the appropriate ScriptEngine available (see https://scripting.dev.java.net/) you can invoke it using the supplied type or extension in the constructor. For example:
Script script = new ScriptEngineScript(file, "ruby"); script.run();
Copyright 2005-2007 Partner Software, Inc.
| Constructor and Description |
|---|
ScriptEngineScript(VfsFile file)
Create a script using the ScriptEngine corresponding to the given file's
extension.
|
ScriptEngineScript(VfsFile file,
java.lang.String type)
Create a script using a ScriptEngine with the given type name.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getType() |
java.lang.Object |
getVariable(java.lang.String variableName)
Gets a single variable defined for the script.
|
protected void |
reloadImp()
Subclasses should implement this method to do any maintenance associated
with changes in the source file.
|
static void |
resetManager()
Resets the script engine manager.
|
protected java.lang.Object |
runScriptImp(Naming<java.lang.Object> variables)
Subclasses should implement this method with their actual script-running
implementation.
|
static boolean |
supportsFile(VfsFile file) |
getFile, getName, getScriptLog, getThrown, getVariables, isModified, parse, run, runScript, runThreaded, setThrown, setVariable, setVariables, toStringpublic ScriptEngineScript(VfsFile file)
public ScriptEngineScript(VfsFile file, java.lang.String type)
public static void resetManager()
public static boolean supportsFile(VfsFile file)
public java.lang.String getType()
protected void reloadImp()
throws java.lang.Exception
AbstractScriptreloadImp in class AbstractScriptjava.lang.Exceptionprotected java.lang.Object runScriptImp(Naming<java.lang.Object> variables) throws java.lang.Exception
AbstractScriptrunScriptImp in class AbstractScriptjava.lang.Exceptionpublic java.lang.Object getVariable(java.lang.String variableName)
ScriptScript.setVariable(String, Object).getVariable in interface ScriptgetVariable in class AbstractScriptvariableName - name of the variable in the script