public class

HandlerMethodInvoker

extends Object
java.lang.Object
   ↳ org.springframework.web.bind.annotation.support.HandlerMethodInvoker

Class Overview

Support class for invoking an annotated handler method. Operates on the introspection results of a HandlerMethodResolver for a specific handler type.

Used by AnnotationMethodHandlerAdapter and AnnotationMethodHandlerAdapter.

Summary

Public Constructors
HandlerMethodInvoker(HandlerMethodResolver methodResolver)
HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer)
HandlerMethodInvoker(HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer, SessionAttributeStore sessionAttributeStore, ParameterNameDiscoverer parameterNameDiscoverer, WebArgumentResolver[] customArgumentResolvers, HttpMessageConverter[] messageConverters)
Public Methods
final Object invokeHandlerMethod(Method handlerMethod, Object handler, NativeWebRequest webRequest, ExtendedModelMap implicitModel)
final void updateModelAttributes(Object handler, Map<StringObject> mavModel, ExtendedModelMap implicitModel, NativeWebRequest webRequest)
Protected Methods
final void addReturnValueAsModelAttribute(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel)
WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName)
HttpInputMessage createHttpInputMessage(NativeWebRequest webRequest)
Return a HttpInputMessage for the given NativeWebRequest.
HttpOutputMessage createHttpOutputMessage(NativeWebRequest webRequest)
Return a HttpOutputMessage for the given NativeWebRequest.
void doBind(WebDataBinder binder, NativeWebRequest webRequest)
void initBinder(Object handler, String attrName, WebDataBinder binder, NativeWebRequest webRequest)
boolean isBindingCandidate(Object value)
Determine whether the given value qualifies as a "binding candidate", i.e.
String parseDefaultValueAttribute(String value)
void raiseMissingCookieException(String cookieName, Class paramType)
void raiseMissingHeaderException(String headerName, Class paramType)
void raiseMissingParameterException(String paramName, Class paramType)
void raiseSessionRequiredException(String message)
Object resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest)
Object resolveCookieValue(String cookieName, Class paramType, NativeWebRequest webRequest)
Resolves the given @CookieValue annotation.
Object resolveDefaultValue(String value)
String resolvePathVariable(String pathVarName, Class paramType, NativeWebRequest webRequest)
Resolves the given @PathVariable annotation.
Object resolveRequestBody(MethodParameter methodParam, NativeWebRequest webRequest, Object handler)
Resolves the given @RequestBody annotation.
Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public HandlerMethodInvoker (HandlerMethodResolver methodResolver)

public HandlerMethodInvoker (HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer)

public HandlerMethodInvoker (HandlerMethodResolver methodResolver, WebBindingInitializer bindingInitializer, SessionAttributeStore sessionAttributeStore, ParameterNameDiscoverer parameterNameDiscoverer, WebArgumentResolver[] customArgumentResolvers, HttpMessageConverter[] messageConverters)

Public Methods

public final Object invokeHandlerMethod (Method handlerMethod, Object handler, NativeWebRequest webRequest, ExtendedModelMap implicitModel)

Throws
Exception

public final void updateModelAttributes (Object handler, Map<StringObject> mavModel, ExtendedModelMap implicitModel, NativeWebRequest webRequest)

Throws
Exception

Protected Methods

protected final void addReturnValueAsModelAttribute (Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel)

protected WebDataBinder createBinder (NativeWebRequest webRequest, Object target, String objectName)

Throws
Exception

protected HttpInputMessage createHttpInputMessage (NativeWebRequest webRequest)

Return a HttpInputMessage for the given NativeWebRequest.

Throws an UnsupportedOperation1Exception by default.

Throws
Exception

protected HttpOutputMessage createHttpOutputMessage (NativeWebRequest webRequest)

Return a HttpOutputMessage for the given NativeWebRequest.

Throws an UnsupportedOperationException by default.

Throws
Exception

protected void doBind (WebDataBinder binder, NativeWebRequest webRequest)

Throws
Exception

protected void initBinder (Object handler, String attrName, WebDataBinder binder, NativeWebRequest webRequest)

Throws
Exception

protected boolean isBindingCandidate (Object value)

Determine whether the given value qualifies as a "binding candidate", i.e. might potentially be subject to bean-style data binding later on.

protected String parseDefaultValueAttribute (String value)

protected void raiseMissingCookieException (String cookieName, Class paramType)

Throws
Exception

protected void raiseMissingHeaderException (String headerName, Class paramType)

Throws
Exception

protected void raiseMissingParameterException (String paramName, Class paramType)

Throws
Exception

protected void raiseSessionRequiredException (String message)

Throws
Exception

protected Object resolveCommonArgument (MethodParameter methodParameter, NativeWebRequest webRequest)

Throws
Exception

protected Object resolveCookieValue (String cookieName, Class paramType, NativeWebRequest webRequest)

Resolves the given @CookieValue annotation.

Throws an UnsupportedOperationException by default.

Throws
Exception

protected Object resolveDefaultValue (String value)

protected String resolvePathVariable (String pathVarName, Class paramType, NativeWebRequest webRequest)

Resolves the given @PathVariable annotation.

Throws an UnsupportedOperationException by default.

Throws
Exception

protected Object resolveRequestBody (MethodParameter methodParam, NativeWebRequest webRequest, Object handler)

Resolves the given @RequestBody annotation.

Throws
Exception

protected Object resolveStandardArgument (Class<?> parameterType, NativeWebRequest webRequest)

Throws
Exception