接口 AnnotationMetadata
- 所有超级接口:
AnnotatedTypeMetadata
,ClassMetadata
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.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller, Mark Fisher, Phillip Webb, Sam Brannen
- 另请参阅:
StandardAnnotationMetadata
,MetadataReader.getAnnotationMetadata()
,AnnotatedTypeMetadata
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Set<MethodMetadata>
getAnnotatedMethods(String annotationName)
Retrieve the method metadata for all methods that are annotated (or meta-annotated) with the given annotation type.Set<String>
getAnnotationTypes()
Get the fully qualified class names of all annotation types that are present on the underlying class.Set<String>
getMetaAnnotationTypes(String annotationName)
Get the fully qualified class names of all meta-annotation types that are present on the given annotation type on the underlying class.boolean
hasAnnotatedMethods(String annotationName)
Determine whether the underlying class has any methods that are annotated (or meta-annotated) with the given annotation type.boolean
hasAnnotation(String annotationName)
Determine whether an annotation of the given type is present on the underlying class.boolean
hasMetaAnnotation(String metaAnnotationName)
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.从接口继承的方法 org.springframework.core.type.AnnotatedTypeMetadata
getAllAnnotationAttributes, getAllAnnotationAttributes, getAnnotationAttributes, getAnnotationAttributes, isAnnotated
从接口继承的方法 org.springframework.core.type.ClassMetadata
getClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isAnnotation, isConcrete, isFinal, isIndependent, isInterface
方法详细资料
getAnnotationTypes
Set<String> getAnnotationTypes()
Get the fully qualified class names of all annotation types that are present on the underlying class.- 返回:
- the annotation type names
getMetaAnnotationTypes
Set<String> getMetaAnnotationTypes(String annotationName)
Get the fully qualified class names of all meta-annotation types that are present on the given annotation type on the underlying class.- 参数:
annotationName
- the fully qualified class name of the meta-annotation type to look for- 返回:
- the meta-annotation type names
hasAnnotation
boolean hasAnnotation(String annotationName)
Determine whether an annotation of the given type is present on the underlying class.- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
true
if a matching annotation is present
hasMetaAnnotation
boolean hasMetaAnnotation(String metaAnnotationName)
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.- 参数:
metaAnnotationName
- the fully qualified class name of the meta-annotation type to look for- 返回:
true
if a matching meta-annotation is present
hasAnnotatedMethods
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.String)
will returntrue
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.