|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
org.codehaus.groovy.runtime.metaclass.ReflectorLoader
public class ReflectorLoader
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(ClassLoader parent)
creates a RelfectorLoader. |
Method Summary | |
---|---|
Class |
defineClass(String name,
byte[] bytecode,
ProtectionDomain domain)
helper method to define Reflector classes. |
protected Class |
findClass(String name)
Tries to find a Groovy class. |
Class |
getLoadedClass(String name)
try to load one of the defined Reflector classes by name. |
protected Class |
loadClass(String name,
boolean resolve)
Loads a class per name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectorLoader(ClassLoader parent)
parent
- the parent loader. This should never be null!Method Detail |
---|
protected Class findClass(String name) throws ClassNotFoundException
findClass
in class ClassLoader
ClassNotFoundException
- if not foundprotected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
name
- of the class to loadresolve
- is true if the class should be resolved
ClassNotFoundException
Reflector
,
ClassLoader.loadClass(String, boolean)
public Class defineClass(String name, byte[] bytecode, ProtectionDomain domain)
name
- of the Reflectorbytecode
- the bytecodedomain
- the protection domain
public Class getLoadedClass(String name)
name
- of the Reflector class
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |