public class MethodMetadataReadingVisitor extends MethodVisitor implements MethodMetadata
MethodMetadata
interface.Modifier and Type | Field and Description |
---|---|
protected int |
access |
protected LinkedMultiValueMap<String,AnnotationAttributes> |
attributesMap |
protected ClassLoader |
classLoader |
protected String |
declaringClassName |
protected Map<String,Set<String>> |
metaAnnotationMap |
protected Set<MethodMetadata> |
methodMetadataSet |
protected String |
name |
api, mv
Constructor and Description |
---|
MethodMetadataReadingVisitor(String name,
int access,
String declaringClassName,
ClassLoader classLoader,
Set<MethodMetadata> methodMetadataSet) |
Modifier and Type | Method and Description |
---|---|
MultiValueMap<String,Object> |
getAllAnnotationAttributes(String annotationType)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
MultiValueMap<String,Object> |
getAllAnnotationAttributes(String annotationType,
boolean classValuesAsString)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
Map<String,Object> |
getAnnotationAttributes(String annotationType)
Retrieve the attributes of the annotation of the given type, if any (i.e.
|
Map<String,Object> |
getAnnotationAttributes(String annotationType,
boolean classValuesAsString)
Retrieve the attributes of the annotation of the given type, if any (i.e.
|
String |
getDeclaringClassName()
Return the fully-qualified name of the class that declares this method.
|
String |
getMethodName()
Return the name of the method.
|
boolean |
isAnnotated(String annotationType)
Determine whether the underlying element has an annotation or meta-annotation
of the given type defined.
|
boolean |
isFinal()
Return whether the underlying method is marked as 'final'.
|
boolean |
isOverridable()
Return whether the underlying method is overridable,
i.e.
|
boolean |
isStatic()
Return whether the underlying method is declared as 'static'.
|
AnnotationVisitor |
visitAnnotation(String desc,
boolean visible)
Visits an annotation of this method.
|
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
protected final String name
protected final int access
protected final String declaringClassName
protected final ClassLoader classLoader
protected final Set<MethodMetadata> methodMetadataSet
protected final LinkedMultiValueMap<String,AnnotationAttributes> attributesMap
public MethodMetadataReadingVisitor(String name, int access, String declaringClassName, ClassLoader classLoader, Set<MethodMetadata> methodMetadataSet)
public AnnotationVisitor visitAnnotation(String desc, boolean visible)
MethodVisitor
visitAnnotation
in class MethodVisitor
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.public String getMethodName()
MethodMetadata
getMethodName
in interface MethodMetadata
public boolean isStatic()
MethodMetadata
isStatic
in interface MethodMetadata
public boolean isFinal()
MethodMetadata
isFinal
in interface MethodMetadata
public boolean isOverridable()
MethodMetadata
isOverridable
in interface MethodMetadata
public boolean isAnnotated(String annotationType)
AnnotatedTypeMetadata
If this method returns true
, then
AnnotatedTypeMetadata.getAnnotationAttributes(java.lang.String)
will return a non-null Map.
isAnnotated
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look forpublic Map<String,Object> getAnnotationAttributes(String annotationType)
AnnotatedTypeMetadata
getAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look fornull
if no matching annotation is defined.public Map<String,Object> getAnnotationAttributes(String annotationType, boolean classValuesAsString)
AnnotatedTypeMetadata
getAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- 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 annotationType)
AnnotatedTypeMetadata
getAllAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look fornull
if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)
public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationType, boolean classValuesAsString)
AnnotatedTypeMetadata
getAllAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look forclassValuesAsString
- whether to convert class references to Stringnull
if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String)
public String getDeclaringClassName()
MethodMetadata
getDeclaringClassName
in interface MethodMetadata