|
|||||||||||
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 | |
void |
addClasspath(String path)
|
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 |
Class |
defineClass(String name,
byte[] b)
open up the super class define that takes raw bytes |
protected Class |
defineClass(String name,
byte[] bytecode,
ProtectionDomain domain)
A helper method to allow bytecode to be loaded. |
protected void |
expandClassPath(List pathList,
String base,
String classpath)
|
protected Class |
findGroovyClass(String name)
Using this classloader you can load groovy classes from the system classpath as though they were already compiled. |
protected String[] |
getClassPath()
Workaround for Groovy-835 |
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)
|
Class |
parseClass(GroovyCodeSource codeSource,
boolean shouldCache)
Parses the given code source 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 |
void |
removeFromCache(Class aClass)
|
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 void removeFromCache(Class aClass)
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
text
- the text of the script/class to parsefileName
- the file name to use as the name of the class
CompilationFailedException
public Class parseClass(String text) throws CompilationFailedException
text
- the text of the script/class to parse
CompilationFailedException
public Class parseClass(InputStream in) throws CompilationFailedException
in
- an InputStream
CompilationFailedException
public Class parseClass(InputStream in, String fileName) throws CompilationFailedException
CompilationFailedException
public Class parseClass(GroovyCodeSource codeSource) throws CompilationFailedException
CompilationFailedException
public Class parseClass(GroovyCodeSource codeSource, boolean shouldCache) throws CompilationFailedException
CompilationFailedException
protected Class findGroovyClass(String name) throws ClassNotFoundException
ClassNotFoundException
protected String[] getClassPath()
protected void expandClassPath(List pathList, String base, String classpath)
pathList
- classpath
- protected Class defineClass(String name, byte[] bytecode, ProtectionDomain domain)
protected GroovyClassLoader.ClassCollector createCollector(CompilationUnit unit)
public Class defineClass(String name, byte[] b)
protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
public void addClasspath(String path)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |