Class AnnotationAppender.ForTypeAnnotations
- java.lang.Object
-
- net.bytebuddy.implementation.attribute.AnnotationAppender.ForTypeAnnotations
-
- All Implemented Interfaces:
TypeDescription.Generic.Visitor<AnnotationAppender>
- Enclosing interface:
- AnnotationAppender
public static class AnnotationAppender.ForTypeAnnotations extends java.lang.Object implements TypeDescription.Generic.Visitor<AnnotationAppender>
A type visitor that visits all type annotations of a generic type and writes any discovered annotation to a suppliedAnnotationAppender
.
-
-
Nested Class Summary
-
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 static boolean
VARIABLE_ON_INVOKEABLE
Indicates that type variables type annotations are written on a Java method or constructor.static boolean
VARIABLE_ON_TYPE
Indicates that type variables type annotations are written on a Java type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForTypeAnnotations(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int typeReference, java.lang.String typePath)
Creates a new type annotation appending visitor.protected
ForTypeAnnotations(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, org.objectweb.asm.TypeReference typeReference)
Creates a new type annotation appending visitor for an empty type path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeDescription.Generic.Visitor<AnnotationAppender>
ofExceptionType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of a method's exception type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofFieldType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a field's type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofInterfaceType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of an interface type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofMethodParameterType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of a method's parameter type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofMethodReturnType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a method's return type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofReceiverType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a method's receiver type.static TypeDescription.Generic.Visitor<AnnotationAppender>
ofSuperClass(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for a type annotations of a super class type.static AnnotationAppender
ofTypeVariable(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, boolean variableOnType, int subListIndex, java.util.List<? extends TypeDescription.Generic> typeVariables)
Appends all supplied type variables to the supplied method appender.static AnnotationAppender
ofTypeVariable(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, boolean variableOnType, java.util.List<? extends TypeDescription.Generic> typeVariables)
Appends all supplied type variables to the supplied method appender.AnnotationAppender
onGenericArray(TypeDescription.Generic genericArray)
Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY
).AnnotationAppender
onNonGenericType(TypeDescription.Generic typeDescription)
Visits a non-generic type (TypeDefinition.Sort.NON_GENERIC
).AnnotationAppender
onParameterizedType(TypeDescription.Generic parameterizedType)
Visits a parameterized type (TypeDefinition.Sort.PARAMETERIZED
).AnnotationAppender
onTypeVariable(TypeDescription.Generic typeVariable)
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).AnnotationAppender
onWildcard(TypeDescription.Generic wildcard)
Visits a wildcard (TypeDefinition.Sort.WILDCARD
).
-
-
-
Field Detail
-
VARIABLE_ON_TYPE
public static final boolean VARIABLE_ON_TYPE
Indicates that type variables type annotations are written on a Java type.- See Also:
- Constant Field Values
-
VARIABLE_ON_INVOKEABLE
public static final boolean VARIABLE_ON_INVOKEABLE
Indicates that type variables type annotations are written on a Java method or constructor.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ForTypeAnnotations
protected ForTypeAnnotations(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, org.objectweb.asm.TypeReference typeReference)
Creates a new type annotation appending visitor for an empty type path.- Parameters:
annotationAppender
- The annotation appender to use.annotationValueFilter
- The annotation value filter to use.typeReference
- The type reference to use.
-
ForTypeAnnotations
protected ForTypeAnnotations(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int typeReference, java.lang.String typePath)
Creates a new type annotation appending visitor.- Parameters:
annotationAppender
- The annotation appender to use.annotationValueFilter
- The annotation value filter to use.typeReference
- The type reference to use.typePath
- The type path to use.
-
-
Method Detail
-
ofSuperClass
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofSuperClass(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for a type annotations of a super class type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.- Returns:
- A visitor for appending type annotations of a super class.
-
ofInterfaceType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofInterfaceType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of an interface type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.index
- The index of the interface type.- Returns:
- A visitor for appending type annotations of an interface type.
-
ofFieldType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofFieldType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a field's type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.- Returns:
- A visitor for appending type annotations of a field's type.
-
ofMethodReturnType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofMethodReturnType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a method's return type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.- Returns:
- A visitor for appending type annotations of a method's return type.
-
ofMethodParameterType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofMethodParameterType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of a method's parameter type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.index
- The parameter index.- Returns:
- A visitor for appending type annotations of a method's parameter type.
-
ofExceptionType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofExceptionType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, int index)
Creates a type annotation appender for type annotations of a method's exception type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.index
- The exception type's index.- Returns:
- A visitor for appending type annotations of a method's exception type.
-
ofReceiverType
public static TypeDescription.Generic.Visitor<AnnotationAppender> ofReceiverType(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter)
Creates a type annotation appender for type annotations of a method's receiver type.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.- Returns:
- A visitor for appending type annotations of a method's receiver type.
-
ofTypeVariable
public static AnnotationAppender ofTypeVariable(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, boolean variableOnType, java.util.List<? extends TypeDescription.Generic> typeVariables)
Appends all supplied type variables to the supplied method appender.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.variableOnType
-true
if the type variables are declared by a type,false
if they are declared by a method.typeVariables
- The type variables to append.- Returns:
- The resulting annotation appender.
-
ofTypeVariable
public static AnnotationAppender ofTypeVariable(AnnotationAppender annotationAppender, AnnotationValueFilter annotationValueFilter, boolean variableOnType, int subListIndex, java.util.List<? extends TypeDescription.Generic> typeVariables)
Appends all supplied type variables to the supplied method appender.- Parameters:
annotationAppender
- The annotation appender to write any type annotation to.annotationValueFilter
- The annotation value filter to apply.variableOnType
-true
if the type variables are declared by a type,false
if they are declared by a method.subListIndex
- The index of the first type variable to append. All previous type variables are ignored.typeVariables
- The type variables to append.- Returns:
- The resulting annotation appender.
-
onGenericArray
public AnnotationAppender onGenericArray(TypeDescription.Generic genericArray)
Description copied from interface:TypeDescription.Generic.Visitor
Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY
).- Specified by:
onGenericArray
in interfaceTypeDescription.Generic.Visitor<AnnotationAppender>
- Parameters:
genericArray
- The generic array type.- Returns:
- The visitor's return value.
-
onWildcard
public AnnotationAppender onWildcard(TypeDescription.Generic wildcard)
Description copied from interface:TypeDescription.Generic.Visitor
Visits a wildcard (TypeDefinition.Sort.WILDCARD
).- Specified by:
onWildcard
in interfaceTypeDescription.Generic.Visitor<AnnotationAppender>
- Parameters:
wildcard
- The wildcard.- Returns:
- The visitor's return value.
-
onParameterizedType
public AnnotationAppender onParameterizedType(TypeDescription.Generic parameterizedType)
Description copied from interface:TypeDescription.Generic.Visitor
Visits a parameterized type (TypeDefinition.Sort.PARAMETERIZED
).- Specified by:
onParameterizedType
in interfaceTypeDescription.Generic.Visitor<AnnotationAppender>
- Parameters:
parameterizedType
- The generic array type.- Returns:
- The visitor's return value.
-
onTypeVariable
public AnnotationAppender onTypeVariable(TypeDescription.Generic typeVariable)
Description copied from interface:TypeDescription.Generic.Visitor
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).- Specified by:
onTypeVariable
in interfaceTypeDescription.Generic.Visitor<AnnotationAppender>
- Parameters:
typeVariable
- The generic array type.- Returns:
- The visitor's return value.
-
onNonGenericType
public AnnotationAppender onNonGenericType(TypeDescription.Generic typeDescription)
Description copied from interface:TypeDescription.Generic.Visitor
Visits a non-generic type (TypeDefinition.Sort.NON_GENERIC
).- Specified by:
onNonGenericType
in interfaceTypeDescription.Generic.Visitor<AnnotationAppender>
- Parameters:
typeDescription
- The non-generic type.- Returns:
- The visitor's return value.
-
-