接口 AnnotationMetadata

所有超级接口:
AnnotatedTypeMetadata, ClassMetadata
所有已知实现类:
SimpleAnnotationMetadata, 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.
从以下版本开始:
4.0
作者:
Juergen Hoeller, Mark Fisher, Phillip Webb, Sam Brannen
另请参阅:
  • 方法详细资料

    • hasAnnotatedMethods

      default boolean hasAnnotatedMethods(String annotationName)
      Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
      参数:
      annotationName - the fully qualified class name of the annotation type to look for
    • getAnnotatedMethods

      Set<MethodMetadata> getAnnotatedMethods(String annotationName)
      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.Class<? extends java.lang.annotation.Annotation>) will return true for the given annotation type.

      参数:
      annotationName - the fully qualified class name of the annotation type to look for
      返回:
      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.
    • introspect

      static AnnotationMetadata introspect(Class<?> type)
      Factory method to create a new AnnotationMetadata instance for the given class using standard reflection.
      参数:
      type - the class to introspect
      返回:
      a new AnnotationMetadata instance