| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final ScriptEngineFactory | |
| private final PythonInterpreter |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this resource, relinquishing any underlying resources. |
| public CompiledScript | compile(String
The source of the script, represented as a script)String.Implements javax. Compiles the script (source represented as a |
| public CompiledScript | compile(Reader
The reader from which the script source is obtained. reader)Implements javax. Compiles the script (source read from |
| private PyCode | |
| private PyCode | |
| public Bindings | createBindings()
Implements javax. Returns an uninitialized |
| public Object | eval(String
The script to be executed by the script engine. script, ScriptContext A context)ScriptContext exposing sets of attributes in
different scopes. The meanings of the scopes ScriptContext.GLOBAL_SCOPE,
and ScriptContext.ENGINE_SCOPE are defined in the specification.
The ENGINE_SCOPE Bindings of the ScriptContext contains the
bindings of scripting variables to application objects to be used during this
script execution.Implements javax. Causes the immediate execution of the script whose source is the String passed as the first argument. |
| private Object | |
| public Object | eval(Reader
The source of the script to be executed by the script engine. reader, ScriptContext The context)ScriptContext passed to the script engine.Implements javax. Same as |
| public ScriptEngineFactory | getFactory()
Implements javax. Returns a |
| public <T> T | getInterface(Class<T>
The clazz)Class object of the interface to return.Implements javax. Returns an implementation of an interface using functions compiled in the interpreter. |
| public <T> T | getInterface(Object
The scripting object whose member functions are used to implement the methods of the interface. obj, Class<T> The clazz)Class object of the interface to return.Implements javax. Returns an implementation of an interface using member functions of a scripting object compiled in the interpreter. |
| public Object | invokeFunction(String
of the procedure or function to call name, Object... Arguments to pass to the procedure or function args)Implements javax. Used to call top-level procedures and functions defined in scripts. |
| public Object | invokeMethod(Object
If the procedure is a member of a class
defined in the script and thiz is an instance of that class
returned by a previous execution or invocation, the named method is
called through that instance. thiz, String The name of the procedure to be called. name, Object... Arguments to pass to the procedure. The rules for converting
the arguments to scripting variables are implementation-specific. args)Implements javax. Calls a method on a script object compiled during a previous script execution,
which is retained in the state of the |
| private static ScriptException |
| factory | back to summary |
|---|---|
| private final ScriptEngineFactory factory | |
| interp | back to summary |
|---|---|
| private final PythonInterpreter interp | |
| PyScriptEngine | back to summary |
|---|---|
| pack-priv PyScriptEngine(ScriptEngineFactory factory) | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| compile | back to summary |
|---|---|
| public CompiledScript compile(String script) throws ScriptException Implements javax. Doc from javax. Compiles the script (source represented as a
| |
| compile | back to summary |
|---|---|
| public CompiledScript compile(Reader reader) throws ScriptException Implements javax. Doc from javax. Compiles the script (source read from
| |
| compileScript | back to summary |
|---|---|
| private PyCode compileScript(String script, ScriptContext context) throws ScriptException | |
| compileScript | back to summary |
|---|---|
| private PyCode compileScript(Reader reader, ScriptContext context) throws ScriptException | |
| createBindings | back to summary |
|---|---|
| public Bindings createBindings() Implements javax. Doc from javax. Returns an uninitialized
| |
| eval | back to summary |
|---|---|
| public Object eval(String script, ScriptContext context) throws ScriptException Implements javax. Doc from javax. Causes the immediate execution of the script whose source is the String passed as the first argument. The script may be reparsed or recompiled before execution. State left in the engine from previous executions, including variable values and compiled procedures may be visible during this execution.
The value returned from the execution of the script.
| |
| eval | back to summary |
|---|---|
| private Object eval(PyCode code, ScriptContext context) throws ScriptException | |
| eval | back to summary |
|---|---|
| public Object eval(Reader reader, ScriptContext context) throws ScriptException Implements javax. Doc from javax. Same as
The value returned from the execution of the script.
| |
| getFactory | back to summary |
|---|---|
| public ScriptEngineFactory getFactory() Implements javax. Doc from javax. Returns a
| |
| getInterface | back to summary |
|---|---|
| public <T> T getInterface(Class<T> clazz) Implements javax. Doc from javax. Returns an implementation of an interface using functions compiled in
the interpreter. The methods of the interface
may be implemented using the
| |
| getInterface | back to summary |
|---|---|
| public <T> T getInterface(Object obj, Class<T> clazz) Implements javax. Doc from javax. Returns an implementation of an interface using member functions of
a scripting object compiled in the interpreter. The methods of the
interface may be implemented using the
An instance of requested interface - null if the requested interface is unavailable,
i. e. if compiled methods in the | |
| invokeFunction | back to summary |
|---|---|
| public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException Implements javax. Doc from javax. Used to call top-level procedures and functions defined in scripts.
The value returned by the procedure or function
| |
| invokeMethod | back to summary |
|---|---|
| public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException Implements javax. Doc from javax. Calls a method on a script object compiled during a previous script execution,
which is retained in the state of the
The value returned by the procedure. The rules for converting the scripting variable returned by the script method to a Java Object are implementation-specific.
| |
| scriptException | back to summary |
|---|---|
| private static ScriptException scriptException(PyException pye) | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object | eval(ScriptContext
A ctx)ScriptContext that is used in the same way as
the ScriptContext passed to the eval methods of
ScriptEngine.Implements abstract javax. Executes the program stored in this |
| public ScriptEngine | getEngine()
Implements abstract javax. Returns the |
| code | back to summary |
|---|---|
| private PyCode code | |
| PyCompiledScript | back to summary |
|---|---|
| pack-priv PyCompiledScript(PyCode code) | |
| eval | back to summary |
|---|---|
| public Object eval(ScriptContext ctx) throws ScriptException Implements abstract javax. Doc from javax. Executes the program stored in this
| |
| getEngine | back to summary |
|---|---|
| public ScriptEngine getEngine() Implements abstract javax. Doc from javax. Returns the
| |