Package ch.obermuhlner.scriptengine.java
Class JavaCompiledScript
- java.lang.Object
-
- javax.script.CompiledScript
-
- ch.obermuhlner.scriptengine.java.JavaCompiledScript
-
public class JavaCompiledScript extends javax.script.CompiledScriptThe compiled Java script created by aJavaScriptEngine.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objecteval(javax.script.ScriptContext context)javax.script.ScriptEnginegetEngine()java.lang.ObjectgetInstance()Returns the instance of the compiledClass.java.lang.Class<?>getInstanceClass()Returns the compiledClass.voidsetExecutionStrategy(ExecutionStrategy executionStrategy)Sets theExecutionStrategyto 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
Classornullif no instance was created and only static methods will be called by the theExecutionStrategy.
-
setExecutionStrategy
public void setExecutionStrategy(ExecutionStrategy executionStrategy)
Sets theExecutionStrategyto be used when evaluating the compiled class instance.- Parameters:
executionStrategy- theExecutionStrategy
-
getEngine
public javax.script.ScriptEngine getEngine()
- Specified by:
getEnginein classjavax.script.CompiledScript
-
eval
public java.lang.Object eval(javax.script.ScriptContext context) throws javax.script.ScriptException- Specified by:
evalin classjavax.script.CompiledScript- Throws:
javax.script.ScriptException
-
-