public class ReflectorLoader extends ClassLoader
Reflector creation helper. This class is used to define the Reflector 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 and description |
---|
ReflectorLoader(ClassLoader parent) creates a ReflectorLoader. |
Type Params | Return Type | Name and description |
---|---|---|
|
public Class |
defineClass(String name, byte[] bytecode, ProtectionDomain domain) helper method to define Reflector classes. |
|
public Class |
getLoadedClass(String name) try to load one of the defined Reflector classes by name. |
Methods inherited from class | Name |
---|---|
class ClassLoader |
getName, loadClass, getPlatformClassLoader, getSystemClassLoader, getSystemResourceAsStream, getResourceAsStream, getSystemResource, getResource, getResources, getDefinedPackage, resources, isRegisteredAsParallelCapable, getSystemResources, getParent, getUnnamedModule, getDefinedPackages, setDefaultAssertionStatus, setPackageAssertionStatus, setClassAssertionStatus, clearAssertionStatus, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
creates a ReflectorLoader.
parent
- the parent loader. This should never be null!helper method to define Reflector classes.
name
- of the Reflectorbytecode
- the bytecodedomain
- the protection domainCopyright © 2003-2022 The Apache Software Foundation. All rights reserved.