|
|||||||||||
| 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.
| Inner Class Summary | |
static interface |
RhinoInterpreter.ArgumentsBuilder
To build an argument list. |
class |
RhinoInterpreter.ExtendedContext
|
static class |
RhinoInterpreter.RhinoGetDelegate
Class to act as 'get' delegate for Rhino. |
| Field Summary | |
static java.lang.String |
BIND_NAME_WINDOW
Name of the "window" object when referenced by scripts |
protected RhinoClassLoader |
rhinoClassLoader
The Rhino 'security domain'. |
static java.lang.String |
SOURCE_NAME_SVG
Constant used to describe an SVG source |
protected Window |
window
The window object |
| Constructor Summary | |
RhinoInterpreter(java.net.URL documentURL)
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. |
org.mozilla.javascript.Context |
enterContext()
Implementation helper. |
java.lang.Object |
evaluate(java.io.Reader scriptreader)
This method evaluates a piece of ECMAScript. |
java.lang.Object |
evaluate(java.io.Reader scriptreader,
java.lang.String description)
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, 0, data.length in the resource bundle and the message parameters. |
java.security.AccessControlContext |
getAccessControlContext()
Returns the AccessControlContext associated with this Interpreter. |
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. |
Window |
getWindow()
|
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 |
| Field Detail |
protected Window window
public static final java.lang.String SOURCE_NAME_SVG
public static final java.lang.String BIND_NAME_WINDOW
protected RhinoClassLoader rhinoClassLoader
| Constructor Detail |
public RhinoInterpreter(java.net.URL documentURL)
Interpreter for ECMAScript using Rhino.documentURL - the URL for the document which referencesInterpreter,
InterpreterPool| Method Detail |
public Window getWindow()
public java.security.AccessControlContext getAccessControlContext()
RhinoClassLoaderpublic org.mozilla.javascript.Context enterContext()
protected org.mozilla.javascript.ScriptableObject getGlobalObject()
public java.lang.Object evaluate(java.io.Reader scriptreader)
throws InterpreterException,
java.io.IOException
evaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of script
public java.lang.Object evaluate(java.io.Reader scriptreader,
java.lang.String description)
throws InterpreterException,
java.io.IOException
evaluate in interface Interpreterscriptreader - a java.io.Reader on the piece of scriptdescription - description which can be later used (e.g., for error
messages).
public java.lang.Object evaluate(java.lang.String scriptstr)
throws InterpreterException
evaluate in interface Interpreterscriptstr - 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 Interpretername - the name of the script object to createobject - the Java objectpublic void setOut(java.io.Writer out)
setOut in interface Interpreteroutput - the new out Writer.public java.util.Locale getLocale()
getLocale in interface Localizablel - The locale to set.public void setLocale(java.util.Locale locale)
setLocale in interface Localizableorg.apache.batik.i18n.Localizablel - The locale to set.
public java.lang.String formatMessage(java.lang.String key,
java.lang.Object[] args)
formatMessage in interface Localizablekey - 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 | ||||||||||