|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.script.GroovyScriptEngine
public class GroovyScriptEngine
This ScriptEngine implements the Groovy scripting language.
Constructor Summary | |
---|---|
GroovyScriptEngine(java.lang.ClassLoader parent)
|
Method Summary | |
---|---|
void |
addImport(java.lang.String packageOrClass)
Add a package or class that should be automatically imported in every script. |
ObjectScript |
createObjectScript(java.lang.String script)
Compile a script that can be executed as an object script. |
ToolScript |
createToolScript(java.lang.String script)
Compile a script that can be executed as a tool script. |
void |
executeScript(java.lang.String script,
java.util.Map<java.lang.String,java.lang.Object> variables)
Execute a script. |
java.lang.String |
getFilenameExtension()
Get the filename extension used to identify files written in this engine's language. |
java.lang.String |
getName()
Get the name of the scripting language this engine implements. |
void |
setOutput(java.io.PrintStream out)
Set a stream to which script output should be directed. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroovyScriptEngine(java.lang.ClassLoader parent)
Method Detail |
---|
public java.lang.String getName()
ScriptEngine
getName
in interface ScriptEngine
public java.lang.String getFilenameExtension()
ScriptEngine
getFilenameExtension
in interface ScriptEngine
public void setOutput(java.io.PrintStream out)
ScriptEngine
setOutput
in interface ScriptEngine
public void addImport(java.lang.String packageOrClass) throws java.lang.Exception
ScriptEngine
addImport
in interface ScriptEngine
java.lang.Exception
public void executeScript(java.lang.String script, java.util.Map<java.lang.String,java.lang.Object> variables) throws ScriptException
ScriptEngine
executeScript
in interface ScriptEngine
script
- the source code of the scriptvariables
- a Map defining values for a set of variables that should be defined in the script
ScriptException
public ToolScript createToolScript(java.lang.String script) throws ScriptException
ScriptEngine
createToolScript
in interface ScriptEngine
script
- the source code of the script
ScriptException
public ObjectScript createObjectScript(java.lang.String script) throws ScriptException
ScriptEngine
createObjectScript
in interface ScriptEngine
script
- the source code of the script
ScriptException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |