Package org.apache.batik.script
Class InterpreterPool
java.lang.Object
org.apache.batik.script.InterpreterPool
A class allowing to create/query an
Interpreter
corresponding to a particular
Document
and scripting language.
By default, it is able to create interpreters for ECMAScript, Python and Tcl scripting languages if you provide the right jar files in your CLASSPATH (i.e. Rhino, JPython and Jacl jar files).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInterpreter
(Document document, String language) Creates a new interpreter for the specified document and according to the specified language.createInterpreter
(Document document, String language, ImportInfo imports) Creates a new interpreter for the specified document and according to the specified language.void
putInterpreterFactory
(String language, InterpreterFactory factory) Adds for the specified language, the specified Interpreter factory.void
removeInterpreterFactory
(String language) Removes the InterpreterFactory associated to the specified language.
-
Field Details
-
BIND_NAME_DOCUMENT
Name of the "document" object when referenced by scripts- See Also:
-
defaultFactories
The default InterpreterFactory map. -
factories
The InterpreterFactory map.
-
-
Constructor Details
-
InterpreterPool
public InterpreterPool()Constructs a newInterpreterPool
.
-
-
Method Details
-
createInterpreter
Creates a new interpreter for the specified document and according to the specified language. This method can return null if no interpreter has been found for the specified language.- Parameters:
document
- the document that needs the interpreterlanguage
- the scripting language
-
createInterpreter
Creates a new interpreter for the specified document and according to the specified language. This method can return null if no interpreter has been found for the specified language.- Parameters:
document
- the document that needs the interpreterlanguage
- the scripting languageimports
- The set of classes/packages to import (if the interpreter supports that).
-
putInterpreterFactory
Adds for the specified language, the specified Interpreter factory.- Parameters:
language
- the language for which the factory is registeredfactory
- theInterpreterFactory
to register
-
removeInterpreterFactory
Removes the InterpreterFactory associated to the specified language.- Parameters:
language
- the language for which the factory should be removed.
-