Overview | Package | Class
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.bsf
Class GroovyEngine

A BSF Engine for the Groovy scripting language.

It's derived from the Jython / JPython engine

author:
  James Strachan

Field Summary
`GroovyShell` | `shell`

Constructor Summary
`GroovyEngine()`

Method Summary
`Object` | `apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)` Allow an anonymous function to be declared and invoked
`Object` | `call(Object object, String method, def args)` Call the named method of the given object.
`String` | `convertToValidJavaClassname(String inName)`
`void` | `declareBean(BSFDeclaredBean bean)` Declare a bean
`Object` | `eval(String source, int lineNo, int columnNo, Object script)` Evaluate an expression.
`void` | `exec(String source, int lineNo, int columnNo, Object script)` Execute a script.
`GroovyShell` | `getEvalShell()`
`void` | `initialize(BSFManager mgr, String lang, Vector declaredBeans)` Initialize the engine.
`void` | `undeclareBean(BSFDeclaredBean bean)` Undeclare a previously declared bean.

Constructor Detail

### GroovyEngine

    GroovyEngine()

Method Detail

### apply

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

  Allow an anonymous function to be declared and invoked

### call

    public Object call(Object object, String method, def args)

  Call the named method of the given object.

### convertToValidJavaClassname

    String convertToValidJavaClassname(String inName)

### declareBean

    public void declareBean(BSFDeclaredBean bean)

  Declare a bean

### eval

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

  Evaluate an expression.

### exec

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

  Execute a script.

### getEvalShell

    GroovyShell getEvalShell()

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

### initialize

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

  Initialize the engine.

### undeclareBean

    public void undeclareBean(BSFDeclaredBean bean)

  Undeclare a previously declared bean.