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 Object
implements ThymeleafViewsRendererConfiguration
ConfigurationProperties implementation of ThymeleafViewsRendererConfiguration.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default character encoding value.static final booleanThe default enable value.static final booleanThe default force suffix.static final booleanThe default force template mode.static final StringThe default suffix.static final StringThe prefix to use for configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanorg.thymeleaf.templatemode.TemplateModebooleanenabled getter.voidsetCacheable(boolean cacheable) Sets whether templates are cacheable.voidsetCacheTTL(Duration duration) Sets the cache TTL as a duration.voidsetCacheTTLMs(long cacheTTLMs) Sets the cache TTL in millis.voidsetCharacterEncoding(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.voidSets the suffix to use.voidsetTemplateMode(org.thymeleaf.templatemode.TemplateMode templateMode) Sets the template mode.
-
Field Details
-
PREFIX
The prefix to use for configuration.- See Also:
-
DEFAULT_SUFFIX
The default suffix.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_CHARACTER_ENCODING
The default character encoding value.- See Also:
-
DEFAULT_FORCESUFFIX
public static final boolean DEFAULT_FORCESUFFIXThe default force suffix.- See Also:
-
DEFAULT_FORCETEMPLATEMODE
public static final boolean DEFAULT_FORCETEMPLATEMODEThe default force template mode.- See Also:
-
-
Constructor Details
-
ThymeleafViewsRendererConfigurationProperties
public ThymeleafViewsRendererConfigurationProperties()
-
-
Method Details
-
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
- 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
- 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
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
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
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
-