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 Deprecated Methods Modifier and Type Method Description java.lang.Objecteval(javax.script.ScriptContext context)java.lang.Class<?>getCompiledClass()Returns the compiledClass.java.lang.ObjectgetCompiledInstance()Returns the instance of the compiledClass.javax.script.ScriptEnginegetEngine()java.lang.ObjectgetInstance()Deprecated, for removal: This API element is subject to removal in a future version.in release 1.1.0 this method was deprecated, usegetCompiledInstance()instead.java.lang.Class<?>getInstanceClass()Deprecated, for removal: This API element is subject to removal in a future version.in release 1.1.0 this method was deprecated, usegetCompiledClass()instead.voidsetExecutionStrategy(ExecutionStrategy executionStrategy)Sets theExecutionStrategyto be used when evaluating the compiled class instance.
-
-
-
Method Detail
-
getCompiledClass
public java.lang.Class<?> getCompiledClass()
Returns the compiledClass.- Returns:
- the compiled
Class.
-
getCompiledInstance
public java.lang.Object getCompiledInstance()
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.
-
getInstanceClass
@Deprecated(since="1.1.0", forRemoval=true) public java.lang.Class<?> getInstanceClass()Deprecated, for removal: This API element is subject to removal in a future version.in release 1.1.0 this method was deprecated, usegetCompiledClass()instead.Returns the compiledClass.- Returns:
- the compiled
Class.
-
getInstance
@Deprecated(since="1.1.0", forRemoval=true) public java.lang.Object getInstance()Deprecated, for removal: This API element is subject to removal in a future version.in release 1.1.0 this method was deprecated, usegetCompiledInstance()instead.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
-
-