Represents a groovy shell capable of running arbitrary groovy scripts
Modifiers | Name | Description |
---|---|---|
static String |
DEFAULT_CODE_BASE |
Constructor and description |
---|
GroovyShell
() |
GroovyShell
(Binding binding) |
GroovyShell
(ClassLoader parent, CompilerConfiguration config) |
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 |
Type | Name and description |
---|---|
Object |
evaluate(GroovyCodeSource codeSource) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(String scriptText) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(String scriptText, String fileName) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(String scriptText, String fileName, String codeBase) Evaluates some script against the current Binding and returns the result. |
Object |
evaluate(File file) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(URI uri) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(Reader in) Evaluates some script against the current Binding and returns the result |
Object |
evaluate(Reader in, String fileName) Evaluates some script against the current Binding and returns the result |
protected String |
generateScriptName() |
GroovyClassLoader |
getClassLoader() |
Binding |
getContext() |
Object |
getProperty(String property) |
Object |
getVariable(String name) |
static void |
main(String[] args) |
Script |
parse(Reader reader, String fileName) Parses the given script and returns it ready to be run |
Script |
parse(GroovyCodeSource codeSource) Parses the given script and returns it ready to be run. |
Script |
parse(File file) Parses the given script and returns it ready to be run |
Script |
parse(URI uri) Parses the given script and returns it ready to be run |
Script |
parse(String scriptText) Parses the given script and returns it ready to be run |
Script |
parse(String scriptText, String fileName) |
Script |
parse(Reader in) Parses the given script and returns it ready to be run |
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 |
Object |
run(String scriptText, String fileName, String[] args) Runs the given script text with command line arguments |
Object |
run(GroovyCodeSource source, List args) Runs the given script source with command line arguments |
Object |
run(GroovyCodeSource source, String[] args) Runs the given script source with command line arguments |
Object |
run(URI source, List args) Runs the given script source with command line arguments |
Object |
run(URI source, String[] args) Runs the given script source with command line arguments |
Object |
run(Reader in, String fileName, List list) Runs the given script with command line arguments |
Object |
run(Reader in, String fileName, String[] args) Runs the given script with command line arguments |
void |
setProperty(String property, Object newValue) |
void |
setVariable(String name, Object value) |
Methods inherited from class | Name |
---|---|
class GroovyObjectSupport |
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent
shell
- is the parent shell used for the variable bindings and the parent class loaderEvaluates some script against the current Binding and returns the result
Evaluates some script against the current Binding and returns the result
scriptText
- the text of the scriptEvaluates some script against the current Binding and returns the result
scriptText
- the text of the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)Evaluates some script against the current Binding and returns the result. The .class file created from the script is given the supplied codeBase
Evaluates some script against the current Binding and returns the result
file
- is the file of the script (which is used to create the class name of the script)Evaluates some script against the current Binding and returns the result
uri
- is the URI of the script (which is used to create the class name of the script)Evaluates some script against the current Binding and returns the result
in
- the stream reading the scriptEvaluates some script against the current Binding and returns the result
in
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)Parses the given script and returns it ready to be run
reader
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)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.
Parses the given script and returns it ready to be run
file
- is the file of the script (which is used to create the class name of the script)Parses the given script and returns it ready to be run
uri
- is the URI of the script (which is used to create the class name of the script)Parses the given script and returns it ready to be run
scriptText
- the text of the scriptParses the given script and returns it ready to be run
in
- the stream reading the scriptA helper method which runs the given script file with the given command line arguments
scriptFile
- the file of the script to runlist
- the command line arguments to pass inA helper method which runs the given cl script with the given command line arguments
scriptText
- is the text content of the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)list
- the command line arguments to pass inRuns the given script file name with the given command line arguments
scriptFile
- the file name of the script to runargs
- the command line arguments to pass inRuns the given script text with command line arguments
scriptText
- is the text content of the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)args
- the command line arguments to pass inRuns the given script source with command line arguments
source
- is the source content of the scriptargs
- the command line arguments to pass inRuns the given script source with command line arguments
source
- is the source content of the scriptargs
- the command line arguments to pass inRuns the given script source with command line arguments
source
- is the source content of the scriptargs
- the command line arguments to pass inRuns the given script source with command line arguments
source
- is the source content of the scriptargs
- the command line arguments to pass inRuns the given script with command line arguments
in
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)list
- the command line arguments to pass inRuns the given script with command line arguments
in
- the stream reading the scriptfileName
- is the logical file name of the script (which is used to create the class name of the script)args
- the command line arguments to pass inCopyright © 2003-2015 The Apache Software Foundation. All rights reserved.