public final class TemplateBoundariesStructureHandler extends Object implements ITemplateBoundariesStructureHandler
Structure handler implementation, internally used by the engine.
This class should not be directly used from outside the engine.
Modifier and Type | Method and Description |
---|---|
void |
insert(IModel model,
boolean processable)
Instructs the engine to insert the specified model.
|
void |
insert(String text,
boolean processable)
Instructs the engine to insert the specified text.
|
void |
removeLocalVariable(String name)
Instructs the engine to remove a local variable.
|
void |
reset()
Resets all actions specified so far for the current processor execution.
|
void |
setInliner(IInliner inliner)
Instructs the engine to set a new inliner.
|
void |
setLocalVariable(String name,
Object value)
Instructs the engine to set a new local variable.
|
void |
setSelectionTarget(Object selectionTarget)
Instructs the engine to set a new selection target.
|
public void insert(String text, boolean processable)
ITemplateBoundariesStructureHandler
Instructs the engine to insert the specified text.
If the processed event is a ITemplateStart
event, then the text will
be inserted at the beginning of the template (just after the template start event). On the other
hand, if the processed event is a ITemplateEnd
event, then the text
will be inserted at the end of the template (just before the template end event).
insert
in interface ITemplateBoundariesStructureHandler
text
- the text to be inserted.processable
- whether the inserted text should be considered processable or not.public void insert(IModel model, boolean processable)
ITemplateBoundariesStructureHandler
Instructs the engine to insert the specified model.
If the processed event is a ITemplateStart
event, then the model will
be inserted at the beginning of the template (just after the template start event). On the other
hand, if the processed event is a ITemplateEnd
event, then the model
will be inserted at the end of the template (just before the template end event).
insert
in interface ITemplateBoundariesStructureHandler
model
- the model to be inserted.processable
- whether the inserted text should be considered processable or not.public void removeLocalVariable(String name)
ITemplateBoundariesStructureHandler
Instructs the engine to remove a local variable.
removeLocalVariable
in interface ITemplateBoundariesStructureHandler
name
- the name of the variable.public void setLocalVariable(String name, Object value)
ITemplateBoundariesStructureHandler
Instructs the engine to set a new local variable.
setLocalVariable
in interface ITemplateBoundariesStructureHandler
name
- the name of the variable.value
- the value of the variable.public void setSelectionTarget(Object selectionTarget)
ITemplateBoundariesStructureHandler
Instructs the engine to set a new selection target.
The selection target is the object on which selection expressions (*{...}) are executed. In the Standard Dialect, this selection target is usually modified by means of the th:object attribute, but custom processors can do it too. Note the selection target has the same scope as a local variable, and will therefore be accessible only inside the body of the element being processed.
setSelectionTarget
in interface ITemplateBoundariesStructureHandler
selectionTarget
- the selection target to be set.public void setInliner(IInliner inliner)
ITemplateBoundariesStructureHandler
Instructs the engine to set a new inliner.
Inliners are used for processing all text nodes (IText
events) appearing
in the body of the element being processed. This is the mechanism used by the th:inline attribute to
enable inlining in any of the specified modes (text, javascript, etc).
setInliner
in interface ITemplateBoundariesStructureHandler
inliner
- the inliner.public void reset()
ITemplateBoundariesStructureHandler
Resets all actions specified so far for the current processor execution.
reset
in interface ITemplateBoundariesStructureHandler
Copyright © 2017 The THYMELEAF team. All rights reserved.