org.springframework.web.method
Class HandlerMethod.HandlerMethodParameter

java.lang.Object
  extended by org.springframework.core.MethodParameter
      extended by org.springframework.web.method.HandlerMethod.HandlerMethodParameter
Enclosing class:
HandlerMethod

private class HandlerMethod.HandlerMethodParameter
extends MethodParameter

A MethodParameter that resolves method annotations even when the actual annotations are on a bridge method rather than on the current method. Annotations on super types are also returned via AnnotationUtils.findAnnotation(Method, Class).


Constructor Summary
HandlerMethod.HandlerMethodParameter(java.lang.reflect.Method method, int parameterIndex)
           
 
Method Summary
 java.lang.Class<?> getDeclaringClass()
          Return HandlerMethod.getBeanType() rather than the method's class, which could be important for the proper discovery of generic types.
<T extends java.lang.annotation.Annotation>
T
getMethodAnnotation(java.lang.Class<T> annotationType)
          Return the method annotation via HandlerMethod.getMethodAnnotation(Class), which will find the annotation by traversing super-types and handling annotations on bridge methods correctly.
 
Methods inherited from class org.springframework.core.MethodParameter
decreaseNestingLevel, equals, forMethodOrConstructor, getConstructor, getGenericParameterType, getMethod, getMethodAnnotations, getNestingLevel, getParameterAnnotation, getParameterAnnotations, getParameterIndex, getParameterName, getParameterType, getTypeIndexForCurrentLevel, getTypeIndexForLevel, hashCode, hasParameterAnnotation, hasParameterAnnotations, increaseNestingLevel, initParameterNameDiscovery, setTypeIndexForCurrentLevel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerMethod.HandlerMethodParameter

public HandlerMethod.HandlerMethodParameter(java.lang.reflect.Method method,
                                            int parameterIndex)
Method Detail

getDeclaringClass

public java.lang.Class<?> getDeclaringClass()
Return HandlerMethod.getBeanType() rather than the method's class, which could be important for the proper discovery of generic types.

Overrides:
getDeclaringClass in class MethodParameter

getMethodAnnotation

public <T extends java.lang.annotation.Annotation> T getMethodAnnotation(java.lang.Class<T> annotationType)
Return the method annotation via HandlerMethod.getMethodAnnotation(Class), which will find the annotation by traversing super-types and handling annotations on bridge methods correctly.

Overrides:
getMethodAnnotation in class MethodParameter
Parameters:
annotationType - the annotation type to look for
Returns:
the annotation object, or null if not found