|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.thymeleaf.templateresolver.TemplateResolution
public final class TemplateResolution
Result of the execution of a Template Resolver.
A TemplateResolution object is created by implementations of ITemplateResolver
when templates are resolved, and it contains:
IResourceResolver
)
to be used for trying to read this template.
The fact that a Template Resolver returns a TemplateResolution
does not necessarily
mean that the template will be effectively be resolved by the Template Resolver. For this,
the Resource Resolver will also need to be able to resolve the declared template's resource.
Constructor Summary | |
---|---|
TemplateResolution(String templateName,
String resourceName,
IResourceResolver resourceResolver,
String characterEncoding,
TemplateMode templateMode,
boolean cacheable,
Long cacheTTLMs)
|
Method Summary | |
---|---|
Long |
getCacheTTLMs()
Returns the TTL of the template in the cache, in milliseconds. |
String |
getCharacterEncoding()
Returns the character encoding that should be used for reading the template (using the Resource Resolver). |
String |
getResourceName()
Returns the resource name. |
IResourceResolver |
getResourceResolver()
Returns the resource resolver that should be used for actually reading the template (using the provided resource name, see getResourceName() ). |
TemplateMode |
getTemplateMode()
Returns the template mode to be applied. |
String |
getTemplateName()
Returns the template name. |
boolean |
isCacheable()
Returns whether the template can be cached or not. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TemplateResolution(String templateName, String resourceName, IResourceResolver resourceResolver, String characterEncoding, TemplateMode templateMode, boolean cacheable, Long cacheTTLMs)
Method Detail |
---|
public String getTemplateName()
Returns the template name.
This should be the same name used for calling the
TemplateEngine.process(String, org.thymeleaf.context.IContext)
method.
public String getResourceName()
Returns the resource name.
The resource name is the identifier that will be used for actually reading
the template by means of the Resource Resolver (see getResourceResolver()
).
This resource name will typically be computed by the Template Resolver from the template
name. For example, a Template Resolver could have a prefix and a suffix configured
so that starting from the template name "home" it returns the resource name
"/WEB-INF/templates/web/home.html", which can be then read by a
ClassLoaderResourceResolver
instance.
public IResourceResolver getResourceResolver()
Returns the resource resolver that should be used for actually reading the template
(using the provided resource name, see getResourceName()
).
public String getCharacterEncoding()
Returns the character encoding that should be used for reading the template (using the Resource Resolver).
public TemplateMode getTemplateMode()
Returns the template mode to be applied. This template mode (TemplateMode
)
determines whether the template is to be considered XML, VALIDXML, XHTML,
VALIDXHTML, HTML5 or LEGACYHTML5.
public boolean isCacheable()
Returns whether the template can be cached or not.
If true, the result of parsing this template (DOM tree) will be included into the Parsed Template Cache.
public Long getCacheTTLMs()
Returns the TTL of the template in the cache, in milliseconds.
This method should return null if isCacheable()
returns false.
If isCacheable()
returns true and this method returns null,
it means the cache entry will live in cache until it is removed by the
LRU algorithm (because of being the oldest of entries).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |