Class ThymeleafViewsRendererConfigurationProperties

java.lang.Object
io.micronaut.views.thymeleaf.ThymeleafViewsRendererConfigurationProperties
All Implemented Interfaces:
io.micronaut.core.util.Toggleable, ThymeleafViewsRendererConfiguration

@ConfigurationProperties("micronaut.views.thymeleaf") public class ThymeleafViewsRendererConfigurationProperties extends Object implements ThymeleafViewsRendererConfiguration
ConfigurationProperties implementation of ThymeleafViewsRendererConfiguration.
Since:
1.0
Author:
Sergio del Amo
  • Field Details

    • PREFIX

      public static final String PREFIX
      The prefix to use for configuration.
      See Also:
    • DEFAULT_SUFFIX

      public static final String DEFAULT_SUFFIX
      The default suffix.
      See Also:
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      The default enable value.
      See Also:
    • DEFAULT_CHARACTER_ENCODING

      public static final String DEFAULT_CHARACTER_ENCODING
      The default character encoding value.
      See Also:
    • DEFAULT_FORCESUFFIX

      public static final boolean DEFAULT_FORCESUFFIX
      The default force suffix.
      See Also:
    • DEFAULT_FORCETEMPLATEMODE

      public static final boolean DEFAULT_FORCETEMPLATEMODE
      The default force template mode.
      See Also:
  • Constructor Details

    • ThymeleafViewsRendererConfigurationProperties

      public ThymeleafViewsRendererConfigurationProperties()
  • Method Details

    • getCharacterEncoding

      public String getCharacterEncoding()
      Specified by:
      getCharacterEncoding in interface ThymeleafViewsRendererConfiguration
      Returns:
      the character encoding.
      See Also:
      • AbstractConfigurableTemplateResolver.getCharacterEncoding()
    • getTemplateMode

      public org.thymeleaf.templatemode.TemplateMode getTemplateMode()
      Specified by:
      getTemplateMode in interface ThymeleafViewsRendererConfiguration
      Returns:
      the template mode to be used.
      See Also:
      • AbstractConfigurableTemplateResolver.getTemplateMode()
    • getSuffix

      public String getSuffix()
      Specified by:
      getSuffix in interface ThymeleafViewsRendererConfiguration
      Returns:
      the suffix. Default value ".html"
      See Also:
      • AbstractConfigurableTemplateResolver.getSuffix()
    • getForceSuffix

      public boolean getForceSuffix()
      Specified by:
      getForceSuffix in interface ThymeleafViewsRendererConfiguration
      Returns:
      whether the suffix will be forced or not.
      See Also:
      • AbstractConfigurableTemplateResolver.getForceSuffix()
    • getForceTemplateMode

      public boolean getForceTemplateMode()
      Specified by:
      getForceTemplateMode in interface ThymeleafViewsRendererConfiguration
      Returns:
      whether the suffix will be forced or not.
      See Also:
      • AbstractConfigurableTemplateResolver.getForceTemplateMode()
    • getCacheTTLMs

      public Long getCacheTTLMs()
      Specified by:
      getCacheTTLMs in interface ThymeleafViewsRendererConfiguration
      Returns:
      the cache TTL for resolved templates.
      See Also:
      • AbstractConfigurableTemplateResolver.getCacheTTLMs()
    • getCheckExistence

      public boolean getCheckExistence()
      Specified by:
      getCheckExistence in interface ThymeleafViewsRendererConfiguration
      Returns:
      true if resource existence will be checked, false if not
      See Also:
      • AbstractTemplateResolver.getCheckExistence()
    • getCacheable

      public boolean getCacheable()
      Specified by:
      getCacheable in interface ThymeleafViewsRendererConfiguration
      Returns:
      whether templates resolved are cacheable or not.
      See Also:
      • AbstractConfigurableTemplateResolver.isCacheable()
    • isEnabled

      public boolean isEnabled()
      enabled getter.
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
      Returns:
      boolean flag indicating whether ThymeleafViewsRenderer is enabled.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether thymeleaf rendering is enabled. Default value (true).
      Parameters:
      enabled - True if is enabled
    • setCharacterEncoding

      public void setCharacterEncoding(String characterEncoding)
      Sets the character encoding to use. Default value ("UTF-8").
      Parameters:
      characterEncoding - The character encoding
    • setTemplateMode

      public void setTemplateMode(org.thymeleaf.templatemode.TemplateMode templateMode)
      Sets the template mode.
      Parameters:
      templateMode - The template mode
    • setSuffix

      public void setSuffix(String suffix)
      Sets the suffix to use.
      Parameters:
      suffix - The suffix
    • setForceSuffix

      public void setForceSuffix(boolean forceSuffix)
      Sets whether to force the suffix. Default value (false).
      Parameters:
      forceSuffix - True if the suffix should be forced
    • setForceTemplateMode

      public void setForceTemplateMode(boolean forceTemplateMode)
      Sets whether to force template mode. Default value (false).
      Parameters:
      forceTemplateMode - True if template mode should be forced
    • setCacheable

      public void setCacheable(boolean cacheable)
      Sets whether templates are cacheable.
      Parameters:
      cacheable - True if they are cacheable
    • setCacheTTLMs

      public void setCacheTTLMs(long cacheTTLMs)
      Sets the cache TTL in millis.
      Parameters:
      cacheTTLMs - The cache millis
    • setCacheTTL

      public void setCacheTTL(Duration duration)
      Sets the cache TTL as a duration.
      Parameters:
      duration - The duration
    • setCheckExistence

      public void setCheckExistence(boolean checkExistence)
      Sets whether templates should be checked for existence.
      Parameters:
      checkExistence - True if they should be