public class StandardMethodMetadata extends Object implements MethodMetadata
MethodMetadata
implementation that uses standard reflection
to introspect a given Method
.Constructor and Description |
---|
StandardMethodMetadata(Method introspectedMethod)
Create a new StandardMethodMetadata wrapper for the given Method.
|
StandardMethodMetadata(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<String,Object> |
getAllAnnotationAttributes(String annotationName)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
MultiValueMap<String,Object> |
getAllAnnotationAttributes(String annotationName,
boolean classValuesAsString)
Retrieve all attributes of all annotations of the given type, if any (i.e.
|
Map<String,Object> |
getAnnotationAttributes(String annotationName)
Retrieve the attributes of the annotation of the given type, if any (i.e.
|
Map<String,Object> |
getAnnotationAttributes(String annotationName,
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.
|
Method |
getIntrospectedMethod()
Return the underlying Method.
|
String |
getMethodName()
Return the name of the method.
|
String |
getReturnTypeName()
Return the fully-qualified name of this method's declared return type.
|
boolean |
isAbstract()
Return whether the underlying method is effectively abstract:
i.e.
|
boolean |
isAnnotated(String annotationName)
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'.
|
public StandardMethodMetadata(Method introspectedMethod)
introspectedMethod
- the Method to introspectpublic StandardMethodMetadata(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 Method getIntrospectedMethod()
public String getMethodName()
MethodMetadata
getMethodName
in interface MethodMetadata
public String getDeclaringClassName()
MethodMetadata
getDeclaringClassName
in interface MethodMetadata
public String getReturnTypeName()
MethodMetadata
getReturnTypeName
in interface MethodMetadata
public boolean isAbstract()
MethodMetadata
isAbstract
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 annotationName)
AnnotatedTypeMetadata
If this method returns true
, then
AnnotatedTypeMetadata.getAnnotationAttributes(java.lang.String)
will return a non-null Map.
isAnnotated
in interface AnnotatedTypeMetadata
annotationName
- the fully qualified class name of the annotation
type to look for@Nullable public Map<String,Object> getAnnotationAttributes(String annotationName)
AnnotatedTypeMetadata
getAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationName
- the fully qualified class name of the annotation
type to look fornull
if no matching annotation is defined.@Nullable public Map<String,Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString)
AnnotatedTypeMetadata
getAnnotationAttributes
in interface 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 firstnull
if no matching annotation is defined.@Nullable public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName)
AnnotatedTypeMetadata
getAllAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationName
- the fully qualified class name of the annotation
type to look fornull
if no matching annotation is defined.AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)
@Nullable public MultiValueMap<String,Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString)
AnnotatedTypeMetadata
getAllAnnotationAttributes
in interface AnnotatedTypeMetadata
annotationName
- 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)