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_PARAMETERPageableHandlerMethodArgumentResolverSupport.DEFAULT_QUALIFIER_DELIMITER.
Since:
1.6
Author:
Oliver Gierke, Nick Williams, Mark Paluch, Christoph Strobl
  • Constructor Details

    • PageableHandlerMethodArgumentResolver

      public PageableHandlerMethodArgumentResolver()
      Constructs an instance of this resolved with a default SortHandlerMethodArgumentResolver.
    • PageableHandlerMethodArgumentResolver

      public PageableHandlerMethodArgumentResolver(SortHandlerMethodArgumentResolver sortResolver)
      Constructs an instance of this resolver with the specified SortHandlerMethodArgumentResolver.
      Parameters:
      sortResolver - the sort resolver to use
    • PageableHandlerMethodArgumentResolver

      public PageableHandlerMethodArgumentResolver(@Nullable SortArgumentResolver sortResolver)
      Constructs an instance of this resolver with the specified SortArgumentResolver.
      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 interface org.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 a Pageable method parameter into an argument value from a given request.
      Specified by:
      resolveArgument in interface org.springframework.web.method.support.HandlerMethodArgumentResolver
      Specified by:
      resolveArgument in interface PageableArgumentResolver
      Parameters:
      methodParameter - the method parameter to resolve. This parameter must have previously been passed to HandlerMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter) which must have returned true.
      mavContainer - the ModelAndViewContainer for the current request
      webRequest - the current request
      binderFactory - a factory for creating WebDataBinder instances
      Returns:
      the resolved argument value.