Class Model
- java.lang.Object
-
- org.thymeleaf.engine.Model
-
-
Field Summary
Fields Modifier and Type Field Description private IEngineConfigurationconfigurationprivate static intINITIAL_EVENT_QUEUE_SIZE(package private) IEngineTemplateEvent[]queue(package private) intqueueSizeprivate TemplateModetemplateMode
-
Constructor Summary
Constructors Constructor Description Model(IEngineConfiguration configuration, TemplateMode templateMode)Model(IModel model)
-
Method Summary
All Methods Static 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.(package private) static IEngineTemplateEventasEngineEvent(ITemplateEvent event)IModelcloneModel()Clones the model and all its events.private voiddoInsertModel(int pos, Model model)private voiddoInsertOtherModel(int pos, IModel model)private voiddoInsertTemplateModel(int pos, TemplateModel model)ITemplateEventget(int pos)Retrieves a specific event from the model sequence.IEngineConfigurationgetConfiguration()Returns the engine configuration that was used for creating this model.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.(package private) voidprocess(ITemplateHandler handler)(package private) intprocess(ITemplateHandler handler, int offset, TemplateFlowController controller)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.(package private) voidresetAsCloneOf(Model model)(package private) booleansameAs(Model model)intsize()The size of the model (number ofITemplateEventobjects contained).java.lang.StringtoString()voidwrite(java.io.Writer writer)Write this model (its events) through the specified writer.
-
-
-
Field Detail
-
INITIAL_EVENT_QUEUE_SIZE
private static final int INITIAL_EVENT_QUEUE_SIZE
- See Also:
- Constant Field Values
-
configuration
private IEngineConfiguration configuration
-
templateMode
private TemplateMode templateMode
-
queue
IEngineTemplateEvent[] queue
-
queueSize
int queueSize
-
-
Constructor Detail
-
Model
Model(IEngineConfiguration configuration, TemplateMode templateMode)
-
Model
Model(IModel model)
-
-
Method Detail
-
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 int size()
Description copied from interface:IModelThe size of the model (number of
ITemplateEventobjects contained).
-
get
public ITemplateEvent get(int pos)
Description copied from interface:IModelRetrieves a specific event from the model sequence.
-
add
public void add(ITemplateEvent event)
Description copied from interface:IModelAdds an event at the end of the sequence.
-
insert
public void insert(int pos, ITemplateEvent event)Description copied from interface:IModelInserts an event into a specific position in the sequence.
-
replace
public 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 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 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.
-
doInsertModel
private void doInsertModel(int pos, Model model)
-
doInsertTemplateModel
private void doInsertTemplateModel(int pos, TemplateModel model)
-
doInsertOtherModel
private void doInsertOtherModel(int pos, IModel model)
-
remove
public void remove(int pos)
Description copied from interface:IModelRemove an event from the sequence.
-
reset
public void reset()
Description copied from interface:IModelRemove all events from the model sequence.
-
process
void process(ITemplateHandler handler)
-
process
int process(ITemplateHandler handler, int offset, TemplateFlowController controller)
-
cloneModel
public IModel cloneModel()
Description copied from interface:IModelClones the model and all its events.
- Specified by:
cloneModelin interfaceIModel- Returns:
- the new model.
-
resetAsCloneOf
void resetAsCloneOf(Model model)
-
write
public final void write(java.io.Writer writer) throws java.io.IOExceptionDescription copied from interface:IModelWrite this model (its events) through the specified writer.
-
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.
-
sameAs
boolean sameAs(Model model)
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
asEngineEvent
static IEngineTemplateEvent asEngineEvent(ITemplateEvent event)
-
-