public class GroovyShell extends GroovyObjectSupport
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 Params | Return Type | Name and description |
---|---|---|
|
public GroovyClassLoader |
getClassLoader() |
|
public Binding |
getContext() |
|
public Object |
getProperty(String property) |
|
public static void |
main(String[] args) |
|
public void |
resetLoadedClasses() |
|
public Object |
run(File scriptFile, List<String> list) A helper method which runs the given script file with the given command line arguments |
|
public Object |
run(String scriptText, String fileName, List<String> list) A helper method which runs the given cl script with the given command line arguments |
|
public Object |
run(File scriptFile, String[] args) Runs the given script file name with the given command line arguments |
|
public void |
setProperty(String property, Object newValue) |
Methods inherited from class | Name |
---|---|
class GroovyObjectSupport |
getMetaClass, setMetaClass |
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 loaderA 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 inCopyright © 2003-2022 The Apache Software Foundation. All rights reserved.