org.apache.batik.script
Interface Interpreter
- All Superinterfaces:
- Localizable
- All Known Implementing Classes:
- JaclInterpreter, JPythonInterpreter, RhinoInterpreter
- public interface Interpreter
- extends Localizable
An hight level interface that represents an interpreter engine of
a particular scripting language.
Method Summary |
void |
bindObject(java.lang.String name,
java.lang.Object object)
This method should register a particular Java Object in
the environment of the interpreter. |
void |
dispose()
This method can dispose resources used by the interpreter when it is
no longer used. |
java.lang.Object |
evaluate(java.io.Reader scriptreader)
This method should evaluate a piece of script. |
void |
setOut(java.io.Writer output)
This method should change the output Writer that will be
used when output function of the scripting langage is used. |
evaluate
public java.lang.Object evaluate(java.io.Reader scriptreader)
throws InterpreterException,
java.io.IOException
- This method should evaluate a piece of script.
- Parameters:
scriptreader
- a java.io.Reader
on the piece of script- Returns:
- if no exception is thrown during the call, should return the
value of the last expression evaluated in the script
bindObject
public void bindObject(java.lang.String name,
java.lang.Object object)
- This method should register a particular Java
Object
in
the environment of the interpreter.
- Parameters:
name
- the name of the script object to createobject
- the Java object
setOut
public void setOut(java.io.Writer output)
- This method should change the output
Writer
that will be
used when output function of the scripting langage is used.
- Parameters:
output
- the new out Writer
.
dispose
public void dispose()
- This method can dispose resources used by the interpreter when it is
no longer used. Be careful, you SHOULD NOT use this interpreter instance
after calling this method.
Copyright © 2001 Apache Software Foundation. All Rights Reserved.