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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Specifies the kind of object a target represents.
  • Method Summary

    Modifier and Type
    Method
    Description
    Casts and returns this target as a ClassInfo if it is of kind CLASS
    Casts and returns this target as a FieldInfo if it is of kind FIELD
    Casts and returns this target as a MethodInfo if it is of kind METHOD
    Casts and returns this target as a MethodParameterInfo if it is of kind METHOD_PARAMETER
    Casts and returns this target as a RecordComponentInfo if it is of kind RECORD_COMPONENT
    Casts and returns this target as a TypeTarget if it is of kind TYPE
    Returns the kind of object this target represents.
  • Method Details

    • 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 a ClassInfo if it is of kind CLASS
      Returns:
      this instance cast to a class
      Since:
      2.0
    • asField

      FieldInfo asField()
      Casts and returns this target as a FieldInfo if it is of kind FIELD
      Returns:
      this instance cast to a field
      Since:
      2.0
    • asMethod

      MethodInfo asMethod()
      Casts and returns this target as a MethodInfo if it is of kind METHOD
      Returns:
      this instance cast to a method
      Since:
      2.0
    • asMethodParameter

      MethodParameterInfo asMethodParameter()
      Casts and returns this target as a MethodParameterInfo if it is of kind METHOD_PARAMETER
      Returns:
      this instance cast to a method parameter
      Since:
      2.0
    • asType

      TypeTarget asType()
      Casts and returns this target as a TypeTarget if it is of kind TYPE
      Returns:
      this instance cast to a type target
      Since:
      2.0
    • asRecordComponent

      RecordComponentInfo asRecordComponent()
      Casts and returns this target as a RecordComponentInfo if it is of kind RECORD_COMPONENT
      Returns:
      this instance cast to a record component
      Since:
      2.4