Package io.micronaut.views.thymeleaf
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 java.lang.Object implements ThymeleafViewsRendererConfigurationConfigurationPropertiesimplementation ofThymeleafViewsRendererConfiguration.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_CHARACTER_ENCODINGThe default character encoding value.static booleanDEFAULT_ENABLEDThe default enable value.static booleanDEFAULT_FORCESUFFIXThe default force suffix.static booleanDEFAULT_FORCETEMPLATEMODEThe default force template mode.static java.lang.StringDEFAULT_SUFFIXThe default suffix.static java.lang.StringPREFIXThe prefix to use for configuration.
-
Constructor Summary
Constructors Constructor Description ThymeleafViewsRendererConfigurationProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCacheable()java.lang.LonggetCacheTTLMs()java.lang.StringgetCharacterEncoding()booleangetCheckExistence()booleangetForceSuffix()booleangetForceTemplateMode()java.lang.StringgetSuffix()org.thymeleaf.templatemode.TemplateModegetTemplateMode()booleanisEnabled()enabled getter.voidsetCacheable(boolean cacheable)Sets whether templates are cacheable.voidsetCacheTTL(java.time.Duration duration)Sets the cache TTL as a duration.voidsetCacheTTLMs(long cacheTTLMs)Sets the cache TTL in millis.voidsetCharacterEncoding(java.lang.String characterEncoding)Sets the character encoding to use.voidsetCheckExistence(boolean checkExistence)Sets whether templates should be checked for existence.voidsetEnabled(boolean enabled)Sets whether thymeleaf rendering is enabled.voidsetForceSuffix(boolean forceSuffix)Sets whether to force the suffix.voidsetForceTemplateMode(boolean forceTemplateMode)Sets whether to force template mode.voidsetSuffix(java.lang.String suffix)Sets the suffix to use.voidsetTemplateMode(org.thymeleaf.templatemode.TemplateMode templateMode)Sets the template mode.
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
The prefix to use for configuration.- See Also:
- Constant Field Values
-
DEFAULT_SUFFIX
public static final java.lang.String DEFAULT_SUFFIX
The default suffix.- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
DEFAULT_CHARACTER_ENCODING
public static final java.lang.String DEFAULT_CHARACTER_ENCODING
The default character encoding value.- See Also:
- Constant Field Values
-
DEFAULT_FORCESUFFIX
public static final boolean DEFAULT_FORCESUFFIX
The default force suffix.- See Also:
- Constant Field Values
-
DEFAULT_FORCETEMPLATEMODE
public static final boolean DEFAULT_FORCETEMPLATEMODE
The default force template mode.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()
- Specified by:
getCharacterEncodingin interfaceThymeleafViewsRendererConfiguration- Returns:
- the character encoding.
- See Also:
AbstractConfigurableTemplateResolver.getCharacterEncoding()
-
getTemplateMode
public org.thymeleaf.templatemode.TemplateMode getTemplateMode()
- Specified by:
getTemplateModein interfaceThymeleafViewsRendererConfiguration- Returns:
- the template mode to be used.
- See Also:
AbstractConfigurableTemplateResolver.getTemplateMode()
-
getSuffix
public java.lang.String getSuffix()
- Specified by:
getSuffixin interfaceThymeleafViewsRendererConfiguration- Returns:
- the suffix. Default value ".html"
- See Also:
AbstractConfigurableTemplateResolver.getSuffix()
-
getForceSuffix
public boolean getForceSuffix()
- Specified by:
getForceSuffixin interfaceThymeleafViewsRendererConfiguration- Returns:
- whether the suffix will be forced or not.
- See Also:
AbstractConfigurableTemplateResolver.getForceSuffix()
-
getForceTemplateMode
public boolean getForceTemplateMode()
- Specified by:
getForceTemplateModein interfaceThymeleafViewsRendererConfiguration- Returns:
- whether the suffix will be forced or not.
- See Also:
AbstractConfigurableTemplateResolver.getForceTemplateMode()
-
getCacheTTLMs
public java.lang.Long getCacheTTLMs()
- Specified by:
getCacheTTLMsin interfaceThymeleafViewsRendererConfiguration- Returns:
- the cache TTL for resolved templates.
- See Also:
AbstractConfigurableTemplateResolver.getCacheTTLMs()
-
getCheckExistence
public boolean getCheckExistence()
- Specified by:
getCheckExistencein interfaceThymeleafViewsRendererConfiguration- Returns:
- true if resource existence will be checked, false if not
- See Also:
AbstractTemplateResolver.getCheckExistence()
-
getCacheable
public boolean getCacheable()
- Specified by:
getCacheablein interfaceThymeleafViewsRendererConfiguration- Returns:
- whether templates resolved are cacheable or not.
- See Also:
AbstractConfigurableTemplateResolver.isCacheable()
-
isEnabled
public boolean isEnabled()
enabled getter.- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable- Returns:
- boolean flag indicating whether
ThymeleafViewsRendereris 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(java.lang.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(java.lang.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(java.time.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
-
-