use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class MarkupReplaceBodyElementModelProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IModel model, final AttributeName attributeName, final String attributeValue, final IElementModelStructureHandler structureHandler) {
final IModel replacementMarkup = context.getModelFactory().parse(context.getTemplateData(), REPLACEMENT);
for (int i = model.size() - 2; i > 0; i--) {
model.remove(i);
}
model.insertModel(1, replacementMarkup);
}
use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class ReplaceWithNonProcessableCDATASectionProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final ICDATASection cdataSection, final ICDATASectionStructureHandler structureHandler) {
final IModelFactory modelFactory = context.getModelFactory();
final IStandaloneElementTag tag = modelFactory.createStandaloneElementTag("replaced", "th:text", "one", false, true);
final IModel model = modelFactory.createModel(tag);
structureHandler.replaceWith(model, false);
}
use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class ReplaceWithNonProcessableCommentProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IComment comment, final ICommentStructureHandler structureHandler) {
final IModelFactory modelFactory = context.getModelFactory();
final IStandaloneElementTag tag = modelFactory.createStandaloneElementTag("replaced", "th:text", "one", false, true);
final IModel model = modelFactory.createModel(tag);
structureHandler.replaceWith(model, false);
}
use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class ReplaceWithProcessableCDATASectionProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final ICDATASection cdataSection, final ICDATASectionStructureHandler structureHandler) {
final IModelFactory modelFactory = context.getModelFactory();
final IStandaloneElementTag tag = modelFactory.createStandaloneElementTag("replaced", "th:text", "one", false, true);
final IModel model = modelFactory.createModel(tag);
structureHandler.replaceWith(model, true);
}
use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class ReplaceWithProcessableCommentProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IComment comment, final ICommentStructureHandler structureHandler) {
final IModelFactory modelFactory = context.getModelFactory();
final IStandaloneElementTag tag = modelFactory.createStandaloneElementTag("replaced", "th:text", "one", false, true);
final IModel model = modelFactory.createModel(tag);
structureHandler.replaceWith(model, true);
}
Aggregations