Interface AnnotationElement

All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ClassElement, Described, Element, MutableAnnotationMetadataDelegate<Element>, Named, TypedElement
All Known Implementing Classes:
PythonAnnotationElement

public interface AnnotationElement extends ClassElement
Represents an annotation in the AST.
Since:
3.1.0
Author:
graemerocher
See Also:
  • Method Details

    • isInherited

      default boolean isInherited()
      Is the annotation annotated with Inherited?

      Meta-annotations from the java.lang.annotation package are excluded from the annotation metadata (see AnnotationUtil.STEREOTYPE_EXCLUDES), so the answer cannot be retrieved with AnnotationMetadata.hasDeclaredAnnotation(String). Implementations backed by a native element resolve it from that element instead; the default implementation, for implementations that have no native element to inspect, always returns false.

      Returns:
      true if the annotation type is declared Inherited
      Since:
      5.2.0