Class MethodMetadataReadingVisitor
- java.lang.Object
- org.springframework.asm.MethodVisitor
- org.springframework.core.type.classreading.MethodMetadataReadingVisitor
- All Implemented Interfaces:
AnnotatedTypeMetadata
,MethodMetadata
@Deprecated public class MethodMetadataReadingVisitor extends MethodVisitor implements MethodMetadata
Deprecated.As of Spring Framework 5.2, this class and related classes in this package have been replaced bySimpleAnnotationMetadataReadingVisitor
and related classes for internal use within the framework.ASM method visitor which looks for the annotations defined on a method, exposing them through theMethodMetadata
interface.- Since:
- 3.0
- Author:
- Juergen Hoeller, Mark Pollack, Costin Leau, Chris Beams, Phillip Webb
Field Summary
Fields Modifier and Type Field Description protected int
access
Deprecated.protected LinkedMultiValueMap<String,AnnotationAttributes>
attributesMap
Deprecated.protected ClassLoader
classLoader
Deprecated.protected String
declaringClassName
Deprecated.protected Map<String,Set<String>>
metaAnnotationMap
Deprecated.protected Set<MethodMetadata>
methodMetadataSet
Deprecated.protected String
methodName
Deprecated.protected String
returnTypeName
Deprecated.Fields inherited from class org.springframework.asm.MethodVisitor
api, mv
Constructor Summary
Constructors Constructor Description MethodMetadataReadingVisitor(String methodName, int access, String declaringClassName, String returnTypeName, ClassLoader classLoader, Set<MethodMetadata> methodMetadataSet)
Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MultiValueMap<String,Object>
getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
Deprecated.Retrieve all attributes of all annotations of the given type, if any (i.e.AnnotationAttributes
getAnnotationAttributes(String annotationName, boolean classValuesAsString)
Deprecated.Retrieve the attributes of the annotation of the given type, if any (i.e.MergedAnnotations
getAnnotations()
Deprecated.Return annotation details based on the direct annotations of the underlying element.String
getDeclaringClassName()
Deprecated.Return the fully-qualified name of the class that declares this method.String
getMethodName()
Deprecated.Return the name of the method.String
getReturnTypeName()
Deprecated.Return the fully-qualified name of this method's declared return type.boolean
isAbstract()
Deprecated.Return whether the underlying method is effectively abstract: i.e.boolean
isAnnotated(String annotationName)
Deprecated.Determine whether the underlying element has an annotation or meta-annotation of the given type defined.boolean
isFinal()
Deprecated.Return whether the underlying method is marked as 'final'.boolean
isOverridable()
Deprecated.Return whether the underlying method is overridable, i.e.boolean
isStatic()
Deprecated.Return whether the underlying method is declared as 'static'.AnnotationVisitor
visitAnnotation(String desc, boolean visible)
Deprecated.Visits an annotation of this method.Methods inherited from class org.springframework.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.type.AnnotatedTypeMetadata
getAllAnnotationAttributes, getAnnotationAttributes
Field Detail
methodName
protected final String methodName
Deprecated.
access
protected final int access
Deprecated.
declaringClassName
protected final String declaringClassName
Deprecated.
returnTypeName
protected final String returnTypeName
Deprecated.
classLoader
@Nullable protected final ClassLoader classLoader
Deprecated.
methodMetadataSet
protected final Set<MethodMetadata> methodMetadataSet
Deprecated.
metaAnnotationMap
protected final Map<String,Set<String>> metaAnnotationMap
Deprecated.
attributesMap
protected final LinkedMultiValueMap<String,AnnotationAttributes> attributesMap
Deprecated.
Constructor Detail
MethodMetadataReadingVisitor
public MethodMetadataReadingVisitor(String methodName, int access, String declaringClassName, String returnTypeName, @Nullable ClassLoader classLoader, Set<MethodMetadata> methodMetadataSet)
Deprecated.
Method Detail
getAnnotations
public MergedAnnotations getAnnotations()
Deprecated.Description copied from interface:AnnotatedTypeMetadata
Return annotation details based on the direct annotations of the underlying element.- Specified by:
getAnnotations
in interfaceAnnotatedTypeMetadata
- Returns:
- merged annotations based on the direct annotations
visitAnnotation
@Nullable public AnnotationVisitor visitAnnotation(String desc, boolean visible)
Deprecated.Description copied from class:MethodVisitor
Visits an annotation of this method.- Overrides:
visitAnnotation
in classMethodVisitor
- Parameters:
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.- Returns:
- a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
getMethodName
public String getMethodName()
Deprecated.Description copied from interface:MethodMetadata
Return the name of the method.- Specified by:
getMethodName
in interfaceMethodMetadata
isAbstract
public boolean isAbstract()
Deprecated.Description copied from interface:MethodMetadata
Return whether the underlying method is effectively abstract: i.e. marked as abstract on a class or declared as a regular, non-default method in an interface.- Specified by:
isAbstract
in interfaceMethodMetadata
isStatic
public boolean isStatic()
Deprecated.Description copied from interface:MethodMetadata
Return whether the underlying method is declared as 'static'.- Specified by:
isStatic
in interfaceMethodMetadata
isFinal
public boolean isFinal()
Deprecated.Description copied from interface:MethodMetadata
Return whether the underlying method is marked as 'final'.- Specified by:
isFinal
in interfaceMethodMetadata
isOverridable
public boolean isOverridable()
Deprecated.Description copied from interface:MethodMetadata
Return whether the underlying method is overridable, i.e. not marked as static, final or private.- Specified by:
isOverridable
in interfaceMethodMetadata
isAnnotated
public boolean isAnnotated(String annotationName)
Deprecated.Description copied from interface: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.- Specified by:
isAnnotated
in interfaceAnnotatedTypeMetadata
- Parameters:
annotationName
- the fully qualified class name of the annotation type to look for- Returns:
- whether a matching annotation is defined
getAnnotationAttributes
@Nullable public AnnotationAttributes getAnnotationAttributes(String annotationName, boolean classValuesAsString)
Deprecated.Description copied from interface: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.- Specified by:
getAnnotationAttributes
in interfaceAnnotatedTypeMetadata
- Parameters:
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- Returns:
- 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)
Deprecated.Description copied from interface: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.- Specified by:
getAllAnnotationAttributes
in interfaceAnnotatedTypeMetadata
- Parameters:
annotationName
- the fully qualified class name of the annotation type to look forclassValuesAsString
- whether to convert class references to String- Returns:
- 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. - See Also:
AnnotatedTypeMetadata.getAllAnnotationAttributes(String)
getDeclaringClassName
public String getDeclaringClassName()
Deprecated.Description copied from interface:MethodMetadata
Return the fully-qualified name of the class that declares this method.- Specified by:
getDeclaringClassName
in interfaceMethodMetadata
getReturnTypeName
public String getReturnTypeName()
Deprecated.Description copied from interface:MethodMetadata
Return the fully-qualified name of this method's declared return type.- Specified by:
getReturnTypeName
in interfaceMethodMetadata