Package net.bytebuddy.dynamic
Class TypeResolutionStrategy.Active.Resolved
java.lang.Object
net.bytebuddy.dynamic.TypeResolutionStrategy.Active.Resolved
- All Implemented Interfaces:
TypeResolutionStrategy.Resolved
- Enclosing class:
TypeResolutionStrategy.Active
@Enhance
protected static class TypeResolutionStrategy.Active.Resolved
extends Object
implements TypeResolutionStrategy.Resolved
A resolved version of an active type resolution strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The id used for identifying the loaded type initializer that was added to theNexus
.private final NexusAccessor
The nexus accessor to use. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Resolved
(NexusAccessor nexusAccessor, int identification) Creates a new resolved active type resolution strategy. -
Method Summary
Modifier and TypeMethodDescription<S extends ClassLoader>
Map<TypeDescription, Class<?>> initialize
(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy) Loads and initializes a dynamic type.injectedInto
(TypeInitializer typeInitializer) Injects a type initializer into the supplied type initializer, if applicable.
-
Field Details
-
nexusAccessor
The nexus accessor to use. -
identification
private final int identificationThe id used for identifying the loaded type initializer that was added to theNexus
.
-
-
Constructor Details
-
Resolved
Creates a new resolved active type resolution strategy.- Parameters:
nexusAccessor
- The nexus accessor to use.identification
- The id used for identifying the loaded type initializer that was added to theNexus
.
-
-
Method Details
-
injectedInto
Injects a type initializer into the supplied type initializer, if applicable. This way, a type resolution strategy is capable of injecting code into the generated class's initializer to inline the initialization.- Specified by:
injectedInto
in interfaceTypeResolutionStrategy.Resolved
- Parameters:
typeInitializer
- The type initializer to potentially expend.- Returns:
- A type initializer to apply for performing the represented type resolution.
-
initialize
public <S extends ClassLoader> Map<TypeDescription,Class<?>> initialize(DynamicType dynamicType, @MaybeNull S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy) Loads and initializes a dynamic type.- Specified by:
initialize
in interfaceTypeResolutionStrategy.Resolved
- Type Parameters:
S
- The least specific type of class loader this strategy can apply to.- Parameters:
dynamicType
- The dynamic type to initialize.classLoader
- The class loader to use.classLoadingStrategy
- The class loading strategy to use.- Returns:
- A map of all type descriptions mapped to their representation as a loaded class.
-