Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.0
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## groovy.lang
Class GroovyShell

    java.lang.Object
      groovy.lang.GroovyObjectSupport
          groovy.lang.GroovyShell

    class GroovyShell
    extends GroovyObjectSupport

Represents a groovy shell capable of running arbitrary groovy scripts

author:
  James Strachan

author:
  Guillaume Laforge

version:
  $Revision: 18171 $

Field Summary
`static String` | `DEFAULT_CODE_BASE`
`static String[]` | `EMPTY_ARGS`

Constructor Summary
`GroovyShell()`
`GroovyShell(Binding binding)`
`GroovyShell(CompilerConfiguration config)`
`GroovyShell(Binding binding, CompilerConfiguration config)`
`GroovyShell(ClassLoader parent, Binding binding)`
`GroovyShell(ClassLoader parent)`
`GroovyShell(ClassLoader parent, Binding binding, CompilerConfiguration config)`
`GroovyShell(GroovyShell shell)` Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent

Method Summary
`GroovyClassLoader` | `getClassLoader()`
`Binding` | `getContext()`
`Object` | `getProperty(String property)`
`void` | `initializeBinding()`
`static void` | `main(String[] args)`
`void` | `resetLoadedClasses()`
`Object` | `run(File scriptFile, List list)` A helper method which runs the given script file with the given command line arguments
`Object` | `run(String scriptText, String fileName, List list)` A helper method which runs the given cl script with the given command line arguments
`Object` | `run(File scriptFile, String[] args)` Runs the given script file name with the given command line arguments
`void` | `setProperty(String property, Object newValue)`

Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty

Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll

Field Detail

### DEFAULT_CODE_BASE

    static final String DEFAULT_CODE_BASE

### EMPTY_ARGS

    @Deprecated
    static final String[] EMPTY_ARGS

Constructor Detail

### GroovyShell

    public GroovyShell()

### GroovyShell

    public GroovyShell(Binding binding)

### GroovyShell

    public GroovyShell(CompilerConfiguration config)

### GroovyShell

    public GroovyShell(Binding binding, CompilerConfiguration config)

### GroovyShell

    public GroovyShell(ClassLoader parent, Binding binding)

### GroovyShell

    public GroovyShell(ClassLoader parent)

### GroovyShell

    public GroovyShell(ClassLoader parent, Binding binding, CompilerConfiguration config)

### GroovyShell

    public GroovyShell(GroovyShell shell)

  Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent
  param:
    shell is the parent shell used for the variable bindings and the parent class loader

Method Detail

### getClassLoader

    public GroovyClassLoader getClassLoader()

### getContext

    public Binding getContext()

### getProperty

    public Object getProperty(String property)

### initializeBinding

    @Deprecated
    public void initializeBinding()

### main

    public static void main(String[] args)

### resetLoadedClasses

    public void resetLoadedClasses()

### run

    public Object run(File scriptFile, List list)

  A helper method which runs the given script file with the given command line arguments
  param:
    scriptFile the file of the script to run
  param:
    list the command line arguments to pass in

### run

    public Object run(String scriptText, String fileName, List list)

  A helper method which runs the given cl script with the given command line arguments
  param:
    scriptText is the text content of the script
  param:
    fileName is the logical file name of the script (which is used to create the class name of the script)
  param:
    list the command line arguments to pass in

### run

    public Object run(File scriptFile, String[] args)

  Runs the given script file name with the given command line arguments
  param:
    scriptFile the file name of the script to run
  param:
    args the command line arguments to pass in

### setProperty

    public void setProperty(String property, Object newValue)

Copyright © 2003-2009 The Codehaus. All rights reserved.