类 JavaCompiledScript
java.lang.Object
javax.script.CompiledScript
com.obermuhlner.scriptengine.java.JavaCompiledScript
The compiled Java script created by a
JavaScriptEngine.-
字段概要
字段修饰符和类型字段说明private BindingStrategyprivate final Class<?>private final Objectprivate final JavaScriptEngineprivate ExecutionStrategy -
构造器概要
构造器构造器说明JavaCompiledScript(JavaScriptEngine engine, Class<?> compiledClass, Object compiledInstance, ExecutionStrategy executionStrategy, BindingStrategy bindingStrategy) Construct aJavaCompiledScript. -
方法概要
修饰符和类型方法说明eval(ScriptContext context) Class<?>Returns the compiledClass.Returns the instance of the compiledClass.已过时。Class<?>已过时。in release 1.1.0 this method was deprecated, usegetCompiledClass()instead.mergeBindings(Bindings... bindingsToMerge) private voidpullVariables(Bindings globalBindings, Bindings engineBindings) private voidpushVariables(Bindings globalBindings, Bindings engineBindings) private voidsetBindingsValue(Bindings globalBindings, Bindings engineBindings, String name, Object value) voidsetExecutionStrategy(ExecutionStrategy executionStrategy) Sets theExecutionStrategyto be used when evaluating the compiled class instance.从类继承的方法 javax.script.CompiledScript
eval, eval
-
字段详细资料
-
engine
-
compiledClass
-
compiledInstance
-
executionStrategy
-
bindingStrategy
-
-
构造器详细资料
-
JavaCompiledScript
JavaCompiledScript(JavaScriptEngine engine, Class<?> compiledClass, Object compiledInstance, ExecutionStrategy executionStrategy, BindingStrategy bindingStrategy) Construct aJavaCompiledScript.- 参数:
engine- theJavaScriptEnginethat compiled this scriptcompiledClass- the compiledClasscompiledInstance- the instance of the compiledClassornullif no instance was created and only static methods will be called by the theExecutionStrategy.executionStrategy- theExecutionStrategy
-
-
方法详细资料
-
getCompiledClass
Returns the compiledClass.- 返回:
- the compiled
Class.
-
getCompiledInstance
Returns the instance of the compiledClass.- 返回:
- the instance of the compiled
Classornullif no instance was created and only static methods will be called by the theExecutionStrategy.
-
getInstanceClass
已过时。in release 1.1.0 this method was deprecated, usegetCompiledClass()instead.Returns the compiledClass.- 返回:
- the compiled
Class.
-
getInstance
已过时。in release 1.1.0 this method was deprecated, usegetCompiledInstance()instead.Returns the instance of the compiledClass.- 返回:
- the instance of the compiled
Classornullif no instance was created and only static methods will be called by the theExecutionStrategy.
-
setExecutionStrategy
Sets theExecutionStrategyto be used when evaluating the compiled class instance.- 参数:
executionStrategy- theExecutionStrategy
-
getEngine
- 指定者:
getEngine在类中CompiledScript
-
eval
- 指定者:
eval在类中CompiledScript- 抛出:
ScriptException
-
pushVariables
- 抛出:
ScriptException
-
pullVariables
- 抛出:
ScriptException
-
setBindingsValue
-
mergeBindings
-
getCompiledInstance()instead.