Class PageableParameterBuilderPlugin

  • All Implemented Interfaces:
    org.springframework.plugin.core.Plugin<springfox.documentation.spi.DocumentationType>, springfox.documentation.spi.service.OperationBuilderPlugin

    public class PageableParameterBuilderPlugin
    extends Object
    implements springfox.documentation.spi.service.OperationBuilderPlugin
    The Springfox Plugin to resolve Pageable parameter into plain fields.
    • Constructor Detail

      • PageableParameterBuilderPlugin

        public PageableParameterBuilderPlugin​(springfox.documentation.schema.TypeNameExtractor nameExtractor,
                                              com.fasterxml.classmate.TypeResolver resolver)

        Constructor for PageableParameterBuilderPlugin.

        Parameters:
        nameExtractor - a TypeNameExtractor object.
        resolver - a TypeResolver object.
    • Method Detail

      • supports

        public boolean supports​(springfox.documentation.spi.DocumentationType delimiter)
        Specified by:
        supports in interface org.springframework.plugin.core.Plugin<springfox.documentation.spi.DocumentationType>
      • apply

        public void apply​(springfox.documentation.spi.service.contexts.OperationContext context)
        Specified by:
        apply in interface springfox.documentation.spi.service.OperationBuilderPlugin
      • getPageName

        protected String getPageName()
        Page name may be varied. See PageableHandlerMethodArgumentResolverSupport.setPageParameterName(String)
        Returns:
        The page parameter name
      • getSizeName

        protected String getSizeName()
        Size name may be varied. See PageableHandlerMethodArgumentResolverSupport.setSizeParameterName(String)
        Returns:
        The size parameter name
      • getSortName

        protected String getSortName()
        Sort name may be varied. See SortHandlerMethodArgumentResolverSupport.setSortParameter(String)
        Returns:
        The sort parameter name
      • createPageParameter

        protected springfox.documentation.service.Parameter createPageParameter​(springfox.documentation.spi.service.contexts.ParameterContext context)
        Create a page parameter. Override it if needed. Set a default value for example.
        Parameters:
        context - Pageable parameter context
        Returns:
        The page parameter
      • createSizeParameter

        protected springfox.documentation.service.Parameter createSizeParameter​(springfox.documentation.spi.service.contexts.ParameterContext context)
        Create a size parameter. Override it if needed. Set a default value for example.
        Parameters:
        context - Pageable parameter context
        Returns:
        The size parameter
      • createSortParameter

        protected springfox.documentation.service.Parameter createSortParameter​(springfox.documentation.spi.service.contexts.ParameterContext context)
        Create a sort parameter. Override it if needed. Set a default value or further description for example.
        Parameters:
        context - Pageable parameter context
        Returns:
        The sort parameter
      • createModelRefFactory

        protected Function<com.fasterxml.classmate.ResolvedType,​? extends springfox.documentation.schema.ModelReference> createModelRefFactory​(springfox.documentation.spi.service.contexts.ParameterContext context)

        createModelRefFactory.

        Parameters:
        context - a ParameterContext object.
        Returns:
        a Function object.