| java.lang.Object groovy.lang.GroovyObjectSupport groovy.lang.GroovyShell
GroovyShell | public class GroovyShell extends GroovyObjectSupport (Code) | | Represents a groovy shell capable of running arbitrary groovy scripts
author: James Strachan author: Guillaume Laforge version: $Revision: 4346 $ |
Method Summary | |
public Object | evaluate(GroovyCodeSource codeSource) | public Object | evaluate(String scriptText, String fileName) | public Object | evaluate(String scriptText, String fileName, String codeBase) Evaluates some script against the current Binding and returns the result. | public Object | evaluate(File file) | public Object | evaluate(String scriptText) | public Object | evaluate(InputStream in) | public Object | evaluate(InputStream in, String fileName) | protected synchronized String | generateScriptName() | 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(InputStream in, String fileName) | public Script | parse(GroovyCodeSource codeSource) Parses the given script and returns it ready to be run. | public Script | parse(File file) | public Script | parse(String scriptText) | public Script | parse(String scriptText, String fileName) | public Script | parse(InputStream in) | public void | resetLoadedClasses() | public Object | run(File scriptFile, List list) | public Object | run(String scriptText, String fileName, List list) | public Object | run(File scriptFile, String[] args) | public Object | run(String scriptText, String fileName, String[] args) | public Object | run(InputStream in, String fileName, String[] args) | public void | setProperty(String property, Object newValue) | public void | setVariable(String name, Object value) |
GroovyShell | public GroovyShell()(Code) | | |
GroovyShell | public GroovyShell(GroovyShell shell)(Code) | | 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 |
evaluate | public Object evaluate(String scriptText, String fileName) throws CompilationFailedException(Code) | | Evaluates some script against the current Binding and returns the result
Parameters: scriptText - the text of the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) |
evaluate | public Object evaluate(File file) throws CompilationFailedException, IOException(Code) | | Evaluates some script against the current Binding and returns the result
Parameters: file - is the file of the script (which is used to create the class name of the script) |
evaluate | public Object evaluate(InputStream in, String fileName) throws CompilationFailedException(Code) | | Evaluates some script against the current Binding and returns the result
Parameters: in - the stream reading the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) |
generateScriptName | protected synchronized String generateScriptName()(Code) | | |
initializeBinding | public void initializeBinding()(Code) | | |
parse | public Script parse(InputStream in, String fileName) throws CompilationFailedException(Code) | | Parses the given script and returns it ready to be run
Parameters: in - the stream reading the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) the parsed script which is ready to be run via @link Script.run() |
parse | public Script parse(GroovyCodeSource codeSource) throws CompilationFailedException(Code) | | 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.
Parameters: codeSource - ready to run script |
resetLoadedClasses | public void resetLoadedClasses()(Code) | | |
run | public Object run(File scriptFile, List list) throws CompilationFailedException, IOException(Code) | | A helper method which runs the given script file with the given command line arguments
Parameters: scriptFile - the file of the script to run Parameters: list - the command line arguments to pass in |
run | public Object run(String scriptText, String fileName, List list) throws CompilationFailedException(Code) | | A helper method which runs the given cl script with the given command line arguments
Parameters: scriptText - is the text content of the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) Parameters: list - the command line arguments to pass in |
run | public Object run(String scriptText, String fileName, String[] args) throws CompilationFailedException(Code) | | Runs the given script text with command line arguments
Parameters: scriptText - is the text content of the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) Parameters: args - the command line arguments to pass in |
run | public Object run(InputStream in, String fileName, String[] args) throws CompilationFailedException(Code) | | Runs the given script with command line arguments
Parameters: in - the stream reading the script Parameters: fileName - is the logical file name of the script (which is used to create the class name of the script) Parameters: args - the command line arguments to pass in |
|
|