artofillusion.script
Class GroovyScriptEngine

java.lang.Object
  extended by artofillusion.script.GroovyScriptEngine
All Implemented Interfaces:
ScriptEngine

public class GroovyScriptEngine
extends java.lang.Object
implements ScriptEngine

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

GroovyScriptEngine

public GroovyScriptEngine(java.lang.ClassLoader parent)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ScriptEngine
Get the name of the scripting language this engine implements.

Specified by:
getName in interface ScriptEngine

getFilenameExtension

public java.lang.String getFilenameExtension()
Description copied from interface: ScriptEngine
Get the filename extension used to identify files written in this engine's language.

Specified by:
getFilenameExtension in interface ScriptEngine

setOutput

public void setOutput(java.io.PrintStream out)
Description copied from interface: ScriptEngine
Set a stream to which script output should be directed.

Specified by:
setOutput in interface ScriptEngine

addImport

public void addImport(java.lang.String packageOrClass)
               throws java.lang.Exception
Description copied from interface: ScriptEngine
Add a package or class that should be automatically imported in every script.

Specified by:
addImport in interface ScriptEngine
Throws:
java.lang.Exception

executeScript

public void executeScript(java.lang.String script,
                          java.util.Map<java.lang.String,java.lang.Object> variables)
                   throws ScriptException
Description copied from interface: ScriptEngine
Execute a script.

Specified by:
executeScript in interface ScriptEngine
Parameters:
script - the source code of the script
variables - a Map defining values for a set of variables that should be defined in the script
Throws:
ScriptException

createToolScript

public ToolScript createToolScript(java.lang.String script)
                            throws ScriptException
Description copied from interface: ScriptEngine
Compile a script that can be executed as a tool script.

Specified by:
createToolScript in interface ScriptEngine
Parameters:
script - the source code of the script
Throws:
ScriptException

createObjectScript

public ObjectScript createObjectScript(java.lang.String script)
                                throws ScriptException
Description copied from interface: ScriptEngine
Compile a script that can be executed as an object script.

Specified by:
createObjectScript in interface ScriptEngine
Parameters:
script - the source code of the script
Throws:
ScriptException


Copyright © 1999-2011 by Peter Eastman.