Package org.springframework.data.web
Class SortHandlerMethodArgumentResolver
java.lang.Object
org.springframework.data.web.SortHandlerMethodArgumentResolverSupport
org.springframework.data.web.SortHandlerMethodArgumentResolver
- All Implemented Interfaces:
SortArgumentResolver
,org.springframework.web.method.support.HandlerMethodArgumentResolver
- Direct Known Subclasses:
HateoasSortHandlerMethodArgumentResolver
public class SortHandlerMethodArgumentResolver
extends SortHandlerMethodArgumentResolverSupport
implements SortArgumentResolver
HandlerMethodArgumentResolver
to automatically create Sort
instances from request parameters or
SortDefault
annotations.- Since:
- 1.6
- Author:
- Oliver Gierke, Thomas Darimont, Nick Williams, Mark Paluch, Christoph Strobl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolveArgument
(org.springframework.core.MethodParameter parameter, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.bind.support.WebDataBinderFactory binderFactory) Resolves aSort
method parameter into an argument value from a given request.boolean
supportsParameter
(org.springframework.core.MethodParameter parameter) Methods inherited from class org.springframework.data.web.SortHandlerMethodArgumentResolverSupport
foldIntoExpressions, getDefaultFromAnnotationOrFallback, getPropertyDelimiter, getSortParameter, legacyFoldExpressions, setFallbackSort, setPropertyDelimiter, setQualifierDelimiter, setSortParameter
-
Constructor Details
-
SortHandlerMethodArgumentResolver
public SortHandlerMethodArgumentResolver()
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) - Specified by:
supportsParameter
in interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver
-
resolveArgument
public Sort resolveArgument(org.springframework.core.MethodParameter parameter, @Nullable org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest webRequest, @Nullable org.springframework.web.bind.support.WebDataBinderFactory binderFactory) Description copied from interface:SortArgumentResolver
Resolves aSort
method parameter into an argument value from a given request.- Specified by:
resolveArgument
in interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver
- Specified by:
resolveArgument
in interfaceSortArgumentResolver
- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed toHandlerMethodArgumentResolver.supportsParameter(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
-