public class HandlerMethodInvoker extends Object
HandlerMethodResolver for a specific handler type.
Used by AnnotationMethodHandlerAdapter and AnnotationMethodHandlerAdapter.
invokeHandlerMethod(java.lang.reflect.Method, java.lang.Object, org.springframework.web.context.request.NativeWebRequest, org.springframework.ui.ExtendedModelMap)| Constructor and Description |
|---|
HandlerMethodInvoker(HandlerMethodResolver methodResolver) |
HandlerMethodInvoker(HandlerMethodResolver methodResolver,
WebBindingInitializer bindingInitializer) |
HandlerMethodInvoker(HandlerMethodResolver methodResolver,
WebBindingInitializer bindingInitializer,
SessionAttributeStore sessionAttributeStore,
ParameterNameDiscoverer parameterNameDiscoverer,
WebArgumentResolver[] customArgumentResolvers,
HttpMessageConverter<?>[] messageConverters) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addReturnValueAsModelAttribute(Method handlerMethod,
Class<?> handlerType,
Object returnValue,
ExtendedModelMap implicitModel) |
protected WebDataBinder |
createBinder(NativeWebRequest webRequest,
Object target,
String objectName) |
protected HttpInputMessage |
createHttpInputMessage(NativeWebRequest webRequest)
Return a
HttpInputMessage for the given NativeWebRequest. |
protected HttpOutputMessage |
createHttpOutputMessage(NativeWebRequest webRequest)
Return a
HttpOutputMessage for the given NativeWebRequest. |
protected void |
doBind(WebDataBinder binder,
NativeWebRequest webRequest) |
protected void |
initBinder(Object handler,
String attrName,
WebDataBinder binder,
NativeWebRequest webRequest) |
Object |
invokeHandlerMethod(Method handlerMethod,
Object handler,
NativeWebRequest webRequest,
ExtendedModelMap implicitModel) |
protected boolean |
isBindingCandidate(Object value)
Determine whether the given value qualifies as a "binding candidate", i.e.
|
protected String |
parseDefaultValueAttribute(String value) |
protected void |
raiseMissingCookieException(String cookieName,
Class<?> paramType) |
protected void |
raiseMissingHeaderException(String headerName,
Class<?> paramType) |
protected void |
raiseMissingParameterException(String paramName,
Class<?> paramType) |
protected void |
raiseSessionRequiredException(String message) |
protected Object |
resolveCommonArgument(MethodParameter methodParameter,
NativeWebRequest webRequest) |
protected Object |
resolveCookieValue(String cookieName,
Class<?> paramType,
NativeWebRequest webRequest)
Resolves the given
@CookieValue annotation. |
protected Object |
resolveDefaultValue(String value) |
protected String |
resolvePathVariable(String pathVarName,
Class<?> paramType,
NativeWebRequest webRequest)
Resolves the given
@PathVariable annotation. |
protected Object |
resolveRequestBody(MethodParameter methodParam,
NativeWebRequest webRequest,
Object handler)
Resolves the given
@RequestBody annotation. |
protected Object |
resolveStandardArgument(Class<?> parameterType,
NativeWebRequest webRequest) |
void |
updateModelAttributes(Object handler,
Map<String,Object> mavModel,
ExtendedModelMap implicitModel,
NativeWebRequest webRequest) |
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 final Object invokeHandlerMethod(Method handlerMethod, Object handler, NativeWebRequest webRequest, ExtendedModelMap implicitModel) throws Exception
Exceptionpublic final void updateModelAttributes(Object handler, Map<String,Object> mavModel, ExtendedModelMap implicitModel, NativeWebRequest webRequest) throws Exception
Exceptionprotected void initBinder(Object handler, String attrName, WebDataBinder binder, NativeWebRequest webRequest) throws Exception
Exceptionprotected Object resolveRequestBody(MethodParameter methodParam, NativeWebRequest webRequest, Object handler) throws Exception
@RequestBody annotation.Exceptionprotected Object resolveCookieValue(String cookieName, Class<?> paramType, NativeWebRequest webRequest) throws Exception
@CookieValue annotation.
Throws an UnsupportedOperationException by default.
Exceptionprotected String resolvePathVariable(String pathVarName, Class<?> paramType, NativeWebRequest webRequest) throws Exception
@PathVariable annotation.
Throws an UnsupportedOperationException by default.
Exceptionprotected boolean isBindingCandidate(Object value)
protected void raiseMissingParameterException(String paramName, Class<?> paramType) throws Exception
Exceptionprotected void raiseMissingHeaderException(String headerName, Class<?> paramType) throws Exception
Exceptionprotected void raiseMissingCookieException(String cookieName, Class<?> paramType) throws Exception
Exceptionprotected void raiseSessionRequiredException(String message) throws Exception
Exceptionprotected WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception
Exceptionprotected void doBind(WebDataBinder binder, NativeWebRequest webRequest) throws Exception
Exceptionprotected HttpInputMessage createHttpInputMessage(NativeWebRequest webRequest) throws Exception
HttpInputMessage for the given NativeWebRequest.
Throws an UnsupportedOperation1Exception by default.
Exceptionprotected HttpOutputMessage createHttpOutputMessage(NativeWebRequest webRequest) throws Exception
HttpOutputMessage for the given NativeWebRequest.
Throws an UnsupportedOperationException by default.
Exceptionprotected Object resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception
Exceptionprotected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest) throws Exception
Exceptionprotected final void addReturnValueAsModelAttribute(Method handlerMethod, Class<?> handlerType, Object returnValue, ExtendedModelMap implicitModel)