|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.script.rhino.RhinoInterpreter
A simple implementation of Interpreter
interface to use
Rhino ECMAScript interpreter.
Constructor Summary | |
RhinoInterpreter()
Build a Interpreter for ECMAScript using Rhino. |
Method Summary | |
void |
bindObject(java.lang.String name,
java.lang.Object object)
This method registers a particular Java Object in
the environment of the interpreter. |
void |
dispose()
For RhinoInterpreter this method does nothing. |
java.lang.Object |
evaluate(java.io.Reader scriptreader)
This method evaluates a piece of ECMAScript. |
java.lang.Object |
evaluate(java.lang.String scriptstr)
This method evaluates a piece of ECMA script. |
java.lang.String |
formatMessage(java.lang.String key,
java.lang.Object[] args)
Creates and returns a localized message, given the key of the message in the resource bundle and the message parameters. |
protected org.mozilla.javascript.Context |
getContext()
This method returns the default context in which the interpreter runs. |
protected org.mozilla.javascript.ScriptableObject |
getGlobalObject()
This method returns the ECMAScript global object used by this interpreter. |
java.util.Locale |
getLocale()
Provides a way to the user to specify a locale which override the default one. |
void |
setLocale(java.util.Locale locale)
Returns the current locale or null if the locale currently used is the default one. |
void |
setOut(java.io.Writer out)
By default Rhino has no output method in its language. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RhinoInterpreter()
Interpreter
for ECMAScript using Rhino.Interpreter
,
InterpreterPool
Method Detail |
protected org.mozilla.javascript.ScriptableObject getGlobalObject()
protected org.mozilla.javascript.Context getContext()
public java.lang.Object evaluate(java.io.Reader scriptreader) throws InterpreterException, java.io.IOException
evaluate
in interface Interpreter
scriptreader
- a java.io.Reader
on the piece of scriptpublic java.lang.Object evaluate(java.lang.String scriptstr) throws InterpreterException
evaluate
in interface Interpreter
scriptstr
- the piece of scriptpublic void dispose()
RhinoInterpreter
this method does nothing.dispose
in interface Interpreter
public void bindObject(java.lang.String name, java.lang.Object object)
Object
in
the environment of the interpreter.bindObject
in interface Interpreter
name
- the name of the script object to createobject
- the Java objectpublic void setOut(java.io.Writer out)
setOut
in interface Interpreter
output
- the new out Writer
.public java.util.Locale getLocale()
getLocale
in interface Localizable
l
- The locale to set.public void setLocale(java.util.Locale locale)
setLocale
in interface Localizable
org.apache.batik.i18n.Localizable
l
- The locale to set.public java.lang.String formatMessage(java.lang.String key, java.lang.Object[] args)
formatMessage
in interface Localizable
key
- The key used to retreive the message from the resource
bundle.args
- The objects that compose the message.MissingResourceException
- if the key is not in the bundle.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |