|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.thymeleaf.TemplateRepository
public final class TemplateRepository
The template repository is an internal utility class that is responsible before the Template Engine of retrieving templates (parsed) and fragments, performing all the necessary operations against the caches in order to obtain the required data.
Each TemplateEngine
uses a single object of this class.
Method Summary | |
---|---|
void |
clearFragmentCache()
Clears the fragments cache. |
void |
clearFragmentCacheFor(String fragment)
Clears a specific entry at the fragment cache. |
void |
clearTemplateCache()
Clears the template cache. |
void |
clearTemplateCacheFor(String templateName)
Clears any existing entries for template of the specified name at the template cache. |
java.util.List<Node> |
getFragment(Arguments arguments,
String fragment)
Obtains a fragment. |
Template |
getTemplate(TemplateProcessingParameters templateProcessingParameters)
Obtains a template. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void clearTemplateCache()
Clears the template cache.
public void clearTemplateCacheFor(String templateName)
Clears any existing entries for template of the specified name at the template cache.
templateName
- the name of the template whose entries have to be cleared.public void clearFragmentCache()
Clears the fragments cache.
public void clearFragmentCacheFor(String fragment)
Clears a specific entry at the fragment cache.
fragment
- the fragment to be cleared.public Template getTemplate(TemplateProcessingParameters templateProcessingParameters)
Obtains a template. This method is responsible of providing a Template
to the
TemplateEngine
by following these steps:
ITemplateResolver
objects until one of them resolves
the template.IResourceResolver
object to obtain an InputStream
on it.ITemplateModeHandler
object associated to the template mode assigned
to the resolved template (by the template resolver).ITemplateParser
of the selected ITemplateModeHandler
to read and
parse the template into a Document
.
templateProcessingParameters
- the parameters object containing all the necessary pieces of
data in order to adequately resolve the template.
public java.util.List<Node> getFragment(Arguments arguments, String fragment)
Obtains a fragment. A fragment is a piece of template code that is usually read from a different source and needs parsing for converting it into a DOM subtree.
Common examples of fragments are the messages in a Messages.properties file that contain tags like <strong> <u>, etc. and are included in thymeleaf templates via an attribute like th:utext.
arguments
- the execution argumentsfragment
- the fragment to be processed
Node
that can be linked
to the DOM being processed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |