artofillusion.script
Interface ScriptEngine

All Known Implementing Classes:
BeanshellScriptEngine, GroovyScriptEngine

public interface ScriptEngine

This interface represents an engine that can compile and execute scripts.


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.
 

Method Detail

getName

java.lang.String getName()
Get the name of the scripting language this engine implements.


getFilenameExtension

java.lang.String getFilenameExtension()
Get the filename extension used to identify files written in this engine's language.


setOutput

void setOutput(java.io.PrintStream out)
Set a stream to which script output should be directed.


addImport

void addImport(java.lang.String packageOrClass)
               throws java.lang.Exception
Add a package or class that should be automatically imported in every script.

Throws:
java.lang.Exception

executeScript

void executeScript(java.lang.String script,
                   java.util.Map<java.lang.String,java.lang.Object> variables)
                   throws ScriptException
Execute a script.

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

ToolScript createToolScript(java.lang.String script)
                            throws ScriptException
Compile a script that can be executed as a tool script.

Parameters:
script - the source code of the script
Throws:
ScriptException

createObjectScript

ObjectScript createObjectScript(java.lang.String script)
                                throws ScriptException
Compile a script that can be executed as an object script.

Parameters:
script - the source code of the script
Throws:
ScriptException


Copyright © 1999-2011 by Peter Eastman.