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 enumA privileged action for creating a proxy class loader for the boot class loader.Nested classes/interfaces inherited from interface ClassFileLocator.ForInstrumentation.ClassLoadingDelegate
ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Default, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.Explicit, ClassFileLocator.ForInstrumentation.ClassLoadingDelegate.ForDelegatingClassLoader -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault(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
-
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 ornullto use the boot loader.- Returns:
- The class loading delegate for the provided class loader.
-
locate
Loads a class by its name.- Specified by:
locatein 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:
getClassLoaderin interfaceClassFileLocator.ForInstrumentation.ClassLoadingDelegate- Returns:
- The underlying class loader.
-