org.thymeleaf.templateresolver
Class TemplateResolver

Object
  extended by org.thymeleaf.templateresolver.AbstractTemplateResolver
      extended by org.thymeleaf.templateresolver.TemplateResolver
All Implemented Interfaces:
ITemplateResolver
Direct Known Subclasses:
ClassLoaderTemplateResolver, FileTemplateResolver, ServletContextTemplateResolver, UrlTemplateResolver

public class TemplateResolver
extends AbstractTemplateResolver

Basic implementation of ITemplateResolver.

This class can be used both directly and as a parent class for other Template Resolver implementations.

Unless overriden, this class will always apply the following validity to template resolutions:

Since:
1.0
Author:
Daniel Fernández

Field Summary
static Long DEFAULT_CACHE_TTL_MS
           Default value for the cache TTL: null.
static boolean DEFAULT_CACHEABLE
           Default value for the cacheable flag: true.
static String DEFAULT_TEMPLATE_MODE
           Default template mode: XHTML
 
Constructor Summary
TemplateResolver()
           
 
Method Summary
 void addTemplateAlias(String alias, String templateName)
           Adds a new template alias to the currently configured ones.
 void clearTemplateAliases()
           Removes all currently configured template aliases.
protected  String computeCharacterEncoding(TemplateProcessingParameters templateProcessingParameters)
           Computes the character encoding that should be applied when reading template resource, according to existing configuration.
protected  String computeResourceName(TemplateProcessingParameters templateProcessingParameters)
           Computes the resource name from the template name, applying aliases, prefix/suffix, or any other artifacts the Template Resolver might need to apply.
protected  IResourceResolver computeResourceResolver(TemplateProcessingParameters templateProcessingParameters)
           Computes the resource resolver that should be applied to a template, according to existing configuration.
protected  String computeTemplateMode(TemplateProcessingParameters templateProcessingParameters)
           Computes the template mode that should be applied to a template, according to existing configuration.
protected  ITemplateResolutionValidity computeValidity(TemplateProcessingParameters templateProcessingParameters)
           Computes the validity to be applied to the template resolution.
 java.util.Set<String> getCacheablePatterns()
           Returns the patterns (as String) specified for establishing which templates have to be considered cacheable.
 PatternSpec getCacheablePatternSpec()
           Returns the pattern spec specified for establishing which templates have to be considered cacheable.
 Long getCacheTTLMs()
           Returns the TTL (Time To Live) in cache of templates resolved by this resolver.
 String getCharacterEncoding()
           Returns the character encoding to be used for reading template resources resolved by this template resolver.
 java.util.Set<String> getHtml5TemplateModePatterns()
           Returns the patterns specified for establishing the HTML5 (correct, XML-formed HTML5) template mode to resolved templates.
 PatternSpec getHtml5TemplateModePatternSpec()
           Returns the pattern spec specified for establishing the HTML5 (correct, XML-formed HTML5) template mode to resolved templates.
 java.util.Set<String> getLegacyHtml5TemplateModePatterns()
           Returns the patterns specified for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode to resolved templates.
 PatternSpec getLegacyHtml5TemplateModePatternSpec()
           Returns the pattern spec specified for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode to resolved templates.
 java.util.Set<String> getNonCacheablePatterns()
           Returns the patterns (as String) specified for establishing which templates have to be considered non cacheable.
 PatternSpec getNonCacheablePatternSpec()
           Returns the pattern spec specified for establishing which templates have to be considered non cacheable.
 String getPrefix()
           Returns the (optional) prefix to be added to all template names in order to convert template names into resource names.
 IResourceResolver getResourceResolver()
           Returns the Resource Resolver (implementation of IResourceResolver) that will be used to resolve the resource names that are assigned to templates resolved by this template resolver.
 String getSuffix()
           Returns the (optional) suffix to be added to all template names in order to convert template names into resource names.
 java.util.Map<String,String> getTemplateAliases()
           Returns the currently configured template aliases.
 String getTemplateMode()
           Returns the template mode to be applied to templates resolved by this template resolver.
 java.util.Set<String> getValidXhtmlTemplateModePatterns()
           Returns the patterns specified for establishing the VALIDXHTML (validated XHTML) template mode to resolved templates.
 PatternSpec getValidXhtmlTemplateModePatternSpec()
           Returns the pattern spec specified for establishing the VALIDXHTML (validated XHTML) template mode to resolved templates.
 java.util.Set<String> getValidXmlTemplateModePatterns()
           Returns the patterns specified for establishing the VALIDXML (validated XML) template mode to resolved templates.
 PatternSpec getValidXmlTemplateModePatternSpec()
           Returns the pattern spec specified for establishing the VALIDXML (validated XML) template mode to resolved templates.
 java.util.Set<String> getXhtmlTemplateModePatterns()
           Returns the patterns specified for establishing the XHTML template mode to resolved templates.
 PatternSpec getXhtmlTemplateModePatternSpec()
           Returns the pattern spec specified for establishing the XHTML template mode to resolved templates.
 java.util.Set<String> getXmlTemplateModePatterns()
           Returns the patterns specified for establishing the XML template mode to resolved templates.
 PatternSpec getXmlTemplateModePatternSpec()
           Returns the pattern spec specified for establishing the XML template mode to resolved templates.
