Top Description Inners Methods
net.bytebuddy.dynamic

public Interface TypeResolutionStrategy

Known Direct Implementers
net.bytebuddy.dynamic.TypeResolutionStrategy.Passive, net.bytebuddy.dynamic.TypeResolutionStrategy.Active, net.bytebuddy.dynamic.TypeResolutionStrategy.Lazy, net.bytebuddy.dynamic.TypeResolutionStrategy.Disabled
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.dynamic.loading.ClassLoadingStrategy, net.bytebuddy.dynamic.scaffold.TypeInitializer, net.bytebuddy.implementation.LoadedTypeInitializer, net.bytebuddy.utility.nullability.MaybeNull, java.util.HashMap, .Map, .Random

A type resolution strategy is responsible for loading a class and for initializing its LoadedTypeInitializers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
TypeResolutionStrategy.Active

A type resolution strategy that applies all LoadedTypeInitializer as a part of class loading using reflection.

public static enum
TypeResolutionStrategy.Disabled

A type resolution strategy that does not allow for explicit loading of a class and that does not inject any code into the type initializer.

public static enum
TypeResolutionStrategy.Lazy

A type resolution strategy that does not apply any LoadedTypeInitializers but only loads all types.

public static enum
TypeResolutionStrategy.Passive

A type resolution strategy that applies all LoadedTypeInitializer after class loading using reflection.

public static interface

Method Summary

Modifier and TypeMethod and Description
public TypeResolutionStrategy.Resolved

Returns:

A resolved version of this type resolution strategy.
resolve
()

Resolves a type resolution strategy for actual application.

Method Detail

resolveback to summary
public TypeResolutionStrategy.Resolved resolve()

Resolves a type resolution strategy for actual application.

Returns:TypeResolutionStrategy.Resolved

A resolved version of this type resolution strategy.

net.bytebuddy.dynamic back to summary

public Class TypeResolutionStrategy.Active

extends Object
implements TypeResolutionStrategy
Class Inheritance
All Implemented Interfaces
net.bytebuddy.dynamic.TypeResolutionStrategy
Annotations
@Enhance

A type resolution strategy that applies all LoadedTypeInitializer as a part of class loading using reflection. This implies that the initializers are executed before (as a first action of) a type initializer is executed.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
TypeResolutionStrategy.Active.Resolved

A resolved version of an active type resolution strategy.

Field Summary

Modifier and TypeField and Description
private final NexusAccessor
nexusAccessor

The nexus accessor to use.

Constructor Summary

AccessConstructor and Description
public
Active()

Creates a new active type resolution strategy that uses a default nexus accessor.

public
Active(NexusAccessor
The nexus accessor to use.
nexusAccessor
)

Creates a new active type resolution strategy that uses the supplied nexus accessor.

Method Summary

Modifier and TypeMethod and Description
public TypeResolutionStrategy.Resolved
resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nexusAccessorback to summary
private final NexusAccessor nexusAccessor

The nexus accessor to use.

Constructor Detail

Activeback to summary
public Active()

Creates a new active type resolution strategy that uses a default nexus accessor.

Activeback to summary
public Active(NexusAccessor nexusAccessor)

Creates a new active type resolution strategy that uses the supplied nexus accessor.

Parameters
nexusAccessor:NexusAccessor

The nexus accessor to use.

Method Detail

resolveback to summary
public TypeResolutionStrategy.Resolved resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.

Returns:TypeResolutionStrategy.Resolved

A resolved version of this type resolution strategy.

Annotations
@SuppressFBWarnings:DMI_RANDOM_USED_ONLY_ONCE
justification:Avoids thread-contention.
net.bytebuddy.dynamic back to summary

protected Class TypeResolutionStrategy.Active.Resolved

extends Object
implements Resolved
Class Inheritance
All Implemented Interfaces
net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved
Annotations
@Enhance

A resolved version of an active type resolution strategy.

Field Summary

Modifier and TypeField and Description
private final int
identification

