|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.batik.script.jpython.JPythonInterpreter
A simple implementation of Interpreter interface to use
JPython python parser.
| Constructor Summary | |
JPythonInterpreter()
|
|
| Method Summary | |
void |
bindObject(String name,
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. |
Object |
evaluate(Reader scriptreader)
This method should evaluate a piece of script. |
Object |
evaluate(Reader scriptreader,
String description)
This method should evaluate a piece of script associated to a given description. |
Object |
evaluate(String script)
This method should evaluate a piece of script using a String
instead of a Reader. |
String |
formatMessage(String key,
Object[] args)
Creates and returns a localized message, given the key of the message in the resource bundle and the message parameters. |
Locale |
getLocale()
Returns the current locale or null if the locale currently used is the default one. |
void |
setLocale(Locale locale)
Provides a way to the user to specify a locale which override the default one. |
void |
setOut(Writer out)
This method should change the output Writer that will be
used when output function of the scripting langage is used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JPythonInterpreter()
| Method Detail |
public Object evaluate(Reader scriptreader)
throws InterpreterException,
IOException
Interpreter
evaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of script
InterpreterException
IOException
public Object evaluate(Reader scriptreader,
String description)
throws InterpreterException,
IOException
Interpreter
evaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of scriptdescription - description which can be later used (e.g., for error
messages).
InterpreterException
IOException
public Object evaluate(String script)
throws InterpreterException
InterpreterString
instead of a Reader. This usually allows do easily do some
caching.
evaluate in interface Interpreterscript - the piece of script
InterpreterExceptionpublic void dispose()
Interpreter
dispose in interface Interpreter
public void bindObject(String name,
Object object)
InterpreterObject in
the environment of the interpreter.
bindObject in interface Interpretername - the name of the script object to createobject - the Java objectpublic void setOut(Writer out)
InterpreterWriter that will be
used when output function of the scripting langage is used.
setOut in interface Interpreterout - the new out Writer.public Locale getLocale()
Localizable
getLocale in interface Localizablepublic void setLocale(Locale locale)
Localizable
setLocale in interface Localizablelocale - The locale to set.
public String formatMessage(String key,
Object[] args)
Localizable
formatMessage in interface Localizablekey - The key used to retreive the message from the resource
bundle.args - The objects that compose the message.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||