protected  void initializeSpecific()
           Initialize this template resolver.
protected  void initializeSpecificAdditional()
           Initialize specific aspects of a subclass.
 boolean isCacheable()
           Returns whether templates resolved by this resolver have to be considered cacheable or not.
 void setCacheable(boolean cacheable)
           Sets a new value for the cacheable flag.
 void setCacheablePatterns(java.util.Set<String> cacheablePatterns)
           Sets the new patterns to be applied for establishing which templates have to be considered cacheable These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)).
 void setCacheTTLMs(Long cacheTTLMs)
           Sets a new value for the cache TTL for resolved templates.
 void setCharacterEncoding(String characterEncoding)
           Sets a new character encoding for reading template resources.
 void setHtml5TemplateModePatterns(java.util.Set<String> newHtml5TemplatesModePatterns)
           Sets the new patterns to be applied for establishing the HTML5 (correct, XML-formed HTML5) template mode as Strings.
 void setLegacyHtml5TemplateModePatterns(java.util.Set<String> newLegacyHtml5TemplatesModePatterns)
           Sets the new patterns to be applied for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode as Strings.
 void setNonCacheablePatterns(java.util.Set<String> nonCacheablePatterns)
           Sets the new patterns to be applied for establishing which templates have to be considered non cacheable These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)).
 void setPrefix(String prefix)
           Sets a new (optional) prefix to be added to all template names in order to convert template names into resource names.
 void setResourceResolver(IResourceResolver resourceResolver)
           Sets the resource resolver to be included into TemplateResolution results.
 void setSuffix(String suffix)
           Sets a new (optional) suffix to be added to all template names in order to convert template names into resource names.
 void setTemplateAliases(java.util.Map<String,String> templateAliases)
           Sets all the new template aliases to be used.
 void setTemplateMode(String templateMode)
           Sets the template mode to be applied to templates resolved by this resolver.
 void setTemplateMode(TemplateMode templateMode)
          Deprecated. This method has been deprecated as of 2.0.0. Use setTemplateMode(String) instead.
 void setValidXhtmlTemplateModePatterns(java.util.Set<String> newValidXhtmlTemplatesModePatterns)
           Sets the new patterns to be applied for establishing the VALIDXHTML (validated XHTML) template mode as Strings.
 void setValidXmlTemplateModePatterns(java.util.Set<String> newValidXmlTemplatesModePatterns)
           Sets the new patterns to be applied for establishing the VALIDXML (validated XML) template mode as Strings.
 void setXhtmlTemplateModePatterns(java.util.Set<String> newXhtmlTemplatesModePatterns)
           Sets the new patterns to be applied for establishing the XHTML template mode as Strings.
 void setXmlTemplateModePatterns(java.util.Set<String> newXmlTemplatesModePatterns)
           Sets the new patterns to be applied for establishing the XML template mode as Strings.
protected  Long unsafeGetCacheTTLMs()
           Uninitialized method meant only for use by subclasses.
protected  String unsafeGetCharacterEncoding()
           Uninitialized method meant only for use by subclasses.
protected  String unsafeGetPrefix()
           Uninitialized method meant only for use by subclasses.
protected  IResourceResolver unsafeGetResourceResolver()
           Uninitialized method meant only for use by subclasses.
protected  String unsafeGetSuffix()
           Uninitialized method meant only for use by subclasses.
