Class TemplateModel
- Object
-
- org.thymeleaf.engine.TemplateModel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IModelVisitor visitor)Accept a visitor implementingIModelVisitor.voidadd(ITemplateEvent event)Adds an event at the end of the sequence.voidaddModel(IModel model)Add an entire model at the end of the sequence.IModelcloneModel()Clones the model and all its events.ITemplateEventget(int pos)Retrieves a specific event from the model sequence.IEngineConfigurationgetConfiguration()Returns the engine configuration that was used for creating this model.TemplateDatagetTemplateData()TemplateModegetTemplateMode()Returns the template mode used for creating this model.voidinsert(int pos, ITemplateEvent event)Inserts an event into a specific position in the sequence.voidinsertModel(int pos, IModel model)Inserts an entire model into a specific position in this model's sequence.voidremove(int pos)Remove an event from the sequence.voidreplace(int pos, ITemplateEvent event)Replaces the event at the specified position with the one passed as argument.voidreset()Remove all events from the model sequence.intsize()The size of the model (number ofITemplateEventobjects contained).StringtoString()voidwrite(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:IModelReturns the engine configuration that was used for creating this model.
- Specified by:
getConfigurationin interfaceIModel- Returns:
- the engine configuration.
-
getTemplateMode
public final TemplateMode getTemplateMode()
Description copied from interface:IModelReturns the template mode used for creating this model.
- Specified by:
getTemplateModein interfaceIModel- Returns:
- the template mode.
-
size
public final int size()
Description copied from interface:IModelThe size of the model (number of
ITemplateEventobjects contained).
-
get
public final ITemplateEvent get(int pos)
Description copied from interface:IModelRetrieves a specific event from the model sequence.
-
add
public final void add(ITemplateEvent event)
Description copied from interface:IModelAdds an event at the end of the sequence.
-
insert
public final void insert(int pos, ITemplateEvent event)Description copied from interface:IModelInserts an event into a specific position in the sequence.
-
replace
public final void replace(int pos, ITemplateEvent event)Description copied from interface:IModelReplaces the event at the specified position with the one passed as argument.
-
addModel
public final void addModel(IModel model)
Description copied from interface:IModelAdd an entire model at the end of the sequence. This effectively appends the
modelargument's sequence to this one.
-
insertModel
public final void insertModel(int pos, IModel model)Description copied from interface:IModelInserts an entire model into a specific position in this model's sequence.
- Specified by:
insertModelin 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:IModelRemove an event from the sequence.
-
reset
public final void reset()
Description copied from interface:IModelRemove all events from the model sequence.
-
cloneModel
public final IModel cloneModel()
Description copied from interface:IModelClones the model and all its events.
- Specified by:
cloneModelin interfaceIModel- Returns:
- the new model.
-
write
public final void write(Writer writer) throws IOException
Description copied from interface:IModelWrite this model (its events) through the specified writer.
- Specified by:
writein 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:IModelAccept a visitor implementing
IModelVisitor. This visitor will be executed for each event in the sequence.
-
-