public class JPythonInterpreter extends Object implements Interpreter
Interpreter interface to use
JPython python parser.| Constructor and Description |
|---|
JPythonInterpreter() |
| Modifier and Type | Method and Description |
|---|---|
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) |
Locale |
getLocale() |
String[] |
getMimeTypes()
Returns the content types of the scripting languages this interpreter
handles.
|
void |
setLocale(Locale locale) |
void |
setOut(Writer out)
This method should change the output
Writer that will be
used when output function of the scripting langage is used. |
public String[] getMimeTypes()
getMimeTypes in interface Interpreterpublic Object evaluate(Reader scriptreader) throws IOException
Interpreterevaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of scriptIOExceptionpublic Object evaluate(Reader scriptreader, String description) throws IOException
Interpreterevaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of scriptdescription - description which can be later used (e.g., for error
messages).IOExceptionpublic Object evaluate(String script)
InterpreterString
instead of a Reader. This usually allows do easily do some
caching.evaluate in interface Interpreterscript - the piece of scriptpublic void dispose()
Interpreterdispose in interface Interpreterpublic 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()
getLocale in interface org.apache.batik.i18n.Localizablepublic void setLocale(Locale locale)
setLocale in interface org.apache.batik.i18n.Localizablepublic String formatMessage(String key, Object[] args)
formatMessage in interface org.apache.batik.i18n.LocalizableCopyright © 2000–2019 Apache Software Foundation. All rights reserved.