类 AnnotationMetadataReadingVisitor
- java.lang.Object
- org.springframework.asm.ClassVisitor
- org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor
- 所有已实现的接口:
AnnotatedTypeMetadata
,AnnotationMetadata
,ClassMetadata
@Deprecated public class AnnotationMetadataReadingVisitor extends ClassVisitor implements AnnotationMetadata
已过时。As of Spring Framework 5.2, this class has been replaced bySimpleAnnotationMetadataReadingVisitor
for internal use within the framework, but there is no public replacement forAnnotationMetadataReadingVisitor
.ASM class visitor which looks for the class name and implemented types as well as for the annotations defined on the class, exposing them through theAnnotationMetadata
interface.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller, Mark Fisher, Costin Leau, Phillip Webb, Sam Brannen
字段概要
字段 修饰符和类型 字段 说明 protected Set<String>
annotationSet
已过时。protected LinkedMultiValueMap<String,AnnotationAttributes>
attributesMap
已过时。Declared as aLinkedMultiValueMap
instead of aMultiValueMap
to ensure that the hierarchical ordering of the entries is preserved.protected ClassLoader
classLoader
已过时。protected Map<String,Set<String>>
metaAnnotationMap
已过时。protected Set<MethodMetadata>
methodMetadataSet
已过时。从类继承的字段 org.springframework.asm.ClassVisitor
api, cv
构造器概要
构造器 构造器 说明 AnnotationMetadataReadingVisitor(ClassLoader classLoader)
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 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, 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.MergedAnnotations
getAnnotations()
已过时。Return annotation details based on the direct annotations of the underlying element.Set<String>
getAnnotationTypes()
已过时。Get the fully qualified class names of all annotation types that are present on the underlying class.String
getClassName()
已过时。Return the name of the underlying class.String
getEnclosingClassName()
已过时。Return the name of the enclosing class of the underlying class, ornull
if the underlying class is a top-level class.String[]
getInterfaceNames()
已过时。Return the names of all interfaces that the underlying class implements, or an empty array if there are none.String[]
getMemberClassNames()
已过时。Return the names of all classes declared as members of the class represented by this ClassMetadata object.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.String
getSuperClassName()
已过时。Return the name of the super class of the underlying class, ornull
if there is no super class defined.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
hasEnclosingClass()
已过时。Return whether the underlying class is declared within an enclosing class (i.e. the underlying class is an inner/nested class or a local class within a method).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
isAbstract()
已过时。Return whether the underlying class is marked as abstract.boolean
isAnnotated(String annotationName)
已过时。Determine whether the underlying element has an annotation or meta-annotation of the given type defined.boolean
isAnnotation()
已过时。Return whether the underlying class represents an annotation.boolean
isFinal()
已过时。Return whether the underlying class is marked as 'final'.boolean
isIndependent()
已过时。Determine whether the underlying class is independent, i.e. whether it is a top-level class or a nested class (static inner class) that can be constructed independently from an enclosing class.boolean
isInterface()
已过时。Return whether the underlying class represents an interface.void
visit(int version, int access, String name, String signature, String supername, String[] interfaces)
已过时。Visits the header of the class.AnnotationVisitor
visitAnnotation(String desc, boolean visible)
已过时。Visits an annotation of the class.void
visitAttribute(Attribute attr)
已过时。Visits a non standard attribute of the class.void
visitEnd()
已过时。Visits the end of the class.FieldVisitor
visitField(int access, String name, String desc, String signature, Object value)
已过时。Visits a field of the class.void
visitInnerClass(String name, String outerName, String innerName, int access)
已过时。Visits information about an inner class.MethodVisitor
visitMethod(int access, String name, String desc, String signature, String[] exceptions)
已过时。Visits a method of the class.void
visitOuterClass(String owner, String name, String desc)
已过时。Visits the enclosing class of the class.void
visitSource(String source, String debug)
已过时。Visits the source of the class.从类继承的方法 org.springframework.asm.ClassVisitor
visitModule, visitNestHost, visitNestMember, visitPermittedSubtypeExperimental, visitRecordComponentExperimental, visitTypeAnnotation
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.core.type.AnnotatedTypeMetadata
getAllAnnotationAttributes, getAnnotationAttributes
从接口继承的方法 org.springframework.core.type.ClassMetadata
getClassName, getEnclosingClassName, getInterfaceNames, getMemberClassNames, getSuperClassName, hasEnclosingClass, hasSuperClass, isAbstract, isAnnotation, isConcrete, isFinal, isIndependent, isInterface
字段详细资料
classLoader
@Nullable protected final ClassLoader classLoader
已过时。
annotationSet
protected final Set<String> annotationSet
已过时。
metaAnnotationMap
protected final Map<String,Set<String>> metaAnnotationMap
已过时。
attributesMap
protected final LinkedMultiValueMap<String,AnnotationAttributes> attributesMap
已过时。Declared as aLinkedMultiValueMap
instead of aMultiValueMap
to ensure that the hierarchical ordering of the entries is preserved.- 另请参阅:
AnnotationReadingVisitorUtils.getMergedAnnotationAttributes(org.springframework.util.LinkedMultiValueMap<java.lang.String, org.springframework.core.annotation.AnnotationAttributes>, java.util.Map<java.lang.String, java.util.Set<java.lang.String>>, java.lang.String)
methodMetadataSet
protected final Set<MethodMetadata> methodMetadataSet
已过时。
构造器详细资料
AnnotationMetadataReadingVisitor
public AnnotationMetadataReadingVisitor(@Nullable ClassLoader classLoader)
已过时。
方法详细资料
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
visitMethod
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
已过时。从类复制的说明:ClassVisitor
Visits a method of the class. This method must return a newMethodVisitor
instance (or null) each time it is called, i.e., it should not return a previously returned visitor.- 参数:
access
- the method's access flags (seeOpcodes
). This parameter also indicates if the method is synthetic and/or deprecated.name
- the method's name.desc
- the method's descriptor (seeType
).signature
- the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.exceptions
- the internal names of the method's exception classes (seeType.getInternalName()
). May be null.- 返回:
- an object to visit the byte code of the method, or null if this class visitor is not interested in visiting the code of this method.
visitAnnotation
@Nullable public AnnotationVisitor visitAnnotation(String desc, boolean visible)
已过时。从类复制的说明:ClassVisitor
Visits an annotation of the class.- 参数:
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.- 返回:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
getAnnotationTypes
public Set<String> getAnnotationTypes()
已过时。从接口复制的说明:AnnotationMetadata
Get the fully qualified class names of all annotation types that are present on the underlying class.- 指定者:
getAnnotationTypes
在接口中AnnotationMetadata
- 返回:
- the annotation type names
getMetaAnnotationTypes
public Set<String> getMetaAnnotationTypes(String annotationName)
已过时。从接口复制的说明:AnnotationMetadata
Get the fully qualified class names of all meta-annotation types that are present on the given annotation type on the underlying class.- 指定者:
getMetaAnnotationTypes
在接口中AnnotationMetadata
- 参数:
annotationName
- the fully qualified class name of the meta-annotation type to look for- 返回:
- the meta-annotation type names, or an empty set if none found
hasMetaAnnotation
public boolean hasMetaAnnotation(String metaAnnotationType)
已过时。从接口复制的说明:AnnotationMetadata
Determine whether the underlying class has an annotation that is itself annotated with the meta-annotation of the given type.- 指定者:
hasMetaAnnotation
在接口中AnnotationMetadata
- 参数:
metaAnnotationType
- the fully qualified class name of the meta-annotation type to look for- 返回:
true
if a matching meta-annotation is present
isAnnotated
public boolean isAnnotated(String annotationName)
已过时。从接口复制的说明:AnnotatedTypeMetadata
Determine whether the underlying element has an annotation or meta-annotation of the given type defined.If this method returns
true
, thenAnnotatedTypeMetadata.getAnnotationAttributes(java.lang.String)
will return a non-null Map.- 指定者:
isAnnotated
在接口中AnnotatedTypeMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
- whether a matching annotation is defined
hasAnnotation
public boolean hasAnnotation(String annotationName)
已过时。从接口复制的说明:AnnotationMetadata
Determine whether an annotation of the given type is present on the underlying class.- 指定者:
hasAnnotation
在接口中AnnotationMetadata
- 参数:
annotationName
- the fully qualified class name of the annotation type to look for- 返回:
true
if a matching annotation is present
getAnnotationAttributes
@Nullable public AnnotationAttributes 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 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 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 forclassValuesAsString
- 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. - 另请参阅:
AnnotatedTypeMetadata.getAllAnnotationAttributes(String)
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 returntrue
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.
visit
public void visit(int version, int access, String name, String signature, @Nullable String supername, String[] interfaces)
已过时。从类复制的说明:ClassVisitor
Visits the header of the class.- 覆盖:
visit
在类中ClassVisitor
- 参数:
version
- the class version. The minor version is stored in the 16 most significant bits, and the major version in the 16 least significant bits.access
- the class's access flags (seeOpcodes
). This parameter also indicates if the class is deprecated.name
- the internal name of the class (seeType.getInternalName()
).signature
- the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces.supername
- the internal of name of the super class (seeType.getInternalName()
). For interfaces, the super class isObject
. May be null, but only for theObject
class.interfaces
- the internal names of the class's interfaces (seeType.getInternalName()
). May be null.
visitOuterClass
public void visitOuterClass(String owner, String name, String desc)
已过时。从类复制的说明:ClassVisitor
Visits the enclosing class of the class. This method must be called only if the class has an enclosing class.- 覆盖:
visitOuterClass
在类中ClassVisitor
- 参数:
owner
- internal name of the enclosing class of the class.name
- the name of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.desc
- the descriptor of the method that contains the class, or null if the class is not enclosed in a method of its enclosing class.
visitInnerClass
public void visitInnerClass(String name, @Nullable String outerName, String innerName, int access)
已过时。从类复制的说明:ClassVisitor
Visits information about an inner class. This inner class is not necessarily a member of the class being visited.- 覆盖:
visitInnerClass
在类中ClassVisitor
- 参数:
name
- the internal name of an inner class (seeType.getInternalName()
).outerName
- the internal name of the class to which the inner class belongs (seeType.getInternalName()
). May be null for not member classes.innerName
- the (simple) name of the inner class inside its enclosing class. May be null for anonymous inner classes.access
- the access flags of the inner class as originally declared in the enclosing class.
visitSource
public void visitSource(String source, String debug)
已过时。从类复制的说明:ClassVisitor
Visits the source of the class.- 覆盖:
visitSource
在类中ClassVisitor
- 参数:
source
- the name of the source file from which the class was compiled. May be null.debug
- additional debug information to compute the correspondence between source and compiled elements of the class. May be null.
visitAttribute
public void visitAttribute(Attribute attr)
已过时。从类复制的说明:ClassVisitor
Visits a non standard attribute of the class.- 覆盖:
visitAttribute
在类中ClassVisitor
- 参数:
attr
- an attribute.
visitField
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
已过时。从类复制的说明:ClassVisitor
Visits a field of the class.- 覆盖:
visitField
在类中ClassVisitor
- 参数:
access
- the field's access flags (seeOpcodes
). This parameter also indicates if the field is synthetic and/or deprecated.name
- the field's name.desc
- the field's descriptor (seeType
).signature
- the field's signature. May be null if the field's type does not use generic types.value
- the field's initial value. This parameter, which may be null if the field does not have an initial value, must be anInteger
, aFloat
, aLong
, aDouble
or aString
(forint
,float
,long
orString
fields respectively). This parameter is only used for static fields. Its value is ignored for non static fields, which must be initialized through bytecode instructions in constructors or methods.- 返回:
- a visitor to visit field annotations and attributes, or null if this class visitor is not interested in visiting these annotations and attributes.
visitEnd
public void visitEnd()
已过时。从类复制的说明:ClassVisitor
Visits the end of the class. This method, which is the last one to be called, is used to inform the visitor that all the fields and methods of the class have been visited.- 覆盖:
visitEnd
在类中ClassVisitor
getClassName
public String getClassName()
已过时。从接口复制的说明:ClassMetadata
Return the name of the underlying class.- 指定者:
getClassName
在接口中ClassMetadata
isInterface
public boolean isInterface()
已过时。从接口复制的说明:ClassMetadata
Return whether the underlying class represents an interface.- 指定者:
isInterface
在接口中ClassMetadata
isAnnotation
public boolean isAnnotation()
已过时。从接口复制的说明:ClassMetadata
Return whether the underlying class represents an annotation.- 指定者:
isAnnotation
在接口中ClassMetadata
isAbstract
public boolean isAbstract()
已过时。从接口复制的说明:ClassMetadata
Return whether the underlying class is marked as abstract.- 指定者:
isAbstract
在接口中ClassMetadata
isFinal
public boolean isFinal()
已过时。从接口复制的说明:ClassMetadata
Return whether the underlying class is marked as 'final'.- 指定者:
isFinal
在接口中ClassMetadata
isIndependent
public boolean isIndependent()
已过时。从接口复制的说明:ClassMetadata
Determine whether the underlying class is independent, i.e. whether it is a top-level class or a nested class (static inner class) that can be constructed independently from an enclosing class.- 指定者:
isIndependent
在接口中ClassMetadata
hasEnclosingClass
public boolean hasEnclosingClass()
已过时。从接口复制的说明:ClassMetadata
Return whether the underlying class is declared within an enclosing class (i.e. the underlying class is an inner/nested class or a local class within a method).If this method returns
false
, then the underlying class is a top-level class.- 指定者:
hasEnclosingClass
在接口中ClassMetadata
getEnclosingClassName
@Nullable public String getEnclosingClassName()
已过时。从接口复制的说明:ClassMetadata
Return the name of the enclosing class of the underlying class, ornull
if the underlying class is a top-level class.- 指定者:
getEnclosingClassName
在接口中ClassMetadata
getSuperClassName
@Nullable public String getSuperClassName()
已过时。从接口复制的说明:ClassMetadata
Return the name of the super class of the underlying class, ornull
if there is no super class defined.- 指定者:
getSuperClassName
在接口中ClassMetadata
getInterfaceNames
public String[] getInterfaceNames()
已过时。从接口复制的说明:ClassMetadata
Return the names of all interfaces that the underlying class implements, or an empty array if there are none.- 指定者:
getInterfaceNames
在接口中ClassMetadata
getMemberClassNames
public String[] getMemberClassNames()
已过时。从接口复制的说明:ClassMetadata
Return the names of all classes declared as members of the class represented by this ClassMetadata object. This includes public, protected, default (package) access, and private classes and interfaces declared by the class, but excludes inherited classes and interfaces. An empty array is returned if no member classes or interfaces exist.- 指定者:
getMemberClassNames
在接口中ClassMetadata