use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class MarkupReplaceElementModelProcessor 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);
model.reset();
model.addModel(replacementMarkup);
}
use of org.thymeleaf.model.IModel in project thymeleaf-tests by thymeleaf.
the class ReplaceWithNonProcessableDocTypeProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IDocType docType, final IDocTypeStructureHandler 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 ReplaceWithNonProcessableProcessingInstructionProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IProcessingInstruction processingInstruction, final IProcessingInstructionStructureHandler 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 ReplaceWithNonProcessableTextProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IText text, final ITextStructureHandler structureHandler) {
if (EngineEventUtils.isWhitespace(text) || text.getText().equals("one")) {
return;
}
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 ReplaceWithNonProcessableXMLDeclarationProcessor method doProcess.
@Override
protected void doProcess(final ITemplateContext context, final IXMLDeclaration xmlDeclaration, final IXMLDeclarationStructureHandler 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);
}
Aggregations