@Deprecated(since = "6.0.0", forRemoval = true)
public class ReflectorLoader
extends ClassLoader
Reflector creation helper historically used to define Reflector subclasses.
Deprecated since 6.0.0. Production MetaClass / call-site paths no longer construct or use this loader; the only remaining references are tests. Prefer modern reflective / method-handle dispatch. Retained for binary compatibility only; will be removed in a future major release.
Special about this loader is that it knows the classes from the Groovy runtime. During class definition Reflector resolves to the runtime's Reflector even if a different one exists in the parent loader.
| Constructor and description |
|---|
ReflectorLoader(ClassLoader parent)Creates a new ReflectorLoader with the specified parent class loader. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Class<?> |
defineClass(String name, byte[] bytecode, ProtectionDomain domain)Defines a Reflector class via ClassLoader.defineClass and caches it under name. |
|
protected Class<?> |
findClass(String name)Tries to find a Groovy class. |
|
public Class<?> |
getLoadedClass(String name)Retrieves a previously defined Reflector class by name from the cache. |
|
protected Class<?> |
loadClass(String name, boolean resolve)Loads a class per name. |
| Methods inherited from class | Name |
|---|---|
class ClassLoader |
clearAssertionStatus, equals, getClass, getDefinedPackage, getDefinedPackages, getName, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, hashCode, isRegisteredAsParallelCapable, loadClass, notify, notifyAll, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, toString, wait, wait, wait |
Creates a new ReflectorLoader with the specified parent class loader.
parent - the parent class loader (should never be null) Defines a Reflector class via ClassLoader.defineClass and caches
it under name.
Sets inDefine during definition so Reflector resolves
to the runtime class.
name - cache key and binary name of the Reflector classbytecode - the bytecode of the Reflector classdomain - the protection domainTries to find a Groovy class. Uses the delegation loader to load classes when available.
name - the fully qualified name of the class to findRetrieves a previously defined Reflector class by name from the cache.
name - the fully qualified name of the Reflector classnull otherwise Loads a class per name. Unlike a normal loadClass this version
behaves differently during a class definition. In that case it checks
if the class we want to load is Reflector and returns that
class if the check is successful. If it is not during a class definition
it just calls the super class version of loadClass.
name - of the class to loadresolve - is true if the class should be resolvedCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.