GroovyEngine (groovy 3.0.9 API)

Package: org.codehaus.groovy.bsf

## [Java] Class GroovyEngine

- org.codehaus.groovy.bsf.GroovyEngine

-     public class GroovyEngine
      extends BSFEngineImpl

  A BSF Engine for the Groovy scripting language.

  It's inspired from the Jython engine

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected GroovyShell` | `shell` |

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)` Allow an anonymous function to be declared and invoked
    `` | `public Object` | `call(Object object, String method, Object[] args)` Call the named method of the given object.
    `` | `public void` | `declareBean(BSFDeclaredBean bean)` Declare a bean
    `` | `public Object` | `eval(String source, int lineNo, int columnNo, Object script)` Evaluate an expression.
    `` | `public void` | `exec(String source, int lineNo, int columnNo, Object script)` Execute a script.
    `` | `protected GroovyShell` | `getEvalShell()` Returns: a newly created GroovyShell using the same variable scope but a new class loader
    `` | `public void` | `initialize(BSFManager mgr, String lang, Vector declaredBeans)` Initialize the engine.
    `` | `public void` | `undeclareBean(BSFDeclaredBean bean)` Undeclare a previously declared bean.

- - ### Field Detail

    - #### protected GroovyShell shell

  - ### Method Detail

    - #### public Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)

      Allow an anonymous function to be declared and invoked

    - #### public Object call(Object object, String method, Object[] args)

      Call the named method of the given object.

    - #### public void declareBean(BSFDeclaredBean bean)

      Declare a bean

    - #### public Object eval(String source, int lineNo, int columnNo, Object script)

      Evaluate an expression.

    - #### public void exec(String source, int lineNo, int columnNo, Object script)

      Execute a script.

    - #### protected GroovyShell getEvalShell()

      Returns:
        a newly created GroovyShell using the same variable scope but a new class loader

    - #### public void initialize(BSFManager mgr, String lang, Vector declaredBeans)

      Initialize the engine.

    - #### public void undeclareBean(BSFDeclaredBean bean)

      Undeclare a previously declared bean.