Top Description Constructors Methods
org.springframework.web.method.annotation

public Class RequestHeaderMapMethodArgumentResolver

extends Object
implements HandlerMethodArgumentResolver
Class Inheritance
All Implemented Interfaces
org.springframework.web.method.support.HandlerMethodArgumentResolver
Imports
java.util.Iterator, .LinkedHashMap, .Map, org.springframework.core.MethodParameter, org.springframework.http.HttpHeaders, org.springframework.lang.Nullable, org.springframework.util.LinkedMultiValueMap, .MultiValueMap, org.springframework.web.bind.annotation.RequestHeader, org.springframework.web.bind.support.WebDataBinderFactory, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.method.support.HandlerMethodArgumentResolver, .ModelAndViewContainer

Resolves Map method arguments annotated with @RequestHeader. For individual header values annotated with @RequestHeader see RequestHeaderMethodArgumentResolver instead.

The created Map contains all request header name/value pairs. The method parameter type may be a MultiValueMap to receive all values for a header, not only the first one.

Authors
Arjen Poutsma, Rossen Stoyanchev
Since
3.1

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
resolveArgument(MethodParameter
the method parameter to resolve. This parameter must have previously been passed to supportsParameter which must have returned true.
parameter
,
ModelAndViewContainer
the ModelAndViewContainer for the current request
mavContainer
,
NativeWebRequest
the current request
webRequest
,
WebDataBinderFactory
a factory for creating WebDataBinder instances
binderFactory
)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given request.
public boolean
supportsParameter(MethodParameter
the method parameter to check
parameter
)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RequestHeaderMapMethodArgumentResolverback to summary
public RequestHeaderMapMethodArgumentResolver()

Method Detail

resolveArgumentback to summary
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Doc from org.springframework.web.method.support.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given request. A ModelAndViewContainer provides access to the model for the request. A WebDataBinderFactory provides a way to create a WebDataBinder instance when needed for data binding and type conversion purposes.

Parameters
parameter:MethodParameter

the method parameter to resolve. This parameter must have previously been passed to supportsParameter which must have returned true.

mavContainer:ModelAndViewContainer

the ModelAndViewContainer for the current request

webRequest:NativeWebRequest

the current request

binderFactory:WebDataBinderFactory

a factory for creating WebDataBinder instances

Returns:Object

the resolved argument value, or null if not resolvable

Annotations
@Override
Exceptions
Exception:
in case of errors with the preparation of argument values
supportsParameterback to summary
public boolean supportsParameter(MethodParameter parameter)

Implements org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Doc from org.springframework.web.method.support.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.

Parameters
parameter:MethodParameter

the method parameter to check

Returns:boolean

true if this resolver supports the supplied parameter; false otherwise

Annotations
@Override