Package: org.codehaus.groovy.jsr223

## [Java] Class GroovyCompiledScript

- org.codehaus.groovy.jsr223.GroovyCompiledScript

-     public class GroovyCompiledScript
      extends CompiledScript

  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

    Constructors
    Constructor and description
    `GroovyCompiledScript(GroovyScriptEngineImpl engine, Class<?> clazz)` Creates a compiled-script wrapper for a Groovy class produced by an engine instance.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `eval(ScriptContext context)` Evaluates the compiled script with the supplied script context.
    `` | `public ScriptEngine` | `getEngine()` Returns the engine that produced this compiled script.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CompiledScript` | `equals, eval, eval, eval, getClass, getEngine, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public GroovyCompiledScript(GroovyScriptEngineImpl engine, Class<?> clazz)

      Creates a compiled-script wrapper for a Groovy class produced by an engine instance.

      Parameters:
        `engine` - the engine that compiled the script
        `clazz` - the compiled script class

  - ### Method Detail

    - #### public Object eval(ScriptContext context)

      Evaluates the compiled script with the supplied script context.

      throws:
        ScriptException if evaluation fails
      Parameters:
        `context` - the execution context to use
      Returns:
        the script result, or the compiled class when it does not extend `Script`

    - #### public ScriptEngine getEngine()

      Returns the engine that produced this compiled script.

      Returns:
        the owning Groovy script engine