Class AbstractViewConfig

java.lang.Object
io.micronaut.openapi.view.AbstractViewConfig
All Implemented Interfaces:
io.micronaut.core.util.Toggleable
Direct Known Subclasses:
OpenApiExplorerConfig, RapidocConfig, RapiPDFConfig, RedocConfig, SwaggerUIConfig

public abstract class AbstractViewConfig extends Object implements io.micronaut.core.util.Toggleable
Abstract View Config.
Author:
croudet
  • Field Details

    • prefix

      protected String prefix
    • jsUrl

      protected String jsUrl
    • specUrl

      protected String specUrl
    • urlPrefix

      protected String urlPrefix
      URL prefix from config properties.
    • fullUrlPrefix

      protected String fullUrlPrefix
      URL prefix for templates and resources.
    • resourcesContextPath

      protected String resourcesContextPath
    • templatePath

      protected String templatePath
    • isDefaultJsUrl

      protected boolean isDefaultJsUrl
    • copyResources

      protected boolean copyResources
    • withFinalUrlPrefixCache

      protected boolean withFinalUrlPrefixCache
    • primaryName

      protected String primaryName
    • withUrls

      protected Boolean withUrls
    • urls

    • options

      protected Map<String,Object> options
    • openApiInfos

      @Nullable protected @Nullable Map<Pair<String,String>,OpenApiInfo> openApiInfos
  • Constructor Details

    • AbstractViewConfig

      protected AbstractViewConfig(String prefix, Map<Pair<String,String>,OpenApiInfo> openApiInfos)
      An AbstractViewConfig.
      Parameters:
      prefix - The configuration key prefix.
      openApiInfos - Information about all generated openAPI files.
  • Method Details

    • getConverter

      protected abstract Function<String,Object> getConverter(String key)
      Returns the converter associated with the key.
      Parameters:
      key - A key.
      Returns:
      A converter or null.
    • getResources

      protected abstract List<String> getResources()
    • getTemplatePath

      public String getTemplatePath()
      Get template path.
      Returns:
      template path
    • render

      public abstract String render(String template, @Nullable @Nullable io.micronaut.inject.visitor.VisitorContext context)
    • addAttribute

      protected void addAttribute(Map.Entry<String,String> entry)
      Adds an option.
      Parameters:
      entry - The user specified entry.
    • toHtmlAttributes

      protected String toHtmlAttributes()
      Converts to html attributes.
      Returns:
      A String.
    • getFinalUrlPrefix

      protected String getFinalUrlPrefix(OpenApiViewConfig.RendererType rendererType, io.micronaut.inject.visitor.VisitorContext context)
      Calculate final URL prefix for resources.
      Parameters:
      rendererType - render type
      context - visitor context
      Returns:
      final URL prefix for resources
    • getUrls

      Get urls for resources.
      Returns:
      urls