Save This Page
Home » groovy-src-1.6.3 » groovy » lang » [javadoc | source]
groovy.lang
public class: GroovyShell [javadoc | source]
java.lang.Object
   groovy.lang.GroovyObjectSupport
      groovy.lang.GroovyShell

All Implemented Interfaces:
    GroovyObject

Represents a groovy shell capable of running arbitrary groovy scripts
Field Summary
public static final  String[] EMPTY_ARGS     
Constructor:
 public GroovyShell() 
 public GroovyShell(Binding binding) 
 public GroovyShell(CompilerConfiguration config) 
 public GroovyShell(ClassLoader parent) 
 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
 public GroovyShell(Binding binding,
    CompilerConfiguration config) 
 public GroovyShell(ClassLoader parent,
    Binding binding) 
 public GroovyShell(ClassLoader parent,
    Binding binding,
    CompilerConfiguration config) 
Method from groovy.lang.GroovyShell Summary:
evaluate,   evaluate,   evaluate,   evaluate,   evaluate,   evaluate,   evaluate,   generateScriptName,   getClassLoader,   getContext,   getProperty,   getVariable,   initializeBinding,   main,   parse,   parse,   parse,   parse,   parse,   parse,   resetLoadedClasses,   run,   run,   run,   run,   run,   setProperty,   setVariable
Methods from groovy.lang.GroovyObjectSupport:
getMetaClass,   getProperty,   invokeMethod,   setMetaClass,   setProperty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from groovy.lang.GroovyShell Detail:
 public Object evaluate(GroovyCodeSource codeSource) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(File file) throws CompilationFailedException, IOException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(String scriptText) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(InputStream in) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(String scriptText,
    String fileName) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(InputStream in,
    String fileName) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result
 public Object evaluate(String scriptText,
    String fileName,
    String codeBase) throws CompilationFailedException 
    Evaluates some script against the current Binding and returns the result. The .class file created from the script is given the supplied codeBase
 protected synchronized String generateScriptName() 
 public GroovyClassLoader getClassLoader() 
 public Binding getContext() 
 public Object getProperty(String property) 
 public Object getVariable(String name) 
 public  void initializeBinding() 
 public static  void main(String[] args) 
 public Script parse(GroovyCodeSource codeSource) throws CompilationFailedException 
    Parses the given script and returns it ready to be run. When running in a secure environment (-Djava.security.manager) codeSource.getCodeSource() determines what policy grants should be given to the script.
 public Script parse(File file) throws CompilationFailedException, IOException 
    Parses the given script and returns it ready to be run
 public Script parse(String scriptText) throws CompilationFailedException 
    Parses the given script and returns it ready to be run
 public Script parse(InputStream in) throws CompilationFailedException 
    Parses the given script and returns it ready to be run
 public Script parse(InputStream in,
    String fileName) throws CompilationFailedException 
    Parses the given script and returns it ready to be run
 public Script parse(String scriptText,
    String fileName) throws CompilationFailedException 
 public  void resetLoadedClasses() 
 public Object run(File scriptFile,
    List list) throws CompilationFailedException, IOException 
    A helper method which runs the given script file with the given command line arguments
 public Object run(File scriptFile,
    String[] args) throws CompilationFailedException, IOException 
    Runs the given script file name with the given command line arguments
 public Object run(String scriptText,
    String fileName,
    List list) throws CompilationFailedException 
    A helper method which runs the given cl script with the given command line arguments
 public Object run(String scriptText,
    String fileName,
    String[] args) throws CompilationFailedException 
    Runs the given script text with command line arguments
 public Object run(InputStream in,
    String fileName,
    String[] args) throws CompilationFailedException 
    Runs the given script with command line arguments
 public  void setProperty(String property,
    Object newValue) 
 public  void setVariable(String name,
    Object value)