Package org.springframework.core.type
Class StandardMethodMetadata
java.lang.Object
org.springframework.core.type.StandardMethodMetadata
- All Implemented Interfaces:
AnnotatedTypeMetadata
,MethodMetadata
MethodMetadata
implementation that uses standard reflection
to introspect a given Method
.- Since:
- 3.0
- Author:
- Juergen Hoeller, Mark Pollack, Chris Beams, Phillip Webb, Sam Brannen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getAllAnnotationAttributes
(String annotationName, boolean classValuesAsString) Retrieve all attributes of all annotations of the given type, if any (i.e.getAnnotationAttributes
(String annotationName, boolean classValuesAsString) Retrieve the attributes of the annotation of the given type, if any (i.e.Return annotation details based on the direct annotations of the underlying element.Get the fully-qualified name of the class that declares the underlying method.final Method
Return the underlying Method.Get the name of the underlying method.Get the fully-qualified name of the underlying method's declared return type.int
hashCode()
boolean
Determine whether the underlying method is effectively abstract: i.e.boolean
isFinal()
Determine whether the underlying method is marked as 'final'.boolean
Determine whether the underlying method is overridable, i.e.boolean
isStatic()
Determine whether the underlying method is declared as 'static'.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.type.AnnotatedTypeMetadata
getAllAnnotationAttributes, getAnnotationAttributes, isAnnotated
-
Constructor Details
-
StandardMethodMetadata
Deprecated.since 5.2 in favor of obtaining instances viaAnnotationMetadata
Create a new StandardMethodMetadata wrapper for the given Method.- Parameters:
introspectedMethod
- the Method to introspect
-
-
Method Details
-
getAnnotations
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
-
getIntrospectedMethod
Return the underlying Method. -
getMethodName
Description copied from interface:MethodMetadata
Get the name of the underlying method.- Specified by:
getMethodName
in interfaceMethodMetadata
-
getDeclaringClassName
Description copied from interface:MethodMetadata
Get the fully-qualified name of the class that declares the underlying method.- Specified by:
getDeclaringClassName
in interfaceMethodMetadata
-
getReturnTypeName
Description copied from interface:MethodMetadata
Get the fully-qualified name of the underlying method's declared return type.- Specified by:
getReturnTypeName
in interfaceMethodMetadata
-
isAbstract
public boolean isAbstract()Description copied from interface:MethodMetadata
Determine whether the underlying method is effectively abstract: i.e. marked as abstract in a class or declared as a regular, non-default method in an interface.- Specified by:
isAbstract
in interfaceMethodMetadata
-
isStatic
public boolean isStatic()Description copied from interface:MethodMetadata
Determine whether the underlying method is declared as 'static'.- Specified by:
isStatic
in interfaceMethodMetadata
-
isFinal
public boolean isFinal()Description copied from interface:MethodMetadata
Determine whether the underlying method is marked as 'final'.- Specified by:
isFinal
in interfaceMethodMetadata
-
isOverridable
public boolean isOverridable()Description copied from interface:MethodMetadata
Determine whether the underlying method is overridable, i.e. not marked as static, final, or private.- Specified by:
isOverridable
in interfaceMethodMetadata
-
getAnnotationAttributes
@Nullable public Map<String,Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString) 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) 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:
-
equals
-
hashCode
public int hashCode() -
toString
-
AnnotationMetadata