Package org.jboss.jandex
Interface AnnotationTarget
- All Known Implementing Classes:
ClassExtendsTypeTarget
,ClassInfo
,EmptyTypeTarget
,FieldInfo
,MethodInfo
,MethodParameterInfo
,MethodParameterTypeTarget
,PositionBasedTypeTarget
,RecordComponentInfo
,ThrowsTypeTarget
,TypeParameterBoundTypeTarget
,TypeParameterTypeTarget
,TypeTarget
public interface AnnotationTarget
Represents an object that can be a target of an annotation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Specifies the kind of object a target represents. -
Method Summary
Modifier and TypeMethodDescriptionasClass()
Casts and returns this target as aClassInfo
if it is of kindCLASS
asField()
Casts and returns this target as aFieldInfo
if it is of kindFIELD
asMethod()
Casts and returns this target as aMethodInfo
if it is of kindMETHOD
Casts and returns this target as aMethodParameterInfo
if it is of kindMETHOD_PARAMETER
Casts and returns this target as aRecordComponentInfo
if it is of kindRECORD_COMPONENT
asType()
Casts and returns this target as aTypeTarget
if it is of kindTYPE
kind()
Returns the kind of object this target represents.
-
Method Details
-
kind
AnnotationTarget.Kind kind()Returns the kind of object this target represents.- Returns:
- the target kind.
- Since:
- 2.0
-
asClass
ClassInfo asClass()Casts and returns this target as aClassInfo
if it is of kindCLASS
- Returns:
- this instance cast to a class
- Since:
- 2.0
-
asField
FieldInfo asField()Casts and returns this target as aFieldInfo
if it is of kindFIELD
- Returns:
- this instance cast to a field
- Since:
- 2.0
-
asMethod
MethodInfo asMethod()Casts and returns this target as aMethodInfo
if it is of kindMETHOD
- Returns:
- this instance cast to a method
- Since:
- 2.0
-
asMethodParameter
MethodParameterInfo asMethodParameter()Casts and returns this target as aMethodParameterInfo
if it is of kindMETHOD_PARAMETER
- Returns:
- this instance cast to a method parameter
- Since:
- 2.0
-
asType
TypeTarget asType()Casts and returns this target as aTypeTarget
if it is of kindTYPE
- Returns:
- this instance cast to a type target
- Since:
- 2.0
-
asRecordComponent
RecordComponentInfo asRecordComponent()Casts and returns this target as aRecordComponentInfo
if it is of kindRECORD_COMPONENT
- Returns:
- this instance cast to a record component
- Since:
- 2.4
-