public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisitor implements AnnotationMetadata
org.springframework.core.type.AnnotationMetadata interface.| 限定符和类型 | 字段和说明 |
|---|---|
protected Set<String> |
annotationSet |
protected LinkedMultiValueMap<String,AnnotationAttributes> |
attributesMap
Declared as a
LinkedMultiValueMap instead of a MultiValueMap
to ensure that the hierarchical ordering of the entries is preserved. |
protected ClassLoader |
classLoader |
protected Map<String,Set<String>> |
metaAnnotationMap |
protected Set<MethodMetadata> |
methodMetadataSet |
| 构造器和说明 |
|---|
AnnotationMetadataReadingVisitor(ClassLoader classLoader) |
| 限定符和类型 | 方法和说明 |
|---|---|
MultiValueMap<String,Object> |
getAllAnnotationAttributes(String annotationName)
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).
|
MultiValueMap<String,Object> |
getAllAnnotationAttributes(String annotationName,
boolean classValuesAsString)
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).
|
Set<MethodMetadata> |
getAnnotatedMethods(String annotationName)
Retrieve the method metadata for all methods that are annotated
(or meta-annotated) with the given annotation type.
|
AnnotationAttributes |
getAnnotationAttributes(String annotationName)
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.
|
AnnotationAttributes |
getAnnotationAttributes(String annotationName,
boolean classValuesAsString)
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.
|
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 metaAnnotationType)
Determine whether the underlying class has an annotation that is itself
annotated with the meta-annotation of the given type.
|
boolean |
isAnnotated(String annotationName)
Determine whether the underlying element has an annotation or meta-annotation
of the given type defined.
|
org.objectweb.asm.AnnotationVisitor |
visitAnnotation(String desc,
boolean visible) |
org.objectweb.asm.MethodVisitor |
visitMethod(int access,
String name,
String desc,
String signature,
String[] exceptions) |
getClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isAnnotation, isConcrete, isFinal, isIndependent, isInterface, visit, visitAttribute, visitEnd, visitField, visitInnerClass, visitOuterClass, visitSourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isAnnotation, isConcrete, isFinal, isIndependent, isInterfaceprotected final ClassLoader classLoader
protected final LinkedMultiValueMap<String,AnnotationAttributes> attributesMap
LinkedMultiValueMap instead of a MultiValueMap
to ensure that the hierarchical ordering of the entries is preserved.protected final Set<MethodMetadata> methodMetadataSet
public AnnotationMetadataReadingVisitor(ClassLoader classLoader)
public org.objectweb.asm.MethodVisitor visitMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
public org.objectweb.asm.AnnotationVisitor visitAnnotation(String desc, boolean visible)
public Set<String> getAnnotationTypes()
AnnotationMetadatagetAnnotationTypes 在接口中 AnnotationMetadatapublic Set<String> getMetaAnnotationTypes(String annotationName)
AnnotationMetadatagetMetaAnnotationTypes 在接口中 AnnotationMetadataannotationName - the fully qualified class name of the meta-annotation
type to look forpublic boolean hasAnnotation(String annotationName)
AnnotationMetadatahasAnnotation 在接口中 AnnotationMetadataannotationName - the fully qualified class name of the annotation
type to look fortrue if a matching annotation is presentpublic boolean hasMetaAnnotation(String metaAnnotationType)
AnnotationMetadatahasMetaAnnotation 在接口中 AnnotationMetadatametaAnnotationType - the fully qualified class name of the
meta-annotation type to look fortrue if a matching meta-annotation is presentpublic boolean isAnnotated(String annotationName)
AnnotatedTypeMetadataIf this method returns true, then
AnnotatedTypeMetadata.getAnnotationAttributes(java.lang.String) will return a non-null Map.
isAnnotated 在接口中 AnnotatedTypeMetadataannotationName - the fully qualified class name of the annotation
type to look forpublic AnnotationAttributes getAnnotationAttributes(String annotationName)
AnnotatedTypeMetadatagetAnnotationAttributes 在接口中 AnnotatedTypeMetadataannotationName - the fully qualified class name of the annotation
type to look fornull if no matching annotation is defined.public AnnotationAttributes getAnnotationAttributes(String annotationName, boolean classValuesAsString)
AnnotatedTypeMetadatagetAnnotationAttributes 在接口中 AnnotatedTypeMetadataannotationName - the fully qualified class name of the annotation
type to look forclassValuesAsString - 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 firstnull if no matching annotation is defined.public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName)
AnnotatedTypeMetadatagetAllAnnotationAttributes 在接口中 AnnotatedTypeMetadataannotationName - the fully qualified class name of the annotation
type to look fornull if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
AnnotatedTypeMetadatagetAllAnnotationAttributes 在接口中 AnnotatedTypeMetadataannotationName - the fully qualified class name of the annotation
type to look forclassValuesAsString - whether to convert class references to Stringnull if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String)public boolean hasAnnotatedMethods(String annotationName)
AnnotationMetadatahasAnnotatedMethods 在接口中 AnnotationMetadataannotationName - the fully qualified class name of the annotation
type to look forpublic Set<MethodMetadata> getAnnotatedMethods(String annotationName)
AnnotationMetadataFor any returned method, AnnotatedTypeMetadata.isAnnotated(java.lang.String) will
return true for the given annotation type.
getAnnotatedMethods 在接口中 AnnotationMetadataannotationName - the fully qualified class name of the annotation
type to look forMethodMetadata for methods that have a matching
annotation. The return value will be an empty set if no methods match
the annotation type.Copyright © 2020. All rights reserved.