Interface HandlerMethodArgumentResolver
- All Known Implementing Classes:
AbstractCookieValueMethodArgumentResolver
,AbstractMessageConverterMethodArgumentResolver
,AbstractMessageConverterMethodProcessor
,AbstractNamedValueMethodArgumentResolver
,AbstractWebArgumentResolverAdapter
,ContinuationHandlerMethodArgumentResolver
,ErrorsMethodArgumentResolver
,ExpressionValueMethodArgumentResolver
,HandlerMethodArgumentResolverComposite
,HttpEntityMethodProcessor
,MapMethodProcessor
,MatrixVariableMapMethodArgumentResolver
,MatrixVariableMethodArgumentResolver
,ModelAttributeMethodProcessor
,ModelMethodProcessor
,PathVariableMapMethodArgumentResolver
,PathVariableMethodArgumentResolver
,PrincipalMethodArgumentResolver
,RedirectAttributesMethodArgumentResolver
,RequestAttributeMethodArgumentResolver
,RequestHeaderMapMethodArgumentResolver
,RequestHeaderMethodArgumentResolver
,RequestParamMapMethodArgumentResolver
,RequestParamMethodArgumentResolver
,RequestPartMethodArgumentResolver
,RequestResponseBodyMethodProcessor
,ServletCookieValueMethodArgumentResolver
,ServletModelAttributeMethodProcessor
,ServletRequestMethodArgumentResolver
,ServletResponseMethodArgumentResolver
,ServletWebArgumentResolverAdapter
,SessionAttributeMethodArgumentResolver
,SessionStatusMethodArgumentResolver
,UriComponentsBuilderMethodArgumentResolver
public interface HandlerMethodArgumentResolver
Strategy interface for resolving method parameters into argument values in
the context of a given request.
- Since:
- 3.1
- Author:
- Arjen Poutsma
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionresolveArgument
(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) Resolves a method parameter into an argument value from a given request.boolean
supportsParameter
(MethodParameter parameter) Whether the given method parameter is supported by this resolver.
-
Method Details
-
supportsParameter
Whether the given method parameter is supported by this resolver.- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveArgument
@Nullable Object resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) throws Exception Resolves a method parameter into an argument value from a given request. AModelAndViewContainer
provides access to the model for the request. AWebDataBinderFactory
provides a way to create aWebDataBinder
instance when needed for data binding and type conversion purposes.- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed tosupportsParameter(org.springframework.core.MethodParameter)
which must have returnedtrue
.mavContainer
- the ModelAndViewContainer for the current requestwebRequest
- the current requestbinderFactory
- a factory for creatingWebDataBinder
instances- Returns:
- the resolved argument value, or
null
if not resolvable - Throws:
Exception
- in case of errors with the preparation of argument values
-