Class SwaggerWebMvcConfigurer

java.lang.Object
org.springdoc.ui.AbstractSwaggerConfigurer
org.springdoc.webmvc.ui.SwaggerWebMvcConfigurer
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

public class SwaggerWebMvcConfigurer extends org.springdoc.ui.AbstractSwaggerConfigurer implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
The type Swagger web mvc configurer.
Author:
bnasslahsen
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springdoc.ui.AbstractSwaggerConfigurer

    org.springdoc.ui.AbstractSwaggerConfigurer.SwaggerResourceHandlerConfig
  • Constructor Summary

    Constructors
    Constructor
    Description
    SwaggerWebMvcConfigurer(org.springdoc.core.properties.SwaggerUiConfigProperties swaggerUiConfigProperties, org.springframework.boot.autoconfigure.web.WebProperties springWebProperties, org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties springWebMvcProperties, SwaggerIndexTransformer swaggerIndexTransformer, SwaggerResourceResolver swaggerResourceResolver, SwaggerWelcomeCommon swaggerWelcomeCommon)
    Instantiates a new Swagger web mvc configurer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
     
    void
    addCorsMappings(org.springframework.web.servlet.config.annotation.CorsRegistry registry)
     
    void
    addFormatters(org.springframework.format.FormatterRegistry registry)
     
    void
    addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
     
    void
    addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
     
    void
    addReturnValueHandlers(List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)
     
    protected void
    addSwaggerResourceHandler(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry, org.springdoc.ui.AbstractSwaggerConfigurer.SwaggerResourceHandlerConfig handlerConfig)
    Add a resource handler that uses the Swagger resource resolver and transformer.
    protected void
    addSwaggerResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry, org.springdoc.ui.AbstractSwaggerConfigurer.SwaggerResourceHandlerConfig... handlerConfigs)
    Add resource handlers that use the Swagger resource resolver and transformer.
    void
    addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
     
    void
    configureAsyncSupport(org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer configurer)
     
    void
    configureContentNegotiation(org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
     
    void
    configureDefaultServletHandling(org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer configurer)
     
    void
    configureHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)
     
    void
    configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
     
    void
    configurePathMatch(org.springframework.web.servlet.config.annotation.PathMatchConfigurer configurer)
     
    void
    configureViewResolvers(org.springframework.web.servlet.config.annotation.ViewResolverRegistry registry)
     
    void
    extendHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)
     
    void
    extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
     
    protected org.springframework.cache.Cache
    Gets the Swagger resource chain cache.
    org.springframework.validation.MessageCodesResolver
     
    protected String
     
    org.springframework.validation.Validator
     
    protected String
     

    Methods inherited from class org.springdoc.ui.AbstractSwaggerConfigurer

    combinePatterns, getSwaggerHandlerConfigs, getSwaggerWebjarHandlerConfigs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addErrorResponseInterceptors
  • Constructor Details

    • SwaggerWebMvcConfigurer

      public SwaggerWebMvcConfigurer(org.springdoc.core.properties.SwaggerUiConfigProperties swaggerUiConfigProperties, org.springframework.boot.autoconfigure.web.WebProperties springWebProperties, org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties springWebMvcProperties, SwaggerIndexTransformer swaggerIndexTransformer, SwaggerResourceResolver swaggerResourceResolver, SwaggerWelcomeCommon swaggerWelcomeCommon)
      Instantiates a new Swagger web mvc configurer.
      Parameters:
      swaggerUiConfigProperties - the swagger ui calculated config
      springWebProperties - the spring web config
      springWebMvcProperties - the spring mvc config
      swaggerIndexTransformer - the swagger index transformer
      swaggerResourceResolver - the swagger resource resolver
      swaggerWelcomeCommon - the swagger welcome common
  • Method Details

    • addResourceHandlers

      public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
      Specified by:
      addResourceHandlers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addSwaggerResourceHandlers

      protected void addSwaggerResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry, org.springdoc.ui.AbstractSwaggerConfigurer.SwaggerResourceHandlerConfig... handlerConfigs)
      Add resource handlers that use the Swagger resource resolver and transformer.
      Parameters:
      registry - the resource handler registry.
      handlerConfigs - the swagger handler configs.
    • addSwaggerResourceHandler

      protected void addSwaggerResourceHandler(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry, org.springdoc.ui.AbstractSwaggerConfigurer.SwaggerResourceHandlerConfig handlerConfig)
      Add a resource handler that uses the Swagger resource resolver and transformer.
      Parameters:
      registry - the resource handler registry.
      handlerConfig - the swagger handler config.
    • getUiRootPath

      protected String getUiRootPath()
      Specified by:
      getUiRootPath in class org.springdoc.ui.AbstractSwaggerConfigurer
    • getWebjarsPathPattern

      protected String getWebjarsPathPattern()
      Specified by:
      getWebjarsPathPattern in class org.springdoc.ui.AbstractSwaggerConfigurer
    • getCache

      protected org.springframework.cache.Cache getCache()
      Gets the Swagger resource chain cache.
      Returns:
      the cache.
    • configurePathMatch

      public void configurePathMatch(org.springframework.web.servlet.config.annotation.PathMatchConfigurer configurer)
      Specified by:
      configurePathMatch in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureContentNegotiation

      public void configureContentNegotiation(org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
      Specified by:
      configureContentNegotiation in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureAsyncSupport

      public void configureAsyncSupport(org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer configurer)
      Specified by:
      configureAsyncSupport in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureDefaultServletHandling

      public void configureDefaultServletHandling(org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer configurer)
      Specified by:
      configureDefaultServletHandling in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addFormatters

      public void addFormatters(org.springframework.format.FormatterRegistry registry)
      Specified by:
      addFormatters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addInterceptors

      public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
      Specified by:
      addInterceptors in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addCorsMappings

      public void addCorsMappings(org.springframework.web.servlet.config.annotation.CorsRegistry registry)
      Specified by:
      addCorsMappings in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addViewControllers

      public void addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
      Specified by:
      addViewControllers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureViewResolvers

      public void configureViewResolvers(org.springframework.web.servlet.config.annotation.ViewResolverRegistry registry)
      Specified by:
      configureViewResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addArgumentResolvers

      public void addArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> argumentResolvers)
      Specified by:
      addArgumentResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addReturnValueHandlers

      public void addReturnValueHandlers(List<org.springframework.web.method.support.HandlerMethodReturnValueHandler> returnValueHandlers)
      Specified by:
      addReturnValueHandlers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureMessageConverters

      public void configureMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
      Specified by:
      configureMessageConverters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • extendMessageConverters

      public void extendMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
      Specified by:
      extendMessageConverters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • configureHandlerExceptionResolvers

      public void configureHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)
      Specified by:
      configureHandlerExceptionResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • extendHandlerExceptionResolvers

      public void extendHandlerExceptionResolvers(List<org.springframework.web.servlet.HandlerExceptionResolver> exceptionResolvers)
      Specified by:
      extendHandlerExceptionResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • getValidator

      @Nullable public org.springframework.validation.Validator getValidator()
      Specified by:
      getValidator in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • getMessageCodesResolver

      @Nullable public org.springframework.validation.MessageCodesResolver getMessageCodesResolver()
      Specified by:
      getMessageCodesResolver in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer