org.springframework.core.type

## Interface AnnotationMetadata

- All Superinterfaces:
    AnnotatedTypeMetadata, ClassMetadata
  All Known Implementing Classes:
    AnnotationMetadataReadingVisitor, StandardAnnotationMetadata

      public interface AnnotationMetadata
      extends ClassMetadata, AnnotatedTypeMetadata

  Interface that defines abstract access to the annotations of a specific class, in a form that does not require that class to be loaded yet.
  Since:
    2.5
  Author:
    Juergen Hoeller, Mark Fisher, Phillip Webb, Sam Brannen
  See Also:
    `StandardAnnotationMetadata`, `MetadataReader.getAnnotationMetadata()`, `AnnotatedTypeMetadata`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<MethodMetadata>` | `getAnnotatedMethods(String annotationType)` Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.
    `Set<String>` | `getAnnotationTypes()` Return the names of all annotation types that are present on the underlying class.
    `Set<String>` | `getMetaAnnotationTypes(String annotationType)` Return the names of all meta-annotation types present on the given annotation type on the underlying class.
    `boolean` | `hasAnnotatedMethods(String annotationType)` Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
    `boolean` | `hasAnnotation(String annotationType)` Determine whether an annotation of the given type is present on the underlying class.
    `boolean` | `hasMetaAnnotation(String metaAnnotationType)` Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.

    - ### Methods inherited from interface org.springframework.core.type.ClassMetadata

      `getClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isConcrete, isFinal, isIndependent, isInterface`

    - ### Methods inherited from interface org.springframework.core.type.AnnotatedTypeMetadata

      `getAllAnnotationAttributes, getAllAnnotationAttributes, getAnnotationAttributes, getAnnotationAttributes, isAnnotated`

- - ### Method Detail

    - #### getAnnotationTypes

          Set<String> getAnnotationTypes()

      Return the names of all annotation types that are present on the underlying class.
      Returns:
        the annotation type names

    - #### getMetaAnnotationTypes

          Set<String> getMetaAnnotationTypes(String annotationType)

      Return the names of all meta-annotation types present on the given annotation type on the underlying class.
      Parameters:
        `annotationType` - the meta-annotation type to look for
      Returns:
        the meta-annotation type names

    - #### hasAnnotation

          boolean hasAnnotation(String annotationType)

      Determine whether an annotation of the given type is present on the underlying class.
      Parameters:
        `annotationType` - the annotation type to look for
      Returns:
        whether a matching annotation is present

    - #### hasMetaAnnotation

          boolean hasMetaAnnotation(String metaAnnotationType)

      Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.
      Parameters:
        `metaAnnotationType` - the meta-annotation type to look for
      Returns:
        whether a matching meta-annotation is present

    - #### hasAnnotatedMethods

          boolean hasAnnotatedMethods(String annotationType)

      Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.

    - #### getAnnotatedMethods

          Set<MethodMetadata> getAnnotatedMethods(String annotationType)

      Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.

      For any returned method, `AnnotatedTypeMetadata.isAnnotated(java.lang.String)` will return `true` for the given annotation type.

      Parameters:
        `annotationType` - the annotation type to look for
      Returns:
        a set of `MethodMetadata` for methods that have a matching annotation. The return value will be an empty set if no methods match the annotation type.