Class ReflectorLoader
java.lang.Object
java.lang.ClassLoader
org.codehaus.groovy.runtime.metaclass.ReflectorLoader
Deprecated, for removal: This API element is subject to removal in a future version.
No production callers remain; kept only for binary compatibility.
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 Summary
ConstructorsConstructorDescriptionReflectorLoader(ClassLoader parent) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new ReflectorLoader with the specified parent class loader. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>defineClass(String name, byte[] bytecode, ProtectionDomain domain) Deprecated, for removal: This API element is subject to removal in a future version.Defines a Reflector class viaClassLoader.defineClass(byte[], int, int)and caches it undername.protected Class<?>Deprecated, for removal: This API element is subject to removal in a future version.Tries to find a Groovy class.Class<?>getLoadedClass(String name) Deprecated, for removal: This API element is subject to removal in a future version.Retrieves a previously defined Reflector class by name from the cache.protected Class<?>Deprecated, for removal: This API element is subject to removal in a future version.Loads a class per name.Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ReflectorLoader
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new ReflectorLoader with the specified parent class loader.- Parameters:
parent- the parent class loader (should never benull)
-
-
Method Details
-
findClass
Deprecated, for removal: This API element is subject to removal in a future version.Tries to find a Groovy class. Uses the delegation loader to load classes when available.- Overrides:
findClassin classClassLoader- Parameters:
name- the fully qualified name of the class to find- Returns:
- the class if found
- Throws:
ClassNotFoundException- if the class cannot be found
-
loadClass
Deprecated, for removal: This API element is subject to removal in a future version.Loads a class per name. Unlike a normalloadClassthis version behaves differently during a class definition. In that case it checks if the class we want to load isReflectorand returns that class if the check is successful. If it is not during a class definition it just calls the super class version ofloadClass.- Overrides:
loadClassin classClassLoader- Parameters:
name- of the class to loadresolve- istrueif the class should be resolved- Throws:
ClassNotFoundException- See Also:
-
defineClass
Deprecated, for removal: This API element is subject to removal in a future version.Defines a Reflector class viaClassLoader.defineClass(byte[], int, int)and caches it undername.Sets
inDefineduring definition soReflectorresolves to the runtime class.- Parameters:
name- cache key and binary name of the Reflector classbytecode- the bytecode of the Reflector classdomain- the protection domain- Returns:
- the newly defined class
-
getLoadedClass
Deprecated, for removal: This API element is subject to removal in a future version.Retrieves a previously defined Reflector class by name from the cache.- Parameters:
name- the fully qualified name of the Reflector class- Returns:
- the Reflector class if it has been defined, or
nullotherwise
-