| |
|
| java.lang.Object javax.script.CompiledScript
CompiledScript | abstract public class CompiledScript (Code) | | Extended by classes that store results of compilations. State
might be stored in the form of Java classes, Java class files or scripting
language opcodes. The script may be executed repeatedly
without reparsing.
Each CompiledScript is associated with a ScriptEngine -- A call to an eval
method of the CompiledScript causes the execution of the script by the
ScriptEngine . Changes in the state of the ScriptEngine caused by execution
of tne CompiledScript may visible during subsequent executions of scripts by the engine.
author: Mike Grogan version: 1.0 since: 1.6 |
Method Summary | |
abstract public Object | eval(ScriptContext context) Executes the program stored in this CompiledScript object.
Parameters: context - A ScriptContext that is used in the same way asthe ScriptContext passed to the eval methods ofScriptEngine . | public Object | eval(Bindings bindings) Executes the program stored in the CompiledScript object using
the supplied Bindings of attributes as the ENGINE_SCOPE of the
associated ScriptEngine during script execution.
.
The GLOBAL_SCOPE Bindings , Reader and Writer
associated with the defaule ScriptContext of the associated ScriptEngine are used.
Parameters: bindings - The bindings of attributes used for the ENGINE_SCOPE . | public Object | eval() Executes the program stored in the CompiledScript object. | abstract public ScriptEngine | getEngine() Returns the ScriptEngine wbose compile method created this CompiledScript . |
eval | abstract public Object eval(ScriptContext context) throws ScriptException(Code) | | Executes the program stored in this CompiledScript object.
Parameters: context - A ScriptContext that is used in the same way asthe ScriptContext passed to the eval methods ofScriptEngine . The value returned by the script execution, if any. Should return null if no value is returned by the script execution. throws: ScriptException - if an error occurs. |
eval | public Object eval(Bindings bindings) throws ScriptException(Code) | | Executes the program stored in the CompiledScript object using
the supplied Bindings of attributes as the ENGINE_SCOPE of the
associated ScriptEngine during script execution.
.
The GLOBAL_SCOPE Bindings , Reader and Writer
associated with the defaule ScriptContext of the associated ScriptEngine are used.
Parameters: bindings - The bindings of attributes used for the ENGINE_SCOPE . The return value from the script execution throws: ScriptException - if an error occurs. |
eval | public Object eval() throws ScriptException(Code) | | Executes the program stored in the CompiledScript object. The
default ScriptContext of the associated ScriptEngine is used.
The return value from the script execution throws: ScriptException - if an error occurs. |
getEngine | abstract public ScriptEngine getEngine()(Code) | | Returns the ScriptEngine wbose compile method created this CompiledScript .
The CompiledScript will execute in this engine.
The ScriptEngine that created this CompiledScript |
|
|
|