Interface Interpreter
- All Superinterfaces:
Localizable
A high level interface that represents an interpreter engine for
a particular scripting language.
- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionvoidbindObject(String name, Object object) This method should register a particular JavaObjectin the environment of the interpreter.voiddispose()This method can dispose resources used by the interpreter when it is no longer used.This method should evaluate a piece of script.This method should evaluate a piece of script associated to a given description.This method should evaluate a piece of script using aStringinstead of aReader.String[]Returns the content types of the scripting languages this interpreter handles.voidThis method should change the outputWriterthat will be used when output function of the scripting langage is used.Methods inherited from interface Localizable
formatMessage, getLocale, setLocale
-
Method Details
-
getMimeTypes
String[] getMimeTypes()Returns the content types of the scripting languages this interpreter handles. -
evaluate
This method should evaluate a piece of script associated to a given description.- Parameters:
scriptreader- ajava.io.Readeron the piece of scriptdescription- description which can be later used (e.g., for error messages).- Returns:
- if no exception is thrown during the call, should return the value of the last expression evaluated in the script
- Throws:
InterpreterExceptionIOException
-
evaluate
This method should evaluate a piece of script.- Parameters:
scriptreader- ajava.io.Readeron 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
- Throws:
InterpreterExceptionIOException
-
evaluate
This method should evaluate a piece of script using aStringinstead of aReader. This usually allows do easily do some caching.- Parameters:
script- 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
- Throws:
InterpreterException
-
bindObject
-
setOut
This method should change the outputWriterthat will be used when output function of the scripting langage is used.- Parameters:
output- the new outWriter.
-
dispose
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.
-