protected  String unsafeGetTemplateMode()
           Uninitialized method meant only for use by subclasses.
protected  boolean unsafeIsCacheable()
           Uninitialized method meant only for use by subclasses.
 
Methods inherited from class org.thymeleaf.templateresolver.AbstractTemplateResolver
checkInitialized, checkNotInitialized, computeResolvable, getName, getOrder, getResolvablePatterns, getResolvablePatternSpec, initialize, isInitialized, resolveTemplate, setName, setOrder, setResolvablePatterns, unsafeGetName, unsafeGetOrder
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEMPLATE_MODE

public static final String DEFAULT_TEMPLATE_MODE

Default template mode: XHTML


DEFAULT_CACHEABLE

public static final boolean DEFAULT_CACHEABLE

Default value for the cacheable flag: true.

See Also:
Constant Field Values

DEFAULT_CACHE_TTL_MS

public static final Long DEFAULT_CACHE_TTL_MS

Default value for the cache TTL: null. This means the parsed template will live in cache until removed by LRU (because of being the oldest entry).

Constructor Detail

TemplateResolver

public TemplateResolver()
Method Detail

initializeSpecific

protected final void initializeSpecific()

Initialize this template resolver.

Once initialized the configuration parameters of this template resolvers cannot be changed.

Initialization is automatically triggered by the Template Engine before processing the first template.

Overrides:
initializeSpecific in class AbstractTemplateResolver

initializeSpecificAdditional

protected void initializeSpecificAdditional()

Initialize specific aspects of a subclass. This method is called during initialization of TemplateResolver (AbstractTemplateResolver.initialize()) and is meant for being overridden by subclasses.


getPrefix

public final String getPrefix()

Returns the (optional) prefix to be added to all template names in order to convert template names into resource names.

Returns:
the prefix.

unsafeGetPrefix

protected final String unsafeGetPrefix()

Uninitialized method meant only for use by subclasses.

Returns:
the prefix

setPrefix

public void setPrefix(String prefix)

Sets a new (optional) prefix to be added to all template names in order to convert template names into resource names.

Parameters:
prefix - the prefix to be set.

getSuffix

public final String getSuffix()

Returns the (optional) suffix to be added to all template names in order to convert template names into resource names.

Returns:
the suffix.

unsafeGetSuffix

protected final String unsafeGetSuffix()

Uninitialized method meant only for use by subclasses.

Returns:
the suffix

setSuffix

public void setSuffix(String suffix)

Sets a new (optional) suffix to be added to all template names in order to convert template names into resource names.

Parameters:
suffix - the suffix to be set.

getCharacterEncoding

public final String getCharacterEncoding()

Returns the character encoding to be used for reading template resources resolved by this template resolver.

Returns:
the character encoding.

unsafeGetCharacterEncoding

protected final String unsafeGetCharacterEncoding()

Uninitialized method meant only for use by subclasses.

Returns:
the character encoding

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)

Sets a new character encoding for reading template resources.

Parameters:
characterEncoding - the character encoding to be used.

getTemplateMode

public final String getTemplateMode()

Returns the template mode to be applied to templates resolved by this template resolver.

If template mode patterns (see setXhtmlTemplateModePatterns(Set), setHtml5TemplateModePatterns(Set), etc.) are also set, they have higher priority than the template mode set here (this would act as a default).

Returns:
the template mode to be used.

unsafeGetTemplateMode

protected final String unsafeGetTemplateMode()

Uninitialized method meant only for use by subclasses.

Returns:
the template mode

setTemplateMode

public void setTemplateMode(String templateMode)

Sets the template mode to be applied to templates resolved by this resolver.

The set of available template modes is variable, as these can be established by the user by means of adding TemplateModeHandler objects to the engine. Nevertheless, there is a standard set of template modes defined by the StandardTemplateModeHandlers class.

If template mode patterns (see setXhtmlTemplateModePatterns(Set), setHtml5TemplateModePatterns(Set), etc.) are also set, they have higher priority than the template mode set here (this would act as a default).

Parameters:
templateMode - the template mode.

setTemplateMode

@Deprecated
public void setTemplateMode(TemplateMode templateMode)
Deprecated. This method has been deprecated as of 2.0.0. Use setTemplateMode(String) instead.

Sets the template mode to be applied to templates resolved by this resolver.

