Class AnnotatedMethod
java.lang.Object
org.springframework.core.annotation.AnnotatedMethod
- Direct Known Subclasses:
- HandlerMethod,- HandlerMethod
A convenient wrapper for a 
Method handle, providing deep annotation
 introspection on methods and method parameters, including the exposure of
 interface-declared parameter annotations from the concrete target method.- Since:
- 6.1
- Author:
- Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classA MethodParameter with AnnotatedMethod-specific behavior.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionAnnotatedMethod(Method method) Create an instance that wraps the givenMethod.protectedAnnotatedMethod(AnnotatedMethod annotatedMethod) Copy constructor for use in subclasses.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanfindProvidedArgument(MethodParameter parameter, @Nullable Object... providedArgs) protected static StringformatArgumentError(MethodParameter param, String message) protected final MethodIf the annotated method is a bridge method, this method returns the bridged (user-defined) method.protected Class<?> Expose the containing class for method parameters.final MethodReturn the annotated method.<A extends Annotation>
 @Nullable AgetMethodAnnotation(Class<A> annotationType) Return a single annotation on the underlying method, traversing its super methods if no annotation can be found on the given method itself.final MethodParameter[]Return the method parameters for thisAnnotatedMethod.Return aMethodParameterfor the declared return type.getReturnValueType(@Nullable Object returnValue) Return aMethodParameterfor the actual return value type.inthashCode()<A extends Annotation>
 booleanhasMethodAnnotation(Class<A> annotationType) Determine if an annotation of the given type is present or meta-present on the method.booleanisVoid()Returntrueif the method's return type is void,falseotherwise.toString()
- 
Constructor Details- 
AnnotatedMethod
- 
AnnotatedMethodCopy constructor for use in subclasses.
 
- 
- 
Method Details- 
getMethodReturn the annotated method.
- 
getBridgedMethodIf the annotated method is a bridge method, this method returns the bridged (user-defined) method. Otherwise, it returns the same method asgetMethod().
- 
getContainingClassExpose the containing class for method parameters.- See Also:
 
- 
getMethodParametersReturn the method parameters for thisAnnotatedMethod.
- 
getReturnTypeReturn aMethodParameterfor the declared return type.
- 
getReturnValueTypeReturn aMethodParameterfor the actual return value type.
- 
isVoidpublic boolean isVoid()Returntrueif the method's return type is void,falseotherwise.
- 
getMethodAnnotationReturn a single annotation on the underlying method, traversing its super methods if no annotation can be found on the given method itself.Supports merged composed annotations with attribute overrides. - Parameters:
- annotationType- the annotation type to look for
- Returns:
- the annotation, or nullif none found
- See Also:
 
- 
hasMethodAnnotationDetermine if an annotation of the given type is present or meta-present on the method.- Parameters:
- annotationType- the annotation type to look for
- See Also:
 
- 
equals
- 
hashCode
- 
toString
- 
findProvidedArgumentprotected static @Nullable Object findProvidedArgument(MethodParameter parameter, @Nullable Object... providedArgs) 
- 
formatArgumentError
 
-