| Modifier and Type | Field and Description |
|---|---|
| private final CompilerConfiguration | |
| private final Binding | |
| private final AtomicInteger | |
| public static final String | |
| private static final String[] | |
| private final GroovyClassLoader |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | GroovyShell(GroovyShell
is the parent shell used for the variable bindings and the parent class loader shell)Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent |
| Modifier and Type | Method and Description |
|---|---|
| public Object | evaluate(GroovyCodeSource codeSource)
Evaluates some script against the current Binding and returns the result |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| protected String | |
| public GroovyClassLoader | |
| public Binding | |
| public Object | getProperty(String
the name of the property of interest property)Overrides default groovy. |
| public Object | |
| public static void | |
| public Script | Returns: the parsed script which is ready to be run viaScript#run()the stream reading the script reader, final String is the logical file name of the script (which is used to create the class name of the script) fileName)Parses the given script and returns it ready to be run |
| public Script | Returns: ready to run scriptParses the given script and returns it ready to be run. |
| public Script | |
| public Script | |
| public Script | |
| public Script | |
| public Script | |
| private Class | parseClass(final GroovyCodeSource codeSource)
Parses the groovy code contained in codeSource and returns a java class. |
| public void | |
| public void | |
| public Object | |
| public Object | run(String
is the text content of the script scriptText, String is the logical file name of the script (which is used to create the class name of the script) fileName, List<String> the command line arguments to pass in list)A helper method which runs the given cl script with the given command line arguments |
| public Object | |
| public Object | |
| public Object | run(GroovyCodeSource
is the source content of the script source, List<String> the command line arguments to pass in args)Runs the given script source with command line arguments |
| public Object | run(GroovyCodeSource
is the source content of the script source, String[] the command line arguments to pass in args)Runs the given script source with command line arguments |
| public Object | |
| public Object | |
| public Object | |
| public Object | |
| private static Object | |
| private Object | runScriptOrMainOrTestOrRunnable(Class<T> scriptClass, String[] args)
if (theClass is a Script) { run it like a script } else if (theClass has a main method) { run the main method } else if (theClass instanceof GroovyTestCase) { use the test runner to run it } else if (theClass implements Runnable) { if (theClass has a constructor with String[] params) instantiate theClass with this constructor and run else if (theClass has a no-args constructor) instantiate theClass with the no-args constructor and run } |
| public void | setProperty(String
the name of the property of interest property, Object the new value for the property newValue)Overrides default groovy. |
| public void |
| config | back to summary |
|---|---|
| private final CompilerConfiguration config | |
| context | back to summary |
|---|---|
| private final Binding context | |
| counter | back to summary |
|---|---|
| private final AtomicInteger counter | |
| DEFAULT_CODE_BASE | back to summary |
|---|---|
| public static final String DEFAULT_CODE_BASE | |
| EMPTY_STRING_ARRAY | back to summary |
|---|---|
| private static final String[] EMPTY_STRING_ARRAY | |
| loader | back to summary |
|---|---|
| private final GroovyClassLoader loader | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell() | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(Binding binding) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(ClassLoader parent, CompilerConfiguration config) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(CompilerConfiguration config) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(Binding binding, CompilerConfiguration config) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(ClassLoader parent, Binding binding) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(ClassLoader parent) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(ClassLoader parent, Binding binding, final CompilerConfiguration config) | |
| GroovyShell | back to summary |
|---|---|
| public GroovyShell(GroovyShell shell) Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(GroovyCodeSource codeSource) throws CompilationFailedException Evaluates some script against the current Binding and returns the result | |
| evaluate | back to summary |
|---|---|
| public Object evaluate(final String scriptText) throws CompilationFailedException Evaluates some script against the current Binding and returns the result
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(String scriptText, String fileName) throws CompilationFailedException Evaluates some script against the current Binding and returns the result | |
| evaluate | back to summary |
|---|---|
| public Object evaluate(final String scriptText, final String fileName, final 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 | |
| evaluate | back to summary |
|---|---|
| public Object evaluate(File file) throws CompilationFailedException, IOException Evaluates some script against the current Binding and returns the result
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(URI uri) throws CompilationFailedException, IOException Evaluates some script against the current Binding and returns the result
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(Reader in) throws CompilationFailedException Evaluates some script against the current Binding and returns the result
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(Reader in, String fileName) throws CompilationFailedException Evaluates some script against the current Binding and returns the result | |
| generateScriptName | back to summary |
|---|---|
| protected String generateScriptName() | |
| getClassLoader | back to summary |
|---|---|
| public GroovyClassLoader getClassLoader() | |
| getContext | back to summary |
|---|---|
| public Binding getContext() | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String property) Overrides default groovy. Doc from groovy. Retrieves a property value. | |
| getVariable | back to summary |
|---|---|
| public Object getVariable(String name) | |
| main | back to summary |
|---|---|
| public static void main(String[] args) | |
| parse | back to summary |
|---|---|
| public Script parse(final Reader reader, final String fileName) throws CompilationFailedException Parses the given script and returns it ready to be run
| |
| parse | back to summary |
|---|---|
| public Script parse(final 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.
| |
| parse | back to summary |
|---|---|
| public Script parse(File file) throws CompilationFailedException, IOException Parses the given script and returns it ready to be run
| |
| parse | back to summary |
|---|---|
| public Script parse(URI uri) throws CompilationFailedException, IOException Parses the given script and returns it ready to be run
| |
| parse | back to summary |
|---|---|
| public Script parse(String scriptText) throws CompilationFailedException Parses the given script and returns it ready to be run
| |
| parse | back to summary |
|---|---|
| public Script parse(final String scriptText, final String fileName) throws CompilationFailedException | |
| parse | back to summary |
|---|---|
| public Script parse(Reader in) throws CompilationFailedException Parses the given script and returns it ready to be run
| |
| parseClass | back to summary |
|---|---|
| private Class Parses the groovy code contained in codeSource and returns a java class. | |
| removeVariable | back to summary |
|---|---|
| public void removeVariable(String name) | |
| resetLoadedClasses | back to summary |
|---|---|
| public void resetLoadedClasses() | |
| run | back to summary |
|---|---|
| public Object run(File scriptFile, List<String> list) throws CompilationFailedException, IOException A helper method which runs the given script file with the given command line arguments | |
| run | back to summary |
|---|---|
| public Object run(String scriptText, String fileName, List<String> list) throws CompilationFailedException A helper method which runs the given cl script with the given command line arguments | |
| run | back to summary |
|---|---|
| public Object run(final File scriptFile, String[] args) throws CompilationFailedException, IOException Runs the given script file name with the given command line arguments | |
| run | back to summary |
|---|---|
| public Object run(final String scriptText, final String fileName, String[] args) throws CompilationFailedException Runs the given script text with command line arguments | |
| run | back to summary |
|---|---|
| public Object run(GroovyCodeSource source, List<String> args) throws CompilationFailedException Runs the given script source with command line arguments
| |
| run | back to summary |
|---|---|
| public Object run(GroovyCodeSource source, String[] args) throws CompilationFailedException Runs the given script source with command line arguments
| |
| run | back to summary |
|---|---|
| public Object run(URI source, List<String> args) throws CompilationFailedException, IOException Runs the given script source with command line arguments | |
| run | back to summary |
|---|---|
| public Object run(URI source, String[] args) throws CompilationFailedException, IOException Runs the given script source with command line arguments | |
| run | back to summary |
|---|---|
| public Object run(final Reader in, final String fileName, List<String> list) throws CompilationFailedException Runs the given script with command line arguments | |
| run | back to summary |
|---|---|
| public Object run(final Reader in, final String fileName, String[] args) throws CompilationFailedException Runs the given script with command line arguments | |
| runRunnable | back to summary |
|---|---|
| private static Object runRunnable(Class<T> scriptClass, String[] args) | |
| runScriptOrMainOrTestOrRunnable | back to summary |
|---|---|
| private Object runScriptOrMainOrTestOrRunnable(Class<T> scriptClass, String[] args) if (theClass is a Script) { run it like a script } else if (theClass has a main method) { run the main method } else if (theClass instanceof GroovyTestCase) { use the test runner to run it } else if (theClass implements Runnable) { if (theClass has a constructor with String[] params) instantiate theClass with this constructor and run else if (theClass has a no-args constructor) instantiate theClass with the no-args constructor and run } | |
| setProperty | back to summary |
|---|---|
| public void setProperty(String property, Object newValue) Overrides default groovy. Doc from groovy. Sets the given property to the new value. | |
| setVariable | back to summary |
|---|---|
| public void setVariable(String name, Object value) | |