Package org.codehaus.groovy.jsr223
Class GroovyCompiledScript
java.lang.Object
javax.script.CompiledScript
org.codehaus.groovy.jsr223.GroovyCompiledScript
Used to represent compiled Groovy scripts. Such scripts may be executed repeatedly
by Groovy's
ScriptEngine using the eval method without reparsing overheads.
Adapted from original by Mike Grogan and A. Sundararajan-
Constructor Summary
ConstructorsConstructorDescriptionGroovyCompiledScript(GroovyScriptEngineImpl engine, Class<?> clazz) Creates a compiled-script wrapper for a Groovy class produced by an engine instance. -
Method Summary
Modifier and TypeMethodDescriptioneval(ScriptContext context) Evaluates the compiled script with the supplied script context.Returns the engine that produced this compiled script.Methods inherited from class javax.script.CompiledScript
eval, eval
-
Constructor Details
-
GroovyCompiledScript
Creates a compiled-script wrapper for a Groovy class produced by an engine instance.- Parameters:
engine- the engine that compiled the scriptclazz- the compiled script class
-
-
Method Details
-
eval
Evaluates the compiled script with the supplied script context.- Specified by:
evalin classCompiledScript- Parameters:
context- the execution context to use- Returns:
- the script result, or the compiled class when it does not extend
Script - Throws:
ScriptException- if evaluation fails
-
getEngine
Returns the engine that produced this compiled script.- Specified by:
getEnginein classCompiledScript- Returns:
- the owning Groovy script engine
-