Package groovy.lang

Class GroovyShell

All Implemented Interfaces:
GroovyObject

public class GroovyShell extends GroovyObjectSupport
Represents a groovy shell capable of running arbitrary groovy scripts
  • Field Details

    • DEFAULT_CODE_BASE

      public static final String DEFAULT_CODE_BASE
      Default code base used for scripts evaluated by the shell.
      See Also:
  • Constructor Details

    • GroovyShell

      public GroovyShell()
      Creates a shell with a new Binding and the default compiler configuration.
    • GroovyShell

      public GroovyShell(Binding binding)
      Creates a shell with the supplied binding and the default compiler configuration.
      Parameters:
      binding - the binding used as the shell context
    • GroovyShell

      public GroovyShell(ClassLoader parent, CompilerConfiguration config)
      Creates a shell with the supplied parent class loader and compiler configuration.
      Parameters:
      parent - the parent class loader
      config - the compiler configuration to use
    • GroovyShell

      public GroovyShell(CompilerConfiguration config)
      Creates a shell with a new Binding and the supplied compiler configuration.
      Parameters:
      config - the compiler configuration to use
    • GroovyShell

      public GroovyShell(Binding binding, CompilerConfiguration config)
      Creates a shell with the supplied binding and compiler configuration.
      Parameters:
      binding - the binding used as the shell context
      config - the compiler configuration to use
    • GroovyShell

      public GroovyShell(ClassLoader parent, Binding binding)
      Creates a shell with the supplied parent class loader and binding.
      Parameters:
      parent - the parent class loader
      binding - the binding used as the shell context
    • GroovyShell

      public GroovyShell(ClassLoader parent)
      Creates a shell with the supplied parent class loader, a new binding and the default compiler configuration.
      Parameters:
      parent - the parent class loader
    • GroovyShell

      public GroovyShell(ClassLoader parent, Binding binding, CompilerConfiguration config)
      Creates a shell with explicit class loader, binding and compiler configuration.
      Parameters:
      parent - the parent class loader, or null to use the shell class loader
      binding - the binding used as the shell context
      config - the compiler configuration to use
    • GroovyShell

      public GroovyShell(GroovyShell shell)
      Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent
      Parameters:
      shell - is the parent shell used for the variable bindings and the parent class loader
  • Method Details