Interface CanBeAnnotated

All Known Subinterfaces:
HasAnnotations<SELF>
All Known Implementing Classes:
AccessTarget, AccessTarget.CodeUnitAccessTarget, AccessTarget.CodeUnitCallTarget, AccessTarget.CodeUnitReferenceTarget, AccessTarget.ConstructorCallTarget, AccessTarget.ConstructorReferenceTarget, AccessTarget.FieldAccessTarget, AccessTarget.MethodCallTarget, AccessTarget.MethodReferenceTarget, JavaClass, JavaCodeUnit, JavaConstructor, JavaField, JavaMember, JavaMethod, JavaPackage, JavaParameter, JavaStaticInitializer

@PublicAPI(usage=ACCESS) public interface CanBeAnnotated
  • Method Details

    • isAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isAnnotatedWith(Class<? extends Annotation> annotationType)
      Returns true, if this element is annotated with the given annotation type.
      Parameters:
      annotationType - The type of the annotation to check for
    • isAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isAnnotatedWith(String annotationTypeName)
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      See Also:
    • isAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate)
      Returns true, if this element is annotated with an annotation matching the given predicate.
      Parameters:
      predicate - Qualifies matching annotations
    • isMetaAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isMetaAnnotatedWith(Class<? extends Annotation> annotationType)
      Returns true, if this element is meta-annotated with the given annotation type. A meta-annotation is an annotation that is declared on another annotation.

      This method also returns true if this element is directly annotated with the given annotation type.

      Parameters:
      annotationType - The type of the annotation to check for
    • isMetaAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isMetaAnnotatedWith(String annotationTypeName)
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      See Also:
    • isMetaAnnotatedWith

      @PublicAPI(usage=ACCESS) boolean isMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate)
      Returns true, if this element is meta-annotated with an annotation matching the given predicate. A meta-annotation is an annotation that is declared on another annotation.

      This method also returns true if this element is directly annotated with an annotation matching the given predicate.

      Parameters:
      predicate - Qualifies matching annotations