If template mode patterns (see setXhtmlTemplateModePatterns(Set), setHtml5TemplateModePatterns(Set), etc.) are also set, they have higher priority than the template mode set here (this would act as a default).

Parameters:
templateMode -

isCacheable

public final boolean isCacheable()

Returns whether templates resolved by this resolver have to be considered cacheable or not.

If cacheable patterns (see setCacheablePatterns(Set)) are also set, they have higher priority than the value set here (this would act as a default).

Returns:
whether templates resolved are cacheable or not.

unsafeIsCacheable

protected final boolean unsafeIsCacheable()

Uninitialized method meant only for use by subclasses.

Returns:
whether templates resolved are cacheable or not.

setCacheable

public void setCacheable(boolean cacheable)

Sets a new value for the cacheable flag.

If cacheable patterns (see setCacheablePatterns(Set)) are also set, they have higher priority than the value set here (this would act as a default).

Parameters:
cacheable - whether resolved patterns should be considered cacheable or not.

getCacheTTLMs

public final Long getCacheTTLMs()

Returns the TTL (Time To Live) in cache of templates resolved by this resolver.

If a template is resolved as cacheable but cache TTL is null, this means the template will live in cache until evicted by LRU (Least Recently Used) algorithm for being the oldest entry in cache.

Returns:
the cache TTL for resolved templates.

unsafeGetCacheTTLMs

protected final Long unsafeGetCacheTTLMs()

Uninitialized method meant only for use by subclasses.

Returns:
the cache TTl for resolved templates.

setCacheTTLMs

public void setCacheTTLMs(Long cacheTTLMs)

Sets a new value for the cache TTL for resolved templates.

If a template is resolved as cacheable but cache TTL is null, this means the template will live in cache until evicted by LRU (Least Recently Used) algorithm for being the oldest entry in cache.

Parameters:
cacheTTLMs - the new cache TTL, or null for using natural LRU eviction.

getTemplateAliases

public final java.util.Map<String,String> getTemplateAliases()

Returns the currently configured template aliases.

Template aliases allow the use of several (and probably shorter) names for templates.

Aliases are applied to template names before prefix/suffix.

Returns:
the map of template aliases.

setTemplateAliases

public void setTemplateAliases(java.util.Map<String,String> templateAliases)

Sets all the new template aliases to be used.

Template aliases allow the use of several (and probably shorter) names for templates.

Aliases are applied to template names before prefix/suffix.

Parameters:
templateAliases - the new template aliases.

addTemplateAlias

public void addTemplateAlias(String alias,
                             String templateName)

Adds a new template alias to the currently configured ones.

Parameters:
alias - the new alias name
templateName - the name of the template the alias will be applied to

clearTemplateAliases

public void clearTemplateAliases()

Removes all currently configured template aliases.


getXmlTemplateModePatternSpec

public final PatternSpec getXmlTemplateModePatternSpec()

Returns the pattern spec specified for establishing the XML template mode to resolved templates.

Returns:
the pattern spec

getXmlTemplateModePatterns

public final java.util.Set<String> getXmlTemplateModePatterns()

Returns the patterns specified for establishing the XML template mode to resolved templates.

This is a convenience method equivalent to getXmlTemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setXmlTemplateModePatterns

public final void setXmlTemplateModePatterns(java.util.Set<String> newXmlTemplatesModePatterns)

Sets the new patterns to be applied for establishing the XML template mode as Strings.

This is a convenience method equivalent to getXmlTemplateModePatternSpec().setPatterns(Set)

Parameters:
newXmlTemplatesModePatterns - the new patterns

getValidXmlTemplateModePatternSpec

public final PatternSpec getValidXmlTemplateModePatternSpec()

Returns the pattern spec specified for establishing the VALIDXML (validated XML) template mode to resolved templates.

Returns:
the pattern spec

getValidXmlTemplateModePatterns

public final java.util.Set<String> getValidXmlTemplateModePatterns()

Returns the patterns specified for establishing the VALIDXML (validated XML) template mode to resolved templates.

This is a convenience method equivalent to getValidXmlTemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setValidXmlTemplateModePatterns

public final void setValidXmlTemplateModePatterns(java.util.Set<String> newValidXmlTemplatesModePatterns)

Sets the new patterns to be applied for establishing the VALIDXML (validated XML) template mode as Strings.

