Package net.bytebuddy.description.type
Class TypeDescription.Generic.Visitor.Substitutor.ForDetachment
- java.lang.Object
-
- net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor
-
- net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Substitutor.ForDetachment
-
- All Implemented Interfaces:
TypeDescription.Generic.Visitor<TypeDescription.Generic>
- Enclosing class:
- TypeDescription.Generic.Visitor.Substitutor
@Enhance public static class TypeDescription.Generic.Visitor.Substitutor.ForDetachment extends TypeDescription.Generic.Visitor.Substitutor
A visitor for detaching a type from its declaration context by detaching type variables. This is achieved by detaching type variables and by replacing the declaring type which is identified by a providedElementMatcher
withTargetType
.
-
-
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
-
-
Field Summary
Fields Modifier and Type Field Description private ElementMatcher<? super TypeDescription>
typeMatcher
A type matcher for identifying the declaring type.
-
Constructor Summary
Constructors Constructor Description ForDetachment(ElementMatcher<? super TypeDescription> typeMatcher)
Creates a visitor for detaching a type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeDescription.Generic.Visitor<TypeDescription.Generic>
of(TypeDefinition typeDefinition)
Returns a new detachment visitor that detaches any type matching the supplied type description.protected TypeDescription.Generic
onSimpleType(TypeDescription.Generic typeDescription)
Visits a simple, non-generic type, i.e.TypeDescription.Generic
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 Detail
-
typeMatcher
private final ElementMatcher<? super TypeDescription> typeMatcher
A type matcher for identifying the declaring type.
-
-
Constructor Detail
-
ForDetachment
public ForDetachment(ElementMatcher<? super TypeDescription> typeMatcher)
Creates a visitor for detaching a type.- Parameters:
typeMatcher
- A type matcher for identifying the declaring type.
-
-
Method Detail
-
of
public static TypeDescription.Generic.Visitor<TypeDescription.Generic> of(TypeDefinition typeDefinition)
Returns a new detachment visitor that detaches any type matching the supplied type description.- Parameters:
typeDefinition
- The type to detach.- Returns:
- A detachment visitor for the supplied type description.
-
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.
-
-