Class TemplateModel
- Object
-
- org.thymeleaf.engine.TemplateModel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(IModelVisitor visitor)
Accept a visitor implementingIModelVisitor
.void
add(ITemplateEvent event)
Adds an event at the end of the sequence.void
addModel(IModel model)
Add an entire model at the end of the sequence.IModel
cloneModel()
Clones the model and all its events.ITemplateEvent
get(int pos)
Retrieves a specific event from the model sequence.IEngineConfiguration
getConfiguration()
Returns the engine configuration that was used for creating this model.TemplateData
getTemplateData()
TemplateMode
getTemplateMode()
Returns the template mode used for creating this model.void
insert(int pos, ITemplateEvent event)
Inserts an event into a specific position in the sequence.void
insertModel(int pos, IModel model)
Inserts an entire model into a specific position in this model's sequence.void
remove(int pos)
Remove an event from the sequence.void
replace(int pos, ITemplateEvent event)
Replaces the event at the specified position with the one passed as argument.void
reset()
Remove all events from the model sequence.int
size()
The size of the model (number ofITemplateEvent
objects contained).String
toString()
void
write(Writer writer)
Write this model (its events) through the specified writer.
-
-
-
Method Detail
-
getTemplateData
public final TemplateData getTemplateData()
-
getConfiguration
public final IEngineConfiguration getConfiguration()
Description copied from interface:IModel
Returns the engine configuration that was used for creating this model.
- Specified by:
getConfiguration
in interfaceIModel
- Returns:
- the engine configuration.
-
getTemplateMode
public final TemplateMode getTemplateMode()
Description copied from interface:IModel
Returns the template mode used for creating this model.
- Specified by:
getTemplateMode
in interfaceIModel
- Returns:
- the template mode.
-
size
public final int size()
Description copied from interface:IModel
The size of the model (number of
ITemplateEvent
objects contained).
-
get
public final ITemplateEvent get(int pos)
Description copied from interface:IModel
Retrieves a specific event from the model sequence.
-
add
public final void add(ITemplateEvent event)
Description copied from interface:IModel
Adds an event at the end of the sequence.
-
insert
public final void insert(int pos, ITemplateEvent event)
Description copied from interface:IModel
Inserts an event into a specific position in the sequence.
-
replace
public final void replace(int pos, ITemplateEvent event)
Description copied from interface:IModel
Replaces the event at the specified position with the one passed as argument.
-
addModel
public final void addModel(IModel model)
Description copied from interface:IModel
Add an entire model at the end of the sequence. This effectively appends the
model
argument's sequence to this one.
-
insertModel
public final void insertModel(int pos, IModel model)
Description copied from interface:IModel
Inserts an entire model into a specific position in this model's sequence.
- Specified by:
insertModel
in interfaceIModel
- Parameters:
pos
- the position to insert the mdoel (zero-based).model
- the model to be inserted.
-
remove
public final void remove(int pos)
Description copied from interface:IModel
Remove an event from the sequence.
-
reset
public final void reset()
Description copied from interface:IModel
Remove all events from the model sequence.
-
cloneModel
public final IModel cloneModel()
Description copied from interface:IModel
Clones the model and all its events.
- Specified by:
cloneModel
in interfaceIModel
- Returns:
- the new model.
-
write
public final void write(Writer writer) throws IOException
Description copied from interface:IModel
Write this model (its events) through the specified writer.
- Specified by:
write
in interfaceIModel
- Parameters:
writer
- the writer that will be used for writing the model.- Throws:
IOException
- should any exception happen.
-
accept
public void accept(IModelVisitor visitor)
Description copied from interface:IModel
Accept a visitor implementing
IModelVisitor
. This visitor will be executed for each event in the sequence.
-
-