|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader org.codehaus.groovy.runtime.metaclass.ReflectorLoader
public class ReflectorLoader extends java.lang.ClassLoader
Reflector creation helper. This class is used to define the Refloctor classes. For each ClassLoader such a loader will be created by MetaClass. Special about this loader is, that it knows the classes form the Groovy Runtime. The Reflector class is resolved in different ways: During the definition of a class Reflector will resolve to the Reflector class of the runtime, even if there is another Reflector class in the parent loader. After the new class is defined Reflector will resolve like other Groovy classes. This loader is able to resolve all Groovy classes even if the parent does not know them, but the parent serves first (Reflector during a class definition is different).
Constructor Summary | |
ReflectorLoader(java.lang.ClassLoader parent)
creates a ReflectorLoader. |
Method Summary | |
---|---|
java.lang.Class
|
defineClass(java.lang.String name, byte[] bytecode, java.security.ProtectionDomain domain)
helper method to define Reflector classes. |
protected java.lang.Class
|
findClass(java.lang.String name)
Tries to find a Groovy class. |
java.lang.Class
|
getLoadedClass(java.lang.String name)
try to load one of the defined Reflector classes by name. |
protected java.lang.Class
|
loadClass(java.lang.String name, boolean resolve)
Loads a class per name. |
Methods inherited from class java.lang.ClassLoader | |
---|---|
java.lang.ClassLoader#loadClass(java.lang.String), java.lang.ClassLoader#getSystemClassLoader(), java.lang.ClassLoader#getResources(java.lang.String), java.lang.ClassLoader#getSystemResources(java.lang.String), java.lang.ClassLoader#getParent(), java.lang.ClassLoader#setDefaultAssertionStatus(boolean), java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean), java.lang.ClassLoader#clearAssertionStatus(), java.lang.ClassLoader#getResourceAsStream(java.lang.String), java.lang.ClassLoader#getResource(java.lang.String), java.lang.ClassLoader#getSystemResourceAsStream(java.lang.String), java.lang.ClassLoader#getSystemResource(java.lang.String), java.lang.ClassLoader#wait(long), java.lang.ClassLoader#wait(long, int), java.lang.ClassLoader#wait(), java.lang.ClassLoader#equals(java.lang.Object), java.lang.ClassLoader#toString(), java.lang.ClassLoader#hashCode(), java.lang.ClassLoader#getClass(), java.lang.ClassLoader#notify(), java.lang.ClassLoader#notifyAll() |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public ReflectorLoader(java.lang.ClassLoader parent)
parent
- the parent loader. This should never be null!
Method Detail |
---|
public java.lang.Class defineClass(java.lang.String name, byte[] bytecode, java.security.ProtectionDomain domain)
name
- of the Reflectorbytecode
- the bytecodedomain
- the protection domain
protected java.lang.Class findClass(java.lang.String name)
public java.lang.Class getLoadedClass(java.lang.String name)
name
- of the Reflector class
protected java.lang.Class loadClass(java.lang.String name, boolean resolve)
name
- of the class to loadresolve
- is true if the class should be resolved
Groovy Documentation