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 ofTargetType
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.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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
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
-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor
onGenericArray, onNonGenericType, onParameterizedType, onWildcard
-
-
-
-
Constructor Detail
-
ForAttachment
protected ForAttachment(TypeDefinition declaringType, TypeVariableSource typeVariableSource)
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
protected ForAttachment(TypeDescription declaringType, TypeVariableSource typeVariableSource)
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 Detail
-
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
public TypeDescription.Generic onTypeVariable(TypeDescription.Generic typeVariable)
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).- Parameters:
typeVariable
- The generic array type.- Returns:
- The visitor's return value.
-
onSimpleType
protected TypeDescription.Generic onSimpleType(TypeDescription.Generic typeDescription)
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.
-
-