This is a convenience method equivalent to getValidXmlTemplateModePatternSpec().setPatterns(Set)

Parameters:
newValidXmlTemplatesModePatterns - the new patterns

getXhtmlTemplateModePatternSpec

public final PatternSpec getXhtmlTemplateModePatternSpec()

Returns the pattern spec specified for establishing the XHTML template mode to resolved templates.

Returns:
the pattern spec

getXhtmlTemplateModePatterns

public final java.util.Set<String> getXhtmlTemplateModePatterns()

Returns the patterns specified for establishing the XHTML template mode to resolved templates.

This is a convenience method equivalent to getXhtmlTemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setXhtmlTemplateModePatterns

public final void setXhtmlTemplateModePatterns(java.util.Set<String> newXhtmlTemplatesModePatterns)

Sets the new patterns to be applied for establishing the XHTML template mode as Strings.

This is a convenience method equivalent to getXhtmlTemplateModePatternSpec().setPatterns(Set)

Parameters:
newXhtmlTemplatesModePatterns - the new patterns

getValidXhtmlTemplateModePatternSpec

public final PatternSpec getValidXhtmlTemplateModePatternSpec()

Returns the pattern spec specified for establishing the VALIDXHTML (validated XHTML) template mode to resolved templates.

Returns:
the pattern spec

getValidXhtmlTemplateModePatterns

public final java.util.Set<String> getValidXhtmlTemplateModePatterns()

Returns the patterns specified for establishing the VALIDXHTML (validated XHTML) template mode to resolved templates.

This is a convenience method equivalent to getValidXhtmlTemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setValidXhtmlTemplateModePatterns

public final void setValidXhtmlTemplateModePatterns(java.util.Set<String> newValidXhtmlTemplatesModePatterns)

Sets the new patterns to be applied for establishing the VALIDXHTML (validated XHTML) template mode as Strings.

This is a convenience method equivalent to getValidXhtmlTemplateModePatternSpec().setPatterns(Set)

Parameters:
newValidXhtmlTemplatesModePatterns - the new patterns

getLegacyHtml5TemplateModePatternSpec

public final PatternSpec getLegacyHtml5TemplateModePatternSpec()

Returns the pattern spec specified for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode to resolved templates.

Returns:
the pattern spec

getLegacyHtml5TemplateModePatterns

public final java.util.Set<String> getLegacyHtml5TemplateModePatterns()

Returns the patterns specified for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode to resolved templates.

This is a convenience method equivalent to getLegacyHtml5TemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setLegacyHtml5TemplateModePatterns

public final void setLegacyHtml5TemplateModePatterns(java.util.Set<String> newLegacyHtml5TemplatesModePatterns)

Sets the new patterns to be applied for establishing the LEGACYHTML5 (non-XML-formed HTML5 that needs HTML-to-XML conversion) template mode as Strings.

This is a convenience method equivalent to getLegacyHtml5TemplateModePatternSpec().setPatterns(Set)

Parameters:
newLegacyHtml5TemplatesModePatterns - the new patterns

getHtml5TemplateModePatternSpec

public final PatternSpec getHtml5TemplateModePatternSpec()

Returns the pattern spec specified for establishing the HTML5 (correct, XML-formed HTML5) template mode to resolved templates.

Returns:
the pattern spec

getHtml5TemplateModePatterns

public final java.util.Set<String> getHtml5TemplateModePatterns()

Returns the patterns specified for establishing the HTML5 (correct, XML-formed HTML5) template mode to resolved templates.

This is a convenience method equivalent to getHtml5TemplateModePatternSpec().getPatterns()

Returns:
the pattern spec

setHtml5TemplateModePatterns

public final void setHtml5TemplateModePatterns(java.util.Set<String> newHtml5TemplatesModePatterns)

Sets the new patterns to be applied for establishing the HTML5 (correct, XML-formed HTML5) template mode as Strings.

This is a convenience method equivalent to getHtml5TemplateModePatternSpec().setPatterns(Set)

Parameters:
newHtml5TemplatesModePatterns - the new patterns

getCacheablePatternSpec

public final PatternSpec getCacheablePatternSpec()

Returns the pattern spec specified for establishing which templates have to be considered cacheable.

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

Returns:
the pattern spec

getCacheablePatterns

