Package net.bytebuddy.dynamic
Class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
- All Implemented Interfaces:
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
- Direct Known Subclasses:
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader
- Enclosing interface:
- ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
@Enhance
public static class ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default
extends Object
implements ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
A default implementation of a class loading delegate.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
A privileged action for creating a proxy class loader for the boot class loader.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Explicit, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ClassLoader
A class loader that does not define resources of its own but allows querying for resources supplied by the boot loader.protected final ClassLoader
The underlying class loader. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default
(ClassLoader classLoader) Creates a default class loading delegate. -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying class loader.Class<?>
Loads a class by its name.of
(ClassLoader classLoader) Creates a class loading delegate for the given class loader.
-
Field Details
-
BOOT_LOADER_PROXY
A class loader that does not define resources of its own but allows querying for resources supplied by the boot loader. -
classLoader
The underlying class loader.
-
-
Constructor Details
-
Default
Creates a default class loading delegate.- Parameters:
classLoader
- The class loader to be queried.
-
-
Method Details
-
of
public static ClassFileLocator.ForInstrumentation.ClassLoadingDelegate of(@MaybeNull ClassLoader classLoader) Creates a class loading delegate for the given class loader.- Parameters:
classLoader
- The class loader for which to create a delegate ornull
to use the boot loader.- Returns:
- The class loading delegate for the provided class loader.
-
locate
Loads a class by its name.- Specified by:
locate
in interfaceClassFileLocator.ForInstrumentation.ClassLoadingDelegate
- Parameters:
name
- The name of the type.- Returns:
- The class with the given name.
- Throws:
ClassNotFoundException
- If a class cannot be found.
-
getClassLoader
Returns the underlying class loader.- Specified by:
getClassLoader
in interfaceClassFileLocator.ForInstrumentation.ClassLoadingDelegate
- Returns:
- The underlying class loader.
-