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

public Class MatrixVariableMapMethodArgumentResolver

extends Object
implements HandlerMethodArgumentResolver
Class Inheritance
All Implemented Interfaces
org.springframework.web.method.support.HandlerMethodArgumentResolver
Imports
java.util.List, .Map, org.springframework.core.MethodParameter, .ResolvableType, org.springframework.lang.Nullable, org.springframework.util.Assert, .CollectionUtils, .LinkedMultiValueMap, .MultiValueMap, .StringUtils, org.springframework.web.bind.annotation.MatrixVariable, .ValueConstants, org.springframework.web.bind.support.WebDataBinderFactory, org.springframework.web.context.request.NativeWebRequest, .RequestAttributes, org.springframework.web.method.support.HandlerMethodArgumentResolver, .ModelAndViewContainer, org.springframework.web.servlet.HandlerMapping

Resolves arguments of type Map annotated with @MatrixVariable where the annotation does not specify a name. In other words the purpose of this resolver is to provide access to multiple matrix variables, either all or associated with a specific path variable.

When a name is specified, an argument of type Map is considered to be a single attribute with a Map value, and is resolved by MatrixVariableMethodArgumentResolver instead.

Author
Rossen Stoyanchev
Since
3.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
private MultiValueMap<String, String>
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
request
,
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

MatrixVariableMapMethodArgumentResolverback to summary
public MatrixVariableMapMethodArgumentResolver()

Method Detail

isSingleValueMapback to summary
private boolean isSingleValueMap(MethodParameter parameter)
mapMatrixVariablesback to summary
private MultiValueMap<String, String> mapMatrixVariables(MethodParameter parameter, Map<String, MultiValueMap<String, String>> matrixVariables)
resolveArgumentback to summary
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest request, 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

request: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
@Nullable
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