Package net.bytebuddy.description.type
Class TypeDescription.Generic.Visitor.Substitutor.ForAttachment
java.lang.Object
net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor
net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor.ForAttachment
- All Implemented Interfaces:
TypeDescription.Generic.Visitor<TypeDescription.Generic>
- Enclosing class:
TypeDescription.Generic.Visitor.Substitutor
@Enhance
public static class TypeDescription.Generic.Visitor.Substitutor.ForAttachment
extends TypeDescription.Generic.Visitor.Substitutor
A substitutor that attaches type variables to a type variable source and replaces representations of
TargetType
with a given declaring type.-
Nested Class Summary
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor
TypeDescription.Generic.Visitor.Substitutor.ForAttachment, TypeDescription.Generic.Visitor.Substitutor.ForDetachment, TypeDescription.Generic.Visitor.Substitutor.ForReplacement, TypeDescription.Generic.Visitor.Substitutor.ForTokenNormalization, TypeDescription.Generic.Visitor.Substitutor.ForTypeVariableBinding, TypeDescription.Generic.Visitor.Substitutor.WithoutTypeSubstitution
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDescription.Generic.Visitor
TypeDescription.Generic.Visitor.AnnotationStripper, TypeDescription.Generic.Visitor.Assigner, TypeDescription.Generic.Visitor.ForRawType, TypeDescription.Generic.Visitor.ForSignatureVisitor, TypeDescription.Generic.Visitor.NoOp, TypeDescription.Generic.Visitor.Reducing, TypeDescription.Generic.Visitor.Reifying, TypeDescription.Generic.Visitor.Substitutor, TypeDescription.Generic.Visitor.TypeErasing, TypeDescription.Generic.Visitor.Validator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription
The declaring type which is filled in forTargetType
.private final TypeVariableSource
The source which is used for locating type variables. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForAttachment
(TypeDefinition declaringType, TypeVariableSource typeVariableSource) Creates a visitor for attaching type variables.protected
ForAttachment
(TypeDescription declaringType, TypeVariableSource typeVariableSource) Creates a visitor for attaching type variables. -
Method Summary
Modifier and TypeMethodDescriptionof
(FieldDescription fieldDescription) Attaches all types to the given field description.of
(MethodDescription methodDescription) Attaches all types to the given method description.of
(ParameterDescription parameterDescription) Attaches all types to the given parameter description.of
(RecordComponentDescription recordComponentDescription) Attaches all types to the given record component description.of
(TypeDescription typeDescription) Attaches all types to the given type description.protected TypeDescription.Generic
onSimpleType
(TypeDescription.Generic typeDescription) Visits a simple, non-generic type, i.e.onTypeVariable
(TypeDescription.Generic typeVariable) Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor
onGenericArray, onNonGenericType, onParameterizedType, onWildcard
-
Field Details
-
declaringType
The declaring type which is filled in forTargetType
. -
typeVariableSource
The source which is used for locating type variables.
-
-
Constructor Details
-
ForAttachment
Creates a visitor for attaching type variables.- Parameters:
declaringType
- The declaring type which is filled in forTargetType
in its erased form.typeVariableSource
- The source which is used for locating type variables.
-
ForAttachment
Creates a visitor for attaching type variables.- Parameters:
declaringType
- The declaring type which is filled in forTargetType
.typeVariableSource
- The source which is used for locating type variables.
-
-
Method Details
-
of
public static TypeDescription.Generic.Visitor.Substitutor.ForAttachment of(TypeDescription typeDescription) Attaches all types to the given type description.- Parameters:
typeDescription
- The type description to which visited types should be attached to.- Returns:
- A substitutor that attaches visited types to the given type's type context.
-
of
public static TypeDescription.Generic.Visitor.Substitutor.ForAttachment of(FieldDescription fieldDescription) Attaches all types to the given field description.- Parameters:
fieldDescription
- The field description to which visited types should be attached to.- Returns:
- A substitutor that attaches visited types to the given field's type context.
-
of
public static TypeDescription.Generic.Visitor.Substitutor.ForAttachment of(MethodDescription methodDescription) Attaches all types to the given method description.- Parameters:
methodDescription
- The method description to which visited types should be attached to.- Returns:
- A substitutor that attaches visited types to the given method's type context.
-
of
public static TypeDescription.Generic.Visitor.Substitutor.ForAttachment of(ParameterDescription parameterDescription) Attaches all types to the given parameter description.- Parameters:
parameterDescription
- The parameter description to which visited types should be attached to.- Returns:
- A substitutor that attaches visited types to the given parameter's type context.
-
of
public static TypeDescription.Generic.Visitor.Substitutor.ForAttachment of(RecordComponentDescription recordComponentDescription) Attaches all types to the given record component description.- Parameters:
recordComponentDescription
- The record component description to which visited types should be attached to.- Returns:
- A substitutor that attaches visited types to the given record component's type context.
-
onTypeVariable
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).- Parameters:
typeVariable
- The generic array type.- Returns:
- The visitor's return value.
-
onSimpleType
Description copied from class:TypeDescription.Generic.Visitor.Substitutor
Visits a simple, non-generic type, i.e. either a component type of an array or a non-array type.- Specified by:
onSimpleType
in classTypeDescription.Generic.Visitor.Substitutor
- Parameters:
typeDescription
- The type that is visited.- Returns:
- The substituted type.
-