public final java.util.Set<String> getCacheablePatterns()

Returns the patterns (as String) specified for establishing which templates have to be considered cacheable.

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

This is a convenience method equivalent to getCacheablePatternSpec().getPatterns()

Returns:
the patterns

setCacheablePatterns

public final void setCacheablePatterns(java.util.Set<String> cacheablePatterns)

Sets the new patterns to be applied for establishing which templates have to be considered cacheable

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

This is a convenience method equivalent to getCacheablePatternSpec().setPatterns(Set)

Parameters:
cacheablePatterns - the new patterns

getNonCacheablePatternSpec

public final PatternSpec getNonCacheablePatternSpec()

Returns the pattern spec specified for establishing which templates have to be considered non cacheable.

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

Returns:
the pattern spec

getNonCacheablePatterns

public final java.util.Set<String> getNonCacheablePatterns()

Returns the patterns (as String) specified for establishing which templates have to be considered non cacheable.

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

This is a convenience method equivalent to getNonCacheablePatternSpec().getPatterns()

Returns:
the patterns

setNonCacheablePatterns

public final void setNonCacheablePatterns(java.util.Set<String> nonCacheablePatterns)

Sets the new patterns to be applied for establishing which templates have to be considered non cacheable

These patterns have higher precedence than the cacheable flag (see setCacheable(boolean)). Such flag can be considered a default value after cacheable patterns and non-cacheable patterns have been applied.

This is a convenience method equivalent to getNonCacheablePatternSpec().setPatterns(Set)

Parameters:
nonCacheablePatterns - the new patterns

getResourceResolver

public IResourceResolver getResourceResolver()

Returns the Resource Resolver (implementation of IResourceResolver) that will be used to resolve the resource names that are assigned to templates resolved by this template resolver.

Returns:
the resource resolver

unsafeGetResourceResolver

protected IResourceResolver unsafeGetResourceResolver()

Uninitialized method meant only for use by subclasses.

Returns:
the resource resolver

setResourceResolver

public void setResourceResolver(IResourceResolver resourceResolver)

Sets the resource resolver to be included into TemplateResolution results.

Parameters:
resourceResolver - the new resource resolver.

computeResourceName

protected String computeResourceName(TemplateProcessingParameters templateProcessingParameters)
Description copied from class: AbstractTemplateResolver

Computes the resource name from the template name, applying aliases, prefix/suffix, or any other artifacts the Template Resolver might need to apply.

Specified by:
computeResourceName in class AbstractTemplateResolver
Parameters:
templateProcessingParameters - the template processing parameters
Returns:
the resource name

computeTemplateMode

protected String computeTemplateMode(TemplateProcessingParameters templateProcessingParameters)
Description copied from class: AbstractTemplateResolver

Computes the template mode that should be applied to a template, according to existing configuration.

Specified by:
computeTemplateMode in class AbstractTemplateResolver
Parameters:
templateProcessingParameters - the template processing parameters
Returns:
the template mode to be applied

computeValidity

protected ITemplateResolutionValidity computeValidity(TemplateProcessingParameters templateProcessingParameters)
Description copied from class: AbstractTemplateResolver

Computes the validity to be applied to the template resolution. This includes determining whether the template can be cached or not, and also in what circumstances (for instance, for how much time) can its cache entry be considered valid.

Specified by:
computeValidity in class AbstractTemplateResolver
Parameters:
templateProcessingParameters - the template processing parameters
Returns:
the validity

computeResourceResolver

protected IResourceResolver computeResourceResolver(TemplateProcessingParameters templateProcessingParameters)
Description copied from class: AbstractTemplateResolver

Computes the resource resolver that should be applied to a template, according to existing configuration.

Specified by:
computeResourceResolver in class AbstractTemplateResolver
Parameters:
templateProcessingParameters - the template processing parameters
Returns:
the resource resolver to be applied

computeCharacterEncoding

protected String computeCharacterEncoding(TemplateProcessingParameters templateProcessingParameters)
Description copied from class: AbstractTemplateResolver

Computes the character encoding that should be applied when reading template resource, according to existing configuration.

Specified by:
computeCharacterEncoding in class AbstractTemplateResolver
Parameters:
templateProcessingParameters - the template processing parameters
Returns:
the resource resolver to be applied


Copyright © 2012 The THYMELEAF team. All Rights Reserved.