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 Details

    • SortHandlerMethodArgumentResolver

      public SortHandlerMethodArgumentResolver()
  • Method Details

    • supportsParameter

      public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
      Specified by:
      supportsParameter in interface org.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 a Sort 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 SortArgumentResolver
      Parameters:
      parameter - 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