类 StandardAnnotationMetadata

java.lang.Object
cn.taketoday.core.type.StandardClassMetadata
cn.taketoday.core.type.StandardAnnotationMetadata
所有已实现的接口:
AnnotatedTypeMetadata, AnnotationMetadata, ClassMetadata

public class StandardAnnotationMetadata extends StandardClassMetadata implements AnnotationMetadata
AnnotationMetadata implementation that uses standard reflection to introspect a given Class.
从以下版本开始:
4.0
作者:
Juergen Hoeller, Mark Fisher, Chris Beams, Phillip Webb, Sam Brannen
  • 构造器详细资料

    • StandardAnnotationMetadata

      public StandardAnnotationMetadata(Class<?> introspectedClass)
      Create a new StandardAnnotationMetadata wrapper for the given Class.
      参数:
      introspectedClass - the Class to introspect
      另请参阅:
    • StandardAnnotationMetadata

      public StandardAnnotationMetadata(Class<?> introspectedClass, boolean nestedAnnotationsAsMap)
      Create a new StandardAnnotationMetadata wrapper for the given Class, providing the option to return any nested annotations or annotation arrays in the form of AnnotationAttributes instead of actual Annotation instances.
      参数:
      introspectedClass - the Class to introspect
      nestedAnnotationsAsMap - return nested annotations and annotation arrays as AnnotationAttributes for compatibility with ASM-based AnnotationMetadata implementations
  • 方法详细资料

    • getAnnotations

      public MergedAnnotations getAnnotations()
      从接口复制的说明: AnnotatedTypeMetadata
      Return annotation details based on the direct annotations of the underlying element.
      指定者:
      getAnnotations 在接口中 AnnotatedTypeMetadata
      返回:
      merged annotations based on the direct annotations
    • getAnnotationTypes

      public Set<String> getAnnotationTypes()
      从接口复制的说明: AnnotatedTypeMetadata
      Get the fully qualified class names of all annotation types that are present on the underlying class.
      指定者:
      getAnnotationTypes 在接口中 AnnotatedTypeMetadata
      返回:
      the annotation type names
    • getAnnotationAttributes

      @Nullable public Map<String,Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString)
      从接口复制的说明: AnnotatedTypeMetadata
      Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.
      指定者:
      getAnnotationAttributes 在接口中 AnnotatedTypeMetadata
      参数:
      annotationName - the fully qualified class name of the annotation type to look for
      classValuesAsString - whether to convert class references to String class names for exposure as values in the returned Map, instead of Class references which might potentially have to be loaded first
      返回:
      a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.
    • getAllAnnotationAttributes

      @Nullable public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
      从接口复制的说明: AnnotatedTypeMetadata
      Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation). Note that this variant does not take attribute overrides into account.
      指定者:
      getAllAnnotationAttributes 在接口中 AnnotatedTypeMetadata
      参数:
      annotationName - the fully qualified class name of the annotation type to look for
      classValuesAsString - whether to convert class references to String
      返回:
      a MultiMap of attributes, with the attribute name as key (e.g. "value") and a list of the defined attribute values as Map value. This return value will be null if no matching annotation is defined.
      另请参阅:
    • hasAnnotatedMethods

      public boolean hasAnnotatedMethods(String annotationName)
      从接口复制的说明: AnnotationMetadata
      Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.
      指定者:
      hasAnnotatedMethods 在接口中 AnnotationMetadata
      参数:
      annotationName - the fully qualified class name of the annotation type to look for
    • getAnnotatedMethods

      public Set<MethodMetadata> getAnnotatedMethods(String annotationName)
      从接口复制的说明: AnnotationMetadata
      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.

      指定者:
      getAnnotatedMethods 在接口中 AnnotationMetadata
      参数:
      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.
    • mapMethod

      protected MethodMetadata mapMethod(Method method)
      覆盖:
      mapMethod 在类中 StandardClassMetadata