Class ExecutionInfo
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
.
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNow()
Returns the current date and time (from the moment of template execution).Returns the template mode (TemplateMode
) of the first-level template.Returns the template name of the first-level template.Returns the template mode (TemplateMode
) (of the leaf template).Returns theTemplateMode
s of all the stack of templates appliable to the current point of execution.Returns the template name (of the leaf template).Returns the names of all the stack of templates appliable to the current point of execution.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.
-
Constructor Details
-
ExecutionInfo
-
-
Method Details
-
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.- Returns:
- the template name
-
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 ath: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.- Returns:
- the template mode
-
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).
- Returns:
- the template name
-
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).
- Returns:
- the template mode
-
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.
- Returns:
- the stack of template names
-
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.
- Returns:
- the stack of template modes
-
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()
.- Returns:
- the stack of
TemplateData
objects
-
getNow
Returns the current date and time (from the moment of template execution).
- Returns:
- the current date and time, as a Calendar
-