public final class ExecutionInfo extends Object
Expression Object providing useful information about the template being processed inside Thymeleaf Standard Expressions.
An object of this class is usually available in variable evaluation expressions with the name #execInfo.
Constructor and Description |
---|
ExecutionInfo(ITemplateContext context) |
Modifier and Type | Method and Description |
---|---|
Calendar |
getNow()
Returns the current date and time (from the moment of template execution).
|
TemplateMode |
getProcessedTemplateMode()
Returns the template mode (
TemplateMode ) of the first-level template. |
String |
getProcessedTemplateName()
Returns the template name of the first-level template.
|
TemplateMode |
getTemplateMode()
Returns the template mode (
TemplateMode ) (of the leaf template). |
List<TemplateMode> |
getTemplateModes()
Returns the
TemplateMode s of all the stack of templates appliable to the current point
of execution. |
String |
getTemplateName()
Returns the template name (of the leaf template).
|
List<String> |
getTemplateNames()
Returns the names of all the stack of templates appliable to the current point
of execution.
|
List<TemplateData> |
getTemplateStack()
Returns the template stack, containing the metadata for the first-level template being
processed and also any fragments that might have been nested up to the current execution point.
|
public ExecutionInfo(ITemplateContext context)
public String getTemplateName()
Returns the template name (of the leaf template).
Note that the template name returned here corresponds with origin of the elements or nodes being currently processed. This is, if a processor is being executed for an element inserted from an external template (via a th:insert, for example), then this method will return the template mode for the template in which the inserted fragment lives, not the one it was inserted into.
public TemplateMode getTemplateMode()
Returns the template mode (TemplateMode
) (of the leaf template).
Note that the TemplateMode
returned here corresponds with origin of the elements or nodes being
currently processed. This is, if a processor is being executed for an element inserted from an external
template (via a th:insert, for example), then this method will return the template mode
for the template in which the inserted fragment lives, not the one it was inserted into.
public String getProcessedTemplateName()
Returns the template name of the first-level template.
Note this template name refers to the first-level one, the one used to call the TemplateEngine itself, even if by the moment this method is called the engine is processing a fragment inserted from the first-level template (or at any other level in the hierarchy).
public TemplateMode getProcessedTemplateMode()
Returns the template mode (TemplateMode
) of the first-level template.
Note this template mode refers to the first-level one, the one used to call the TemplateEngine itself, even if by the moment this method is called the engine is processing a fragment inserted from the first-level template (or at any other level in the hierarchy).
public List<String> getTemplateNames()
Returns the names of all the stack of templates appliable to the current point of execution. This will depend on which templates are inserted inside wich.
The first-level template will appear first, and the most specific template will appear last.
public List<TemplateMode> getTemplateModes()
Returns the TemplateMode
s of all the stack of templates appliable to the current point
of execution. This will depend on which templates are inserted inside wich.
The first-level template will appear first, and the most specific template will appear last.
public List<TemplateData> getTemplateStack()
Returns the template stack, containing the metadata for the first-level template being processed and also any fragments that might have been nested up to the current execution point.
The result of this method actually corresponds to the result of ITemplateContext.getTemplateStack()
.
TemplateData
objectspublic Calendar getNow()
Returns the current date and time (from the moment of template execution).
Copyright © 2017 The THYMELEAF team. All rights reserved.