Package net.bytebuddy.dynamic
Interface DynamicType.Unloaded<T>
- Type Parameters:
T
- The most specific known loaded type that is implemented by this dynamic type, usually the type itself, an interface or the direct super class.
- All Superinterfaces:
AutoCloseable
,ClassFileLocator
,Closeable
,DynamicType
- All Known Implementing Classes:
DynamicType.Default.Unloaded
- Enclosing interface:
DynamicType
A dynamic type that has not yet been loaded by a given
ClassLoader
.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator
ClassFileLocator.Compound, ClassFileLocator.Filtering, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForInstrumentation, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType
DynamicType.Builder<T>, DynamicType.Default, DynamicType.Loaded<T>, DynamicType.Unloaded<T>
-
Field Summary
Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION
-
Method Summary
Modifier and TypeMethodDescriptioninclude
(List<? extends DynamicType> dynamicTypes) Includes the provided dynamic types as auxiliary types of this instance.include
(DynamicType... dynamicType) Includes the provided dynamic types as auxiliary types of this instance.load
(ClassLoader classLoader) Attempts to load this dynamic type including all of its auxiliary types, if any.<S extends ClassLoader>
DynamicType.Loaded<T> load
(S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy) Attempts to load this dynamic type including all of its auxiliary types, if any.Methods inherited from interface net.bytebuddy.dynamic.ClassFileLocator
locate
Methods inherited from interface net.bytebuddy.dynamic.DynamicType
getAllTypes, getAuxiliaryTypes, getBytes, getLoadedTypeInitializers, getTypeDescription, hasAliveLoadedTypeInitializers, inject, inject, saveIn, toJar, toJar
-
Method Details
-
load
Attempts to load this dynamic type including all of its auxiliary types, if any. If the class loader is an unsealed instance of
InjectionClassLoader
, the classes are injected directy into the class loader, otherwise, a new class loader is created where the supplied class loader is set as parent.Note: A new class is attempted to be loaded each time this method is invoked, even if a compatible class was created previously. Consider using a
TypeCache
.- Parameters:
classLoader
- The class loader to use for this class loading ornull
for using the boot loader.- Returns:
- This dynamic type in its loaded state.
-
load
<S extends ClassLoader> DynamicType.Loaded<T> load(@MaybeNull S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy) Attempts to load this dynamic type including all of its auxiliary types, if any.
Note: A new class is attempted to be loaded each time this method is invoked, even if a compatible class was created previously. Consider using a
TypeCache
.- Type Parameters:
S
- The least specific type of class loader this strategy can apply to.- Parameters:
classLoader
- The class loader to use for this class loading.classLoadingStrategy
- The class loader strategy which should be used for this class loading.- Returns:
- This dynamic type in its loaded state.
- See Also:
-
include
Includes the provided dynamic types as auxiliary types of this instance.- Parameters:
dynamicType
- The dynamic types to include.- Returns:
- A copy of this unloaded dynamic type which includes the provided dynamic types.
-
include
Includes the provided dynamic types as auxiliary types of this instance.- Parameters:
dynamicTypes
- The dynamic types to include.- Returns:
- A copy of this unloaded dynamic type which includes the provided dynamic types.
-