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:
DynamicType
- All Known Implementing Classes:
DynamicType.Default.Unloaded
- Enclosing interface:
- DynamicType
public static interface DynamicType.Unloaded<T> extends DynamicType
A dynamic type that has not yet been loaded by a givenClassLoader
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType
DynamicType.Builder<T>, DynamicType.Default, DynamicType.Loaded<T>, DynamicType.Unloaded<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicType.Unloaded<T>
include(java.util.List<? extends DynamicType> dynamicTypes)
Includes the provided dynamic types as auxiliary types of this instance.DynamicType.Unloaded<T>
include(DynamicType... dynamicType)
Includes the provided dynamic types as auxiliary types of this instance.DynamicType.Loaded<T>
load(java.lang.ClassLoader classLoader)
Attempts to load this dynamic type including all of its auxiliary types, if any.<S extends java.lang.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.DynamicType
getAllTypes, getAuxiliaryTypes, getBytes, getLoadedTypeInitializers, getTypeDescription, hasAliveLoadedTypeInitializers, inject, inject, saveIn, toJar, toJar
-
-
-
-
Method Detail
-
load
DynamicType.Loaded<T> load(java.lang.ClassLoader classLoader)
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.- Returns:
- This dynamic type in its loaded state.
-
load
<S extends java.lang.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.
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:
ClassLoadingStrategy.Default
-
include
DynamicType.Unloaded<T> include(DynamicType... dynamicType)
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
DynamicType.Unloaded<T> include(java.util.List<? extends DynamicType> dynamicTypes)
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.
-
-