|
Groovy 1.7.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovy.util.GroovyScriptEngine
class GroovyScriptEngine extends Object
Specific script engine able to reload modified scripts as well as dealing properly with dependent scripts.
Nested Class Summary | |
---|---|
class |
GroovyScriptEngine.ScriptCacheEntry
|
class |
GroovyScriptEngine.ScriptClassLoader
|
Constructor Summary | |
GroovyScriptEngine()
|
Method Summary | |
---|---|
def
|
GroovyScriptEngine(URL[] roots)
|
def
|
GroovyScriptEngine(URL[] roots, ClassLoader parentClassLoader)
|
def
|
GroovyScriptEngine(String[] urls)
|
def
|
GroovyScriptEngine(String[] urls, ClassLoader parentClassLoader)
|
def
|
GroovyScriptEngine(String url)
|
def
|
GroovyScriptEngine(String url, ClassLoader parentClassLoader)
|
def
|
GroovyScriptEngine(ResourceConnector rc)
|
def
|
GroovyScriptEngine(ResourceConnector rc, ClassLoader parentClassLoader)
|
Script
|
createScript(String scriptName, Binding binding)
Creates a Script with a given scriptName and binding. |
CompilerConfiguration
|
getConfig()
|
GroovyClassLoader
|
getGroovyClassLoader()
Returns the GroovyClassLoader associated with this script engine instance. |
ClassLoader
|
getParentClassLoader()
Get the |
URLConnection
|
getResourceConnection(String resourceName)
Get a resource connection as a |
protected boolean
|
isSourceNewer(ScriptCacheEntry entry)
|
Class
|
loadScriptByName(String scriptName)
Get the class of the scriptName in question, so that you can instantiate Groovy objects with caching and reloading. |
Class
|
loadScriptByName(String scriptName, ClassLoader parentClassLoader)
Get the class of the scriptName in question, so that you can instantiate Groovy objects with caching and reloading. |
static void
|
main(String[] urls)
Simple testing harness for the GSE. |
String
|
run(String scriptName, String argument)
Run a script identified by name with a single argument. |
Object
|
run(String scriptName, Binding binding)
Run a script identified by name with a given binding. |
void
|
setConfig(CompilerConfiguration config)
sets a compiler configuration |
void
|
setParentClassLoader(ClassLoader parentClassLoader)
for scripts executed by the engine |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Constructor Detail |
---|
GroovyScriptEngine()
Method Detail |
---|
public def GroovyScriptEngine(URL[] roots)
public def GroovyScriptEngine(URL[] roots, ClassLoader parentClassLoader)
public def GroovyScriptEngine(String[] urls)
public def GroovyScriptEngine(String[] urls, ClassLoader parentClassLoader)
public def GroovyScriptEngine(String url)
public def GroovyScriptEngine(String url, ClassLoader parentClassLoader)
public def GroovyScriptEngine(ResourceConnector rc)
public def GroovyScriptEngine(ResourceConnector rc, ClassLoader parentClassLoader)
public Script createScript(String scriptName, Binding binding)
public CompilerConfiguration getConfig()
public GroovyClassLoader getGroovyClassLoader()
public ClassLoader getParentClassLoader()
ClassLoader
that will serve as the parent ClassLoader of the
GroovyClassLoader in which scripts will be executed. By default, this is the
ClassLoader that loaded the GroovyScriptEngine
class.
public URLConnection getResourceConnection(String resourceName)
URLConnection
to retrieve a script
from the ResourceConnector
.
protected boolean isSourceNewer(ScriptCacheEntry entry)
public Class loadScriptByName(String scriptName)
public Class loadScriptByName(String scriptName, ClassLoader parentClassLoader)
public static void main(String[] urls)
public String run(String scriptName, String argument)
arg
in the binding
toString()
representation of the result of the execution of the script
public Object run(String scriptName, Binding binding)
public void setConfig(CompilerConfiguration config)
public void setParentClassLoader(ClassLoader parentClassLoader)
Copyright © 2003-2009 The Codehaus. All rights reserved.