Package org.springframework.data.web
Class SortHandlerMethodArgumentResolver
java.lang.Object
org.springframework.data.web.SortHandlerMethodArgumentResolverSupport
org.springframework.data.web.SortHandlerMethodArgumentResolver
- All Implemented Interfaces:
SortArgumentResolver
,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
(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) Resolves aSort
method parameter into an argument value from a given request.boolean
supportsParameter
(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
- Specified by:
supportsParameter
in interfaceHandlerMethodArgumentResolver
-
resolveArgument
public Sort resolveArgument(MethodParameter parameter, @Nullable ModelAndViewContainer mavContainer, NativeWebRequest webRequest, @Nullable WebDataBinderFactory binderFactory) Description copied from interface:SortArgumentResolver
Resolves aSort
method parameter into an argument value from a given request.- Specified by:
resolveArgument
in interfaceHandlerMethodArgumentResolver
- 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
-