Package net.bytebuddy.dynamic.loading
Class ClassLoaderDecorator.NoOp
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ClassLoaderDecorator.NoOp
-
- All Implemented Interfaces:
ClassLoaderDecorator
- Enclosing interface:
- ClassLoaderDecorator
@Enhance public static class ClassLoaderDecorator.NoOp extends java.lang.Object implements ClassLoaderDecorator
A no-operation implementation of a class loader decorator that always returns the same class loader without applying any decoration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.ClassLoaderDecorator
ClassLoaderDecorator.Factory, ClassLoaderDecorator.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderThe class loader to return for all type descriptions ornullfor the bootstrap class loader.
-
Constructor Summary
Constructors Constructor Description NoOp(java.lang.ClassLoader classLoader)Creates a new no-operation class loader decorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoaderapply(TypeDescription typeDescription)Applies this decorator to resolve a class loader for the given type.booleanisSkipped(TypeDescription typeDescription)Determines if a type should be skipped from class loader decoration.
-
-
-
Field Detail
-
classLoader
@MaybeNull @ValueHandling(REVERSE_NULLABILITY) private final java.lang.ClassLoader classLoader
The class loader to return for all type descriptions ornullfor the bootstrap class loader.
-
-
Constructor Detail
-
NoOp
public NoOp(@MaybeNull java.lang.ClassLoader classLoader)
Creates a new no-operation class loader decorator.- Parameters:
classLoader- The class loader to return for all type descriptions ornullfor the bootstrap class loader.
-
-
Method Detail
-
isSkipped
public boolean isSkipped(TypeDescription typeDescription)
Determines if a type should be skipped from class loader decoration.- Specified by:
isSkippedin interfaceClassLoaderDecorator- Parameters:
typeDescription- The type description to check.- Returns:
trueif the type should be skipped from decoration.
-
apply
@MaybeNull public java.lang.ClassLoader apply(TypeDescription typeDescription)
Applies this decorator to resolve a class loader for the given type.- Specified by:
applyin interfaceClassLoaderDecorator- Parameters:
typeDescription- The type description for which to resolve a class loader.- Returns:
- The class loader to use for the given type or
nullfor the bootstrap class loader.
-
-