Package org.springframework.data.web
Class PageableHandlerMethodArgumentResolver
java.lang.Object
org.springframework.data.web.PageableHandlerMethodArgumentResolverSupport
org.springframework.data.web.PageableHandlerMethodArgumentResolver
- All Implemented Interfaces:
PageableArgumentResolver
,org.springframework.web.method.support.HandlerMethodArgumentResolver
- Direct Known Subclasses:
HateoasPageableHandlerMethodArgumentResolver
public class PageableHandlerMethodArgumentResolver
extends PageableHandlerMethodArgumentResolverSupport
implements PageableArgumentResolver
Extracts paging information from web requests and thus allows injecting
Pageable
instances into controller
methods. Request properties to be parsed can be configured. Default configuration uses request parameters beginning
with PageableHandlerMethodArgumentResolverSupport.DEFAULT_PAGE_PARAMETER
PageableHandlerMethodArgumentResolverSupport.DEFAULT_QUALIFIER_DELIMITER
.- Since:
- 1.6
- Author:
- Oliver Gierke, Nick Williams, Mark Paluch, Christoph Strobl
-
Constructor Summary
ConstructorDescriptionConstructs an instance of this resolved with a defaultSortHandlerMethodArgumentResolver
.PageableHandlerMethodArgumentResolver
(SortArgumentResolver sortResolver) Constructs an instance of this resolver with the specifiedSortArgumentResolver
.Constructs an instance of this resolver with the specifiedSortHandlerMethodArgumentResolver
. -
Method Summary
Modifier and TypeMethodDescriptionresolveArgument
(org.springframework.core.MethodParameter methodParameter, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.bind.support.WebDataBinderFactory binderFactory) Resolves aPageable
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.PageableHandlerMethodArgumentResolverSupport
getMaxPageSize, getPageable, getPageParameterName, getParameterNameToUse, getSizeParameterName, isFallbackPageable, isOneIndexedParameters, setFallbackPageable, setMaxPageSize, setOneIndexedParameters, setPageParameterName, setPrefix, setQualifierDelimiter, setSizeParameterName
-
Constructor Details
-
PageableHandlerMethodArgumentResolver
public PageableHandlerMethodArgumentResolver()Constructs an instance of this resolved with a defaultSortHandlerMethodArgumentResolver
. -
PageableHandlerMethodArgumentResolver
Constructs an instance of this resolver with the specifiedSortHandlerMethodArgumentResolver
.- Parameters:
sortResolver
- the sort resolver to use
-
PageableHandlerMethodArgumentResolver
Constructs an instance of this resolver with the specifiedSortArgumentResolver
.- Parameters:
sortResolver
- the sort resolver to use- Since:
- 1.13
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) - Specified by:
supportsParameter
in interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver
-
resolveArgument
public Pageable resolveArgument(org.springframework.core.MethodParameter methodParameter, @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:PageableArgumentResolver
Resolves aPageable
method parameter into an argument value from a given request.- Specified by:
resolveArgument
in interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver
- Specified by:
resolveArgument
in interfacePageableArgumentResolver
- Parameters:
methodParameter
- 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.
-