Class BaseGrengine
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
Grengine
Grengine.
Implements most convenience methods for using Grengine.
- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Enginethe engine that powers this Grengine.protected Loaderthe default loader instance, which is implicitly used when no specific loader is indicated.protected SourceFactorythe source factory used to create instances ofSource, often implicitly from script text, file or URL. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreturns a new class loader based on the engine and its default attached loader.asClassLoader(Loader loader) returns a new class loader based on the engine and the given loader.binding()creates an empty binding.creates a binding using the given key and value.creates a binding using the given keys and values.creates a binding using the given keys and values.binding(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4) creates a binding using the given keys and values.binding(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, Object... moreKeyValuePairs) creates a binding using the given keys and values.voidclose()release metadata for all classed ever loaded using this engine.creates a script (given loader, given source), compiling and loading first if necessary.creates a script (given loader, file-based source), compiling and loading first if necessary.creates a script (given loader, text-based source), compiling and loading first if necessary.creates a script (given loader, text-based source with desired class name), compiling and loading first if necessary.creates a script (given loader, URL-based source), compiling and loading first if necessary.creates a script (default loader, given source), compiling and loading first if necessary.creates a script (default loader, file-based source), compiling and loading first if necessary.creates an instance ofScriptfrom the given class.creates a script (default loader, text-based source), compiling and loading first if necessary.creates a script (default loader, text-based source with desired class name), compiling and loading first if necessary.creates a script (default loader, URL-based source), compiling and loading first if necessary.gets the engine.gets the default loader instance, which is implicitly used when no specific loader is indicated.gets the source factory used to create instances ofSource, often implicitly from script text or file or URL.Class<?>loads a class (given loader, given source), compiling first if necessary.Class<?>loads a class (given loader, file-based source), compiling first if necessary.Class<?>loads a class (given loader, text-based source), compiling first if necessary.Class<?>loads a class (given loader, text-based source with desired class name), compiling first if necessary.Class<?>loads a class (given loader, URL-based source), compiling first if necessary.Class<?>loads a class (default loader, given source), compiling first if necessary.Class<?>loads a class (default loader, file-based source), compiling first if necessary.Class<?>loads a class (default loader, text-based source), compiling first if necessary.Class<?>loads a class (default loader, text-based source with desired class name), compiling first if necessary.Class<?>loads a class (default loader, URL-based source), compiling first if necessary.abstract Class<?>loads a class with the given name and from the given source from the given loader.abstract Class<?>loads a class by name from the given loader.abstract Class<?>loads a class with the given name and from the given source from the default loader.abstract Class<?>loads a class by name from the default loader.abstract Class<?>loadMainClass(Loader loader, Source source) loads the main class of the given source from the given loader.abstract Class<?>loadMainClass(Source source) loads the main class of the given source from the default loader.creates and gets a new attached loader, backed by the same bytecode as all other shared loaders created by this engine and automatically updated if code layers are set.creates and gets a new detached loader, backed initially by the same bytecode as all attached loaders created by this engine, but not updated if code layers are set.creates and runs a script (given loader, given source, empty binding), compiling and loading first if necessary.creates and runs a script (given loader, given source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, given source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, file-based source, empty binding), compiling and loading first if necessary.creates and runs a script (given loader, file-based source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, file-based source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source, empty binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source with desired class name, empty binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source with desired class name, given binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source with desired class name, given binding), compiling and loading first if necessary.creates and runs a script (given loader, text-based source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, URL-based source, empty binding), compiling and loading first if necessary.creates and runs a script (given loader, URL-based source, given binding), compiling and loading first if necessary.creates and runs a script (given loader, URL-based source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, given source, empty binding), compiling and loading first if necessary.creates and runs a script (default loader, given source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, given source, given binding), compiling and loading first if necessary.runs the given script (empty binding).runs the given script (given binding).runs the given script (given binding).creates and runs a script (default loader, file-based source, empty binding), compiling and loading first if necessary.creates and runs a script (default loader, file-based source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, file-based source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source, empty binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source with desired class name, empty binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source with desired class name, given binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source with desired class name, given binding), compiling and loading first if necessary.creates and runs a script (default loader, text-based source, given binding), compiling and loading first if necessary.creates and runs a script (default loader, URL-based source, empty binding), compiling and loading first if necessary.creates and runs a script (default loader, URL-based source, new binding), compiling and loading first if necessary.creates and runs a script (default loader, URL-based source, given binding), compiling and loading first if necessary.gets source from script file.gets source from script text.gets source from script text and desired class name.gets source from script URL.
-
Field Details
-
engine
the engine that powers this Grengine.- Since:
- 1.0
-
sourceFactory
the source factory used to create instances ofSource, often implicitly from script text, file or URL.- Since:
- 1.0
-
loader
the default loader instance, which is implicitly used when no specific loader is indicated.- Since:
- 1.0
-
-
Constructor Details
-
BaseGrengine
protected BaseGrengine()constructor.- Since:
- 1.0
-
-
Method Details
-
getEngine
gets the engine.- Returns:
- engine
- Since:
- 1.0
-
getLoader
gets the default loader instance, which is implicitly used when no specific loader is indicated.- Returns:
- default loader instance
- Since:
- 1.0
- See Also:
-
newAttachedLoader
creates and gets a new attached loader, backed by the same bytecode as all other shared loaders created by this engine and automatically updated if code layers are set.- Returns:
- new attached loader
- Since:
- 1.0
-
newDetachedLoader
creates and gets a new detached loader, backed initially by the same bytecode as all attached loaders created by this engine, but not updated if code layers are set.For example, a web application might create a detached loader for each new HTTP session: A new loader in order to separate static variables of scripts between sessions (security feature); a detached loader in order to keep code layers constant during the lifetime of the session (consistent behavior of Groovy script calls).
- Returns:
- new detached loader
- Since:
- 1.0
-
loadMainClass
loads the main class of the given source from the given loader.Note that if a class with the main class name is available for loading, but was not compiled as part of a set of
Sourcethat included the given source, that class will not count for loading.- Parameters:
loader- loadersource- source- Returns:
- main class
- Throws:
CompileException- if compilation was necessary to load the class and failedLoadException- if loading failed, including if the class was not found- Since:
- 1.0
- See Also:
-
loadMainClass
loads the main class of the given source from the default loader.Note that if a class with the main class name is available for loading, but was not compiled as part of a set of
Sourcethat included the given source, that class will not count for loading.- Parameters:
source- source- Returns:
- main class
- Throws:
CompileException- if compilation was necessary to load the class and failedLoadException- if loading failed, including if the class was not found- Since:
- 1.1.1
- See Also:
-
loadClass
loads a class with the given name and from the given source from the given loader.Note that if a class with the given class name is available for loading, but was not compiled as part of a set of
Sourcethat included the given source, that class will not count for loading.- Parameters:
loader- loadersource- sourcename- class name- Returns:
- class
- Throws:
CompileException- if compilation was necessary to load the class and failedLoadException- if loading failed, including if the class was not found- Since:
- 1.0
- See Also:
-
loadClass
loads a class with the given name and from the given source from the default loader.Note that if a class with the given class name is available for loading, but was not compiled as part of a set of
Sourcethat included the given source, that class will not count for loading.- Parameters:
source- sourcename- class name- Returns:
- class
- Throws:
CompileException- if compilation was necessary to load the class and failedLoadException- if loading failed, including if the class was not found- Since:
- 1.1.1
- See Also:
-
loadClass
loads a class by name from the given loader.Note that a top code cache is not searched in this case, because each set of source has its own top loader.
- Parameters:
loader- loadername- class name- Returns:
- class
- Throws:
LoadException- if loading failed, including if the class was not found- Since:
- 1.0
- See Also:
-
loadClass
loads a class by name from the default loader.Note that a top code cache is not searched in this case, because each set of source has its own top loader.
- Parameters:
name- class name- Returns:
- class
- Throws:
LoadException- if loading failed, including if the class was not found- Since:
- 1.1.1
- See Also:
-
close
public void close()release metadata for all classed ever loaded using this engine.Allows to remove metadata associated by Groovy (or Java) with a class, which is often necessary to get on-the-fly garbage collection.
Generally call only when really done using this engine and all loaded classes; subsequently trying to use this engine or its classes results generally in undefined behavior.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Since:
- 1.1
-
asClassLoader
returns a new class loader based on the engine and the given loader.Note that the returned class loader typically does not load classes itself; it just wraps the engine and its loader.
- Parameters:
loader- loader- Returns:
- class loader
- Throws:
NullPointerException- if the loader is nullIllegalArgumentException- if the loader does not match the engine- Since:
- 1.3
-
asClassLoader
returns a new class loader based on the engine and its default attached loader.Note that the returned class loader typically does not load classes itself; it just wraps the engine and its loader.
- Returns:
- class loader
- Since:
- 1.3
-
getSourceFactory
gets the source factory used to create instances ofSource, often implicitly from script text or file or URL.- Returns:
- source factory
- Since:
- 1.0
-
source
gets source from script text.- Parameters:
text- script text- Returns:
- source
- See Also:
-
source
gets source from script text and desired class name.- Parameters:
text- script textdesiredClassName- desired class name- Returns:
- source
- Since:
- 1.0
- See Also:
-
source
gets source from script file.- Parameters:
file- script file- Returns:
- source
- See Also:
-
source
gets source from script URL.- Parameters:
url- script URL- Returns:
- source
- Since:
- 1.0
- See Also:
-
load
loads a class (default loader, text-based source), compiling first if necessary.- Parameters:
text- script text- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (given loader, text-based source), compiling first if necessary.- Parameters:
loader- loadertext- script text- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (default loader, text-based source with desired class name), compiling first if necessary.- Parameters:
text- script textdesiredClassName- desired class name- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (given loader, text-based source with desired class name), compiling first if necessary.- Parameters:
loader- loadertext- script textdesiredClassName- desired class name- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (default loader, file-based source), compiling first if necessary.- Parameters:
file- script file- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (given loader, file-based source), compiling first if necessary.- Parameters:
loader- loaderfile- script file- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (default loader, URL-based source), compiling first if necessary.- Parameters:
url- script URL- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (given loader, URL-based source), compiling first if necessary.- Parameters:
loader- loaderurl- script URL- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (default loader, given source), compiling first if necessary.- Parameters:
source- source- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
load
loads a class (given loader, given source), compiling first if necessary.- Parameters:
loader- loadersource- source- Returns:
- loaded class
- Throws:
CompileException- if compiling failedLoadException- if loading failed- Since:
- 1.0
-
create
creates an instance ofScriptfrom the given class.- Parameters:
clazz- class- Returns:
- new instance
- Throws:
CreateException- if could not create the instance or the given class is not a script- Since:
- 1.0
-
create
creates a script (default loader, text-based source), compiling and loading first if necessary.- Parameters:
text- script text- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (given loader, text-based source), compiling and loading first if necessary.- Parameters:
loader- loadertext- script text- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (default loader, text-based source with desired class name), compiling and loading first if necessary.- Parameters:
text- script textdesiredClassName- desired class name- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (given loader, text-based source with desired class name), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textdesiredClassName- desired class name- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (default loader, file-based source), compiling and loading first if necessary.- Parameters:
file- script file- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (given loader, file-based source), compiling and loading first if necessary.- Parameters:
loader- loaderfile- script file- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (default loader, URL-based source), compiling and loading first if necessary.- Parameters:
url- script URL- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (given loader, URL-based source), compiling and loading first if necessary.- Parameters:
loader- loaderurl- script URL- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (default loader, given source), compiling and loading first if necessary.- Parameters:
source- source- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
create
creates a script (given loader, given source), compiling and loading first if necessary.- Parameters:
loader- loadersource- source- Returns:
- new instance
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
-
binding
creates an empty binding.Same as
new Binding().- Returns:
- new binding
- Since:
- 1.0
-
binding
creates a binding using the given key and value.- Parameters:
key- keyvalue- value- Returns:
- new binding
- Since:
- 1.0
-
binding
creates a binding using the given keys and values.- Parameters:
key1- key 1value1- value 1key2- key 2value2- value 2- Returns:
- new binding
- Since:
- 1.0
-
binding
public Binding binding(String key1, Object value1, String key2, Object value2, String key3, Object value3) creates a binding using the given keys and values.- Parameters:
key1- key 1value1- value 1key2- key 2value2- value 2key3- key 3value3- value 3- Returns:
- new binding
- Since:
- 1.0
-
binding
public Binding binding(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4) creates a binding using the given keys and values.- Parameters:
key1- key 1value1- value 1key2- key 2value2- value 2key3- key 3value3- value 3key4- key 4value4- value 4- Returns:
- new binding
- Since:
- 1.0
-
binding
public Binding binding(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, Object... moreKeyValuePairs) creates a binding using the given keys and values.- Parameters:
key1- key 1value1- value 1key2- key 2value2- value 2key3- key 3value3- value 3key4- key 4value4- value 4key5- key 5value5- value 5moreKeyValuePairs- must be an even number of arguments (key/value) and all keys must be strings- Returns:
- new binding
- Throws:
IllegalArgumentException- if the number of arguments is odd or if a key is not a string- Since:
- 1.0
-
run
runs the given script (empty binding).Note that the script may throw anything, checked or unchecked.
- Parameters:
script- script- Returns:
- what the script returned
- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
runs the given script (given binding).Note that the script may throw anything, checked or unchecked.
- Parameters:
script- scriptbindingMap- binding map- Returns:
- what the script returned
- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
runs the given script (given binding).Note that the script may throw anything, checked or unchecked.
- Parameters:
script- scriptbinding- binding- Returns:
- what the script returned
- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source, empty binding), compiling and loading first if necessary.- Parameters:
text- script text- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source, given binding), compiling and loading first if necessary.- Parameters:
text- script textbindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source, given binding), compiling and loading first if necessary.- Parameters:
text- script textbinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, text-based source, empty binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script text- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, text-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textbindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, text-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textbinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source with desired class name, empty binding), compiling and loading first if necessary.- Parameters:
text- script textdesiredClassName- desired class name- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source with desired class name, given binding), compiling and loading first if necessary.- Parameters:
text- script textdesiredClassName- desired class namebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, text-based source with desired class name, given binding), compiling and loading first if necessary.- Parameters:
text- script textdesiredClassName- desired class namebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, text-based source with desired class name, empty binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textdesiredClassName- desired class name- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
public Object run(Loader loader, String text, String desiredClassName, Map<String, Object> bindingMap) creates and runs a script (given loader, text-based source with desired class name, given binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textdesiredClassName- desired class namebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, text-based source with desired class name, given binding), compiling and loading first if necessary.- Parameters:
loader- loadertext- script textdesiredClassName- desired class namebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, file-based source, empty binding), compiling and loading first if necessary.- Parameters:
file- script file- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, file-based source, given binding), compiling and loading first if necessary.- Parameters:
file- script filebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, file-based source, given binding), compiling and loading first if necessary.- Parameters:
file- script filebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, file-based source, empty binding), compiling and loading first if necessary.- Parameters:
loader- loaderfile- script file- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, file-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loaderfile- script filebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, file-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loaderfile- script filebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, URL-based source, empty binding), compiling and loading first if necessary.- Parameters:
url- script URL- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, URL-based source, given binding), compiling and loading first if necessary.- Parameters:
url- script URLbindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, URL-based source, new binding), compiling and loading first if necessary.- Parameters:
url- script URLbinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, URL-based source, empty binding), compiling and loading first if necessary.- Parameters:
loader- loaderurl- script URL- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, URL-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loaderurl- script URLbindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, URL-based source, given binding), compiling and loading first if necessary.- Parameters:
loader- loaderurl- script URLbinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, given source, empty binding), compiling and loading first if necessary.- Parameters:
source- source- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, given source, given binding), compiling and loading first if necessary.- Parameters:
source- sourcebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (default loader, given source, given binding), compiling and loading first if necessary.- Parameters:
source- sourcebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, given source, empty binding), compiling and loading first if necessary.- Parameters:
loader- loadersource- source- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, given source, given binding), compiling and loading first if necessary.- Parameters:
loader- loadersource- sourcebindingMap- binding map- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-
run
creates and runs a script (given loader, given source, given binding), compiling and loading first if necessary.- Parameters:
loader- loadersource- sourcebinding- binding- Returns:
- what the script returned
- Throws:
CompileException- if compiling failedLoadException- if loading failedCreateException- if could not create the instance or is not a script- Since:
- 1.0
- Throws (out of Groovy script):
Throwable- anything (checked or unchecked) thatScript.run()may throw
-