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
Modifier and TypeFieldDescriptionstatic final String
The default character encoding value.static final boolean
The default enable value.static final boolean
The default force suffix.static final boolean
The default force template mode.static final String
The default suffix.static final String
The prefix to use for configuration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
org.thymeleaf.templatemode.TemplateMode
boolean
enabled getter.void
setCacheable
(boolean cacheable) Sets whether templates are cacheable.void
setCacheTTL
(Duration duration) Sets the cache TTL as a duration.void
setCacheTTLMs
(long cacheTTLMs) Sets the cache TTL in millis.void
setCharacterEncoding
(String characterEncoding) Sets the character encoding to use.void
setCheckExistence
(boolean checkExistence) Sets whether templates should be checked for existence.void
setEnabled
(boolean enabled) Sets whether thymeleaf rendering is enabled.void
setForceSuffix
(boolean forceSuffix) Sets whether to force the suffix.void
setForceTemplateMode
(boolean forceTemplateMode) Sets whether to force template mode.void
Sets the suffix to use.void
setTemplateMode
(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:
getCharacterEncoding
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- the character encoding.
- See Also:
-
AbstractConfigurableTemplateResolver.getCharacterEncoding()
-
getTemplateMode
public org.thymeleaf.templatemode.TemplateMode getTemplateMode()- Specified by:
getTemplateMode
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- the template mode to be used.
- See Also:
-
AbstractConfigurableTemplateResolver.getTemplateMode()
-
getSuffix
- Specified by:
getSuffix
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- the suffix. Default value ".html"
- See Also:
-
AbstractConfigurableTemplateResolver.getSuffix()
-
getForceSuffix
public boolean getForceSuffix()- Specified by:
getForceSuffix
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- whether the suffix will be forced or not.
- See Also:
-
AbstractConfigurableTemplateResolver.getForceSuffix()
-
getForceTemplateMode
public boolean getForceTemplateMode()- Specified by:
getForceTemplateMode
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- whether the suffix will be forced or not.
- See Also:
-
AbstractConfigurableTemplateResolver.getForceTemplateMode()
-
getCacheTTLMs
- Specified by:
getCacheTTLMs
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- the cache TTL for resolved templates.
- See Also:
-
AbstractConfigurableTemplateResolver.getCacheTTLMs()
-
getCheckExistence
public boolean getCheckExistence()- Specified by:
getCheckExistence
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- true if resource existence will be checked, false if not
- See Also:
-
AbstractTemplateResolver.getCheckExistence()
-
getCacheable
public boolean getCacheable()- Specified by:
getCacheable
in interfaceThymeleafViewsRendererConfiguration
- Returns:
- whether templates resolved are cacheable or not.
- See Also:
-
AbstractConfigurableTemplateResolver.isCacheable()
-
isEnabled
public boolean isEnabled()enabled getter.- Specified by:
isEnabled
in interfaceio.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
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
-