The id used for identifying the loaded type initializer that was added to the Nexus.

private final NexusAccessor
nexusAccessor

The nexus accessor to use.

Constructor Summary

AccessConstructor and Description
protected
Resolved(NexusAccessor
The nexus accessor to use.
nexusAccessor
,
int
The id used for identifying the loaded type initializer that was added to the Nexus.
identification
)

Creates a new resolved active type resolution strategy.

Method Summary

Modifier and TypeMethod and Description
public <S extends ClassLoader> Map<TypeDescription, Class<?>>
initialize(DynamicType
The dynamic type to initialize.
dynamicType
,
S
The class loader to use.
classLoader
,
ClassLoadingStrategy<? super S>
The class loading strategy to use.
classLoadingStrategy
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.
public TypeInitializer
injectedInto(TypeInitializer
The type initializer to potentially expend.
typeInitializer
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Injects a type initializer into the supplied type initializer, if applicable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

identificationback to summary
private final int identification

The id used for identifying the loaded type initializer that was added to the Nexus.

nexusAccessorback to summary
private final NexusAccessor nexusAccessor

The nexus accessor to use.

Constructor Detail

Resolvedback to summary
protected Resolved(NexusAccessor nexusAccessor, int identification)

Creates a new resolved active type resolution strategy.

Parameters
nexusAccessor:NexusAccessor

The nexus accessor to use.

identification:int

The id used for identifying the loaded type initializer that was added to the Nexus.

Method Detail

initializeback to summary
public <S extends ClassLoader> Map<TypeDescription, Class<?>> initialize(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.

Parameters
<S>
The least specific type of class loader this strategy can apply to.
dynamicType:DynamicType

The dynamic type to initialize.

classLoader:S

The class loader to use.

classLoadingStrategy:ClassLoadingStrategy<? super S>

The class loading strategy to use.

Returns:Map<TypeDescription, Class<?>>

A map of all type descriptions mapped to their representation as a loaded class.

injectedIntoback to summary
public TypeInitializer injectedInto(TypeInitializer typeInitializer)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.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.

Parameters
typeInitializer:TypeInitializer

The type initializer to potentially expend.

Returns:TypeInitializer

A type initializer to apply for performing the represented type resolution.

net.bytebuddy.dynamic back to summary

public final Enum TypeResolutionStrategy.Disabled

extends Enum<TypeResolutionStrategy.Disabled>
implements TypeResolutionStrategy, Resolved
Class Inheritance
All Implemented Interfaces
net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved, net.bytebuddy.dynamic.TypeResolutionStrategy

A type resolution strategy that does not allow for explicit loading of a class and that does not inject any code into the type initializer.

Field Summary

Modifier and TypeField and Description
public static final TypeResolutionStrategy.Disabled
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <S extends ClassLoader> Map<TypeDescription, Class<?>>
initialize(DynamicType
The dynamic type to initialize.
dynamicType
,
S
The class loader to use.
classLoader
,
ClassLoadingStrategy<? super S>
The class loading strategy to use.
classLoadingStrategy
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.
public TypeInitializer
injectedInto(TypeInitializer
The type initializer to potentially expend.
typeInitializer
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Injects a type initializer into the supplied type initializer, if applicable.
public TypeResolutionStrategy.Resolved
resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.
public static TypeResolutionStrategy.Disabled
public static TypeResolutionStrategy.Disabled[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final TypeResolutionStrategy.Disabled INSTANCE

The singleton instance.

Constructor Detail

Disabledback to summary
private Disabled()

Method Detail

initializeback to summary
public <S extends ClassLoader> Map<TypeDescription, Class<?>> initialize(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.

Parameters
<S>
The least specific type of class loader this strategy can apply to.
dynamicType:DynamicType

The dynamic type to initialize.

classLoader:S

The class loader to use.

classLoadingStrategy:ClassLoadingStrategy<? super S>

The class loading strategy to use.

Returns:Map<TypeDescription, Class<?>>

A map of all type descriptions mapped to their representation as a loaded class.

injectedIntoback to summary
public TypeInitializer injectedInto(TypeInitializer typeInitializer)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.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.

Parameters
typeInitializer:TypeInitializer

The type initializer to potentially expend.

Returns:TypeInitializer

A type initializer to apply for performing the represented type resolution.

resolveback to summary
public TypeResolutionStrategy.Resolved resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.

Returns:TypeResolutionStrategy.Resolved

A resolved version of this type resolution strategy.

valueOfback to summary
public static TypeResolutionStrategy.Disabled valueOf(String name)
valuesback to summary
public static TypeResolutionStrategy.Disabled[] values()
net.bytebuddy.dynamic back to summary

public final Enum TypeResolutionStrategy.Lazy

extends Enum<TypeResolutionStrategy.Lazy>
implements TypeResolutionStrategy, Resolved
Class Inheritance
All Implemented Interfaces
net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved, net.bytebuddy.dynamic.TypeResolutionStrategy

A type resolution strategy that does not apply any LoadedTypeInitializers but only loads all types.

Field Summary

Modifier and TypeField and Description
public static final TypeResolutionStrategy.Lazy
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private
Lazy()

Method Summary

Modifier and TypeMethod and Description
public <S extends ClassLoader> Map<TypeDescription, Class<?>>
initialize(DynamicType
The dynamic type to initialize.
dynamicType
,
S
The class loader to use.
classLoader
,
ClassLoadingStrategy<? super S>
The class loading strategy to use.
classLoadingStrategy
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.
public TypeInitializer
injectedInto(TypeInitializer
The type initializer to potentially expend.
typeInitializer
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Injects a type initializer into the supplied type initializer, if applicable.
public TypeResolutionStrategy.Resolved
resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.
public static TypeResolutionStrategy.Lazy
public static TypeResolutionStrategy.Lazy[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final TypeResolutionStrategy.Lazy INSTANCE

The singleton instance.

Constructor Detail

Lazyback to summary
private Lazy()

Method Detail

initializeback to summary
public <S extends ClassLoader> Map<TypeDescription, Class<?>> initialize(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.

Parameters
<S>
The least specific type of class loader this strategy can apply to.
dynamicType:DynamicType

The dynamic type to initialize.

classLoader:S

The class loader to use.

classLoadingStrategy:ClassLoadingStrategy<? super S>

The class loading strategy to use.

Returns:Map<TypeDescription, Class<?>>

A map of all type descriptions mapped to their representation as a loaded class.

injectedIntoback to summary
public TypeInitializer injectedInto(TypeInitializer typeInitializer)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.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.

Parameters
typeInitializer:TypeInitializer

The type initializer to potentially expend.

Returns:TypeInitializer

A type initializer to apply for performing the represented type resolution.

resolveback to summary
public TypeResolutionStrategy.Resolved resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.

Returns:TypeResolutionStrategy.Resolved

A resolved version of this type resolution strategy.

valueOfback to summary
public static TypeResolutionStrategy.Lazy valueOf(String name)
valuesback to summary
public static TypeResolutionStrategy.Lazy[] values()
net.bytebuddy.dynamic back to summary

public final Enum TypeResolutionStrategy.Passive

extends Enum<TypeResolutionStrategy.Passive>
implements TypeResolutionStrategy, Resolved
Class Inheritance
All Implemented Interfaces
net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved, net.bytebuddy.dynamic.TypeResolutionStrategy

A type resolution strategy that applies all LoadedTypeInitializer after class loading using reflection. This implies that the initializers are executed after a type initializer is executed.

Field Summary

Modifier and TypeField and Description
public static final TypeResolutionStrategy.Passive
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <S extends ClassLoader> Map<TypeDescription, Class<?>>
initialize(DynamicType
The dynamic type to initialize.
dynamicType
,
S
The class loader to use.
classLoader
,
ClassLoadingStrategy<? super S>
The class loading strategy to use.
classLoadingStrategy
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.
public TypeInitializer
injectedInto(TypeInitializer
The type initializer to potentially expend.
typeInitializer
)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Injects a type initializer into the supplied type initializer, if applicable.
public TypeResolutionStrategy.Resolved
resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.
public static TypeResolutionStrategy.Passive
public static TypeResolutionStrategy.Passive[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final TypeResolutionStrategy.Passive INSTANCE

The singleton instance.

Constructor Detail

Passiveback to summary
private Passive()

Method Detail

initializeback to summary
public <S extends ClassLoader> Map<TypeDescription, Class<?>> initialize(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.initialize.

Loads and initializes a dynamic type.

Parameters
<S>
The least specific type of class loader this strategy can apply to.
dynamicType:DynamicType

The dynamic type to initialize.

classLoader:S

The class loader to use.

classLoadingStrategy:ClassLoadingStrategy<? super S>

The class loading strategy to use.

Returns:Map<TypeDescription, Class<?>>

A map of all type descriptions mapped to their representation as a loaded class.

injectedIntoback to summary
public TypeInitializer injectedInto(TypeInitializer typeInitializer)

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.injectedInto.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.Resolved.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.

Parameters
typeInitializer:TypeInitializer

The type initializer to potentially expend.

Returns:TypeInitializer

A type initializer to apply for performing the represented type resolution.

resolveback to summary
public TypeResolutionStrategy.Resolved resolve()

Implements net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Doc from net.bytebuddy.dynamic.TypeResolutionStrategy.resolve.

Resolves a type resolution strategy for actual application.

Returns:TypeResolutionStrategy.Resolved

A resolved version of this type resolution strategy.

valueOfback to summary
public static TypeResolutionStrategy.Passive valueOf(String name)
valuesback to summary
public static TypeResolutionStrategy.Passive[] values()
net.bytebuddy.dynamic back to summary

public Interface TypeResolutionStrategy.Resolved

Known Direct Implementers
net.bytebuddy.dynamic.TypeResolutionStrategy.Passive, net.bytebuddy.dynamic.TypeResolutionStrategy.Active.Resolved, net.bytebuddy.dynamic.TypeResolutionStrategy.Lazy, net.bytebuddy.dynamic.TypeResolutionStrategy.Disabled

A resolved TypeResolutionStrategy.

Method Summary

Modifier and TypeMethod and Description
public <
The least specific type of class loader this strategy can apply to.
S extends ClassLoader
>
Map<TypeDescription, Class<?>>

Returns:

A map of all type descriptions mapped to their representation as a loaded class.
initialize
(DynamicType
The dynamic type to initialize.
dynamicType
,
S
The class loader to use.
classLoader
,
ClassLoadingStrategy<? super S>
The class loading strategy to use.
classLoadingStrategy
)

Loads and initializes a dynamic type.

public TypeInitializer

Returns:

A type initializer to apply for performing the represented type resolution.
injectedInto
(TypeInitializer
The type initializer to potentially expend.
typeInitializer
)

Injects a type initializer into the supplied type initializer, if applicable.

Method Detail

initializeback to summary
public <S extends ClassLoader> Map<TypeDescription, Class<?>> initialize(DynamicType dynamicType, S classLoader, ClassLoadingStrategy<? super S> classLoadingStrategy)

Loads and initializes a dynamic type.

Parameters
<S>
The least specific type of class loader this strategy can apply to.
dynamicType:DynamicType

The dynamic type to initialize.

classLoader:S

The class loader to use.

classLoadingStrategy:ClassLoadingStrategy<? super S>

The class loading strategy to use.

Returns:Map<TypeDescription, Class<?>>

A map of all type descriptions mapped to their representation as a loaded class.

injectedIntoback to summary
public TypeInitializer injectedInto(TypeInitializer typeInitializer)

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.

Parameters
typeInitializer:TypeInitializer

The type initializer to potentially expend.

Returns:TypeInitializer

A type initializer to apply for performing the represented type resolution.