public class StandardMethodMetadata extends java.lang.Object implements MethodMetadata
MethodMetadata
implementation that uses standard reflection
to introspect a given Method
.Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Method |
introspectedMethod |
private boolean |
nestedAnnotationsAsMap |
Constructor and Description |
---|
StandardMethodMetadata(java.lang.reflect.Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.
|
StandardMethodMetadata(java.lang.reflect.Method introspectedMethod,
boolean nestedAnnotationsAsMap)
Create a new StandardMethodMetadata wrapper for the given Method,
providing the option to return any nested annotations or annotation arrays in the
form of
AnnotationAttributes instead
of actual Annotation instances. |
Modifier and Type | Method and Description |
---|---|
MultiValueMap<java.lang.String,java.lang.Object> |
getAllAnnotationAttributes(java.lang.String annotationType)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
MultiValueMap<java.lang.String,java.lang.Object> |
getAllAnnotationAttributes(java.lang.String annotationType,
boolean classValuesAsString)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAnnotationAttributes(java.lang.String annotationType)
Retrieve the attributes of the annotation of the given type,
if any (i.e.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAnnotationAttributes(java.lang.String annotationType,
boolean classValuesAsString)
Retrieve the attributes of the annotation of the given type,
if any (i.e.
|
java.lang.String |
getDeclaringClassName()
Return the fully-qualified name of the class that declares this method.
|
java.lang.reflect.Method |
getIntrospectedMethod()
Return the underlying Method.
|
java.lang.String |
getMethodName()
Return the name of the method.
|
boolean |
isAnnotated(java.lang.String annotationType)
Determine whether the underlying type 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'.
|
private final java.lang.reflect.Method introspectedMethod
private final boolean nestedAnnotationsAsMap
public StandardMethodMetadata(java.lang.reflect.Method introspectedMethod)
introspectedMethod
- the Method to introspectpublic StandardMethodMetadata(java.lang.reflect.Method introspectedMethod, boolean nestedAnnotationsAsMap)
AnnotationAttributes
instead
of actual Annotation
instances.introspectedMethod
- the Method to introspectnestedAnnotationsAsMap
- return nested annotations and annotation arrays as
AnnotationAttributes
for compatibility
with ASM-based AnnotationMetadata
implementationspublic final java.lang.reflect.Method getIntrospectedMethod()
public java.lang.String getMethodName()
MethodMetadata
getMethodName
in interface MethodMetadata
public java.lang.String getDeclaringClassName()
MethodMetadata
getDeclaringClassName
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(java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getAnnotationAttributes(java.lang.String annotationType)
AnnotatedTypeMetadata
getAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look fornull
if no matching annotation is defined.public java.util.Map<java.lang.String,java.lang.Object> getAnnotationAttributes(java.lang.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<java.lang.String,java.lang.Object> getAllAnnotationAttributes(java.lang.String annotationType)
AnnotatedTypeMetadata
class
or
method
), as direct annotation or as meta-annotation).getAllAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationType
- the annotation type to look fornull
if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)
public MultiValueMap<java.lang.String,java.lang.Object> getAllAnnotationAttributes(java.lang.String annotationType, boolean classValuesAsString)
AnnotatedTypeMetadata
class
or
method
), as direct annotation or as meta-annotation).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)