Package ch.obermuhlner.scriptengine.java
Class JavaCompiledScript
- java.lang.Object
-
- javax.script.CompiledScript
-
- ch.obermuhlner.scriptengine.java.JavaCompiledScript
-
public class JavaCompiledScript extends javax.script.CompiledScript
The compiled Java script created by aJavaScriptEngine
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
eval(javax.script.ScriptContext context)
javax.script.ScriptEngine
getEngine()
java.lang.Object
getInstance()
Returns the instance of the compiledClass
.java.lang.Class<?>
getInstanceClass()
Returns the compiledClass
.void
setExecutionStrategy(ExecutionStrategy executionStrategy)
Sets theExecutionStrategy
to be used when evaluating the compiled class instance.
-
-
-
Method Detail
-
getInstanceClass
public java.lang.Class<?> getInstanceClass()
Returns the compiledClass
.- Returns:
- the compiled
Class
.
-
getInstance
public java.lang.Object getInstance()
Returns the instance of the compiledClass
.- Returns:
- the instance of the compiled
Class
ornull
if no instance was created and only static methods will be called by the theExecutionStrategy
.
-
setExecutionStrategy
public void setExecutionStrategy(ExecutionStrategy executionStrategy)
Sets theExecutionStrategy
to be used when evaluating the compiled class instance.- Parameters:
executionStrategy
- theExecutionStrategy
-
getEngine
public javax.script.ScriptEngine getEngine()
- Specified by:
getEngine
in classjavax.script.CompiledScript
-
eval
public java.lang.Object eval(javax.script.ScriptContext context) throws javax.script.ScriptException
- Specified by:
eval
in classjavax.script.CompiledScript
- Throws:
javax.script.ScriptException
-
-