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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAllAnnotationAttributes(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.Get annotation details based on the direct annotations and meta-annotations of the underlying element.Get the fully-qualified name of the class that declares the underlying method.final MethodReturn the underlying Method.Get the name of the underlying method.Get the fully-qualified name of the underlying method's declared return type.inthashCode()booleanDetermine whether the underlying method is effectively abstract: i.e.booleanisFinal()Determine whether the underlying method is marked as 'final'.booleanDetermine whether the underlying method is overridable, i.e.booleanisStatic()Determine whether the underlying method is declared as 'static'.toString()
-
Constructor Details
-
StandardMethodMetadata
Deprecated.in favor of obtaining instances viaAnnotationMetadataCreate a new StandardMethodMetadata wrapper for the given Method.- Parameters:
introspectedMethod- the Method to introspect
-
-
Method Details
-
getAnnotations
Description copied from interface:AnnotatedTypeMetadataGet annotation details based on the direct annotations and meta-annotations of the underlying element.- Specified by:
getAnnotationsin interfaceAnnotatedTypeMetadata- Returns:
- merged annotations based on the direct annotations and meta-annotations
-
getIntrospectedMethod
Return the underlying Method. -
getMethodName
Description copied from interface:MethodMetadataGet the name of the underlying method.- Specified by:
getMethodNamein interfaceMethodMetadata
-
getDeclaringClassName
Description copied from interface:MethodMetadataGet the fully-qualified name of the class that declares the underlying method.- Specified by:
getDeclaringClassNamein interfaceMethodMetadata
-
getReturnTypeName
Description copied from interface:MethodMetadataGet the fully-qualified name of the underlying method's declared return type.- Specified by:
getReturnTypeNamein interfaceMethodMetadata
-
isAbstract
public boolean isAbstract()Description copied from interface:MethodMetadataDetermine 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:
isAbstractin interfaceMethodMetadata
-
isStatic
public boolean isStatic()Description copied from interface:MethodMetadataDetermine whether the underlying method is declared as 'static'.- Specified by:
isStaticin interfaceMethodMetadata
-
isFinal
public boolean isFinal()Description copied from interface:MethodMetadataDetermine whether the underlying method is marked as 'final'.- Specified by:
isFinalin interfaceMethodMetadata
-
isOverridable
public boolean isOverridable()Description copied from interface:MethodMetadataDetermine whether the underlying method is overridable, i.e. not marked as static, final, or private.- Specified by:
isOverridablein interfaceMethodMetadata
-
getAnnotationAttributes
public @nullable Map<String, @nullable Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString) Description copied from interface:AnnotatedTypeMetadataRetrieve 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).@AliasForsemantics are fully supported, both within a single annotation and within annotation hierarchies.- Specified by:
getAnnotationAttributesin 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
Mapof attributes, with each annotation attribute name as map key (for example, "location") and the attribute's value as map value; ornullif no matching annotation is found
-
getAllAnnotationAttributes
public @nullable MultiValueMap<String, @nullable Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) Description copied from interface:AnnotatedTypeMetadataRetrieve 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: this method does not take attribute overrides on composed annotations into account.
- Specified by:
getAllAnnotationAttributesin 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
MultiValueMapof attributes, with each annotation attribute name as map key (for example, "location") and a list of the attribute's values as map value; ornullif no matching annotation is found - See Also:
-
equals
-
hashCode
-
toString
-
AnnotationMetadata