|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
groovy.lang.GroovyClassLoader
A ClassLoader which can load Groovy classes
Nested Class Summary | |
static class |
GroovyClassLoader.ClassCollector
|
Constructor Summary | |
GroovyClassLoader()
|
|
GroovyClassLoader(ClassLoader loader)
|
|
GroovyClassLoader(ClassLoader loader,
CompilerConfiguration config)
|
|
GroovyClassLoader(GroovyClassLoader parent)
|
Method Summary | |
protected GroovyClassLoader.ClassCollector |
createCollector(CompilationUnit unit)
|
Class |
defineClass(ClassNode classNode,
String file)
Loads the given class node returning the implementation Class |
Class |
defineClass(ClassNode classNode,
String file,
String newCodeBase)
Loads the given class node returning the implementation Class |
protected Class |
defineClass(String name,
byte[] bytecode,
ProtectionDomain domain)
A helper method to allow bytecode to be loaded. |
protected Class |
findClass(String name)
Using this classloader you can load groovy classes from the system classpath as though they were already compiled. |
protected Class |
findGroovyClass(String name)
|
protected Class |
loadClass(String name,
boolean resolve)
|
Class |
parseClass(File file)
Parses the given file into a Java class capable of being run |
Class |
parseClass(GroovyCodeSource codeSource)
Parses the given character stream into a Java class capable of being run |
Class |
parseClass(InputStream in)
Parses the given character stream into a Java class capable of being run |
Class |
parseClass(InputStream in,
String fileName)
|
Class |
parseClass(String text)
Parses the given text into a Java class capable of being run |
Class |
parseClass(String text,
String fileName)
Parses the given text into a Java class capable of being run |
Methods inherited from class java.security.SecureClassLoader |
defineClass, getPermissions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroovyClassLoader()
public GroovyClassLoader(ClassLoader loader)
public GroovyClassLoader(GroovyClassLoader parent)
public GroovyClassLoader(ClassLoader loader, CompilerConfiguration config)
Method Detail |
public Class defineClass(ClassNode classNode, String file)
classNode
-
public Class defineClass(ClassNode classNode, String file, String newCodeBase)
classNode
-
public Class parseClass(File file) throws CompilationFailedException, IOException
file
- the file name to parse
CompilationFailedException
IOException
public Class parseClass(String text, String fileName) throws CompilationFailedException, IOException
text
- the text of the script/class to parsefileName
- the file name to use as the name of the class
CompilationFailedException
IOException
public Class parseClass(String text) throws CompilationFailedException, IOException
text
- the text of the script/class to parse
CompilationFailedException
IOException
public Class parseClass(InputStream in) throws CompilationFailedException, IOException
in
- an InputStream
CompilationFailedException
IOException
public Class parseClass(InputStream in, String fileName) throws CompilationFailedException, IOException
CompilationFailedException
IOException
public Class parseClass(GroovyCodeSource codeSource) throws CompilationFailedException, IOException
CompilationFailedException
IOException
protected Class findClass(String name) throws ClassNotFoundException
ClassNotFoundException
protected Class findGroovyClass(String name) throws ClassNotFoundException
ClassNotFoundException
protected Class defineClass(String name, byte[] bytecode, ProtectionDomain domain)
protected GroovyClassLoader.ClassCollector createCollector(CompilationUnit unit)
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |