Search in sources :

Example 1 with IModelFactory

use of org.thymeleaf.model.IModelFactory 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);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory) IStandaloneElementTag(org.thymeleaf.model.IStandaloneElementTag)

Example 2 with IModelFactory

use of org.thymeleaf.model.IModelFactory 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);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory) IStandaloneElementTag(org.thymeleaf.model.IStandaloneElementTag)

Example 3 with IModelFactory

use of org.thymeleaf.model.IModelFactory 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);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory) IStandaloneElementTag(org.thymeleaf.model.IStandaloneElementTag)

Example 4 with IModelFactory

use of org.thymeleaf.model.IModelFactory 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);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory) IStandaloneElementTag(org.thymeleaf.model.IStandaloneElementTag)

Example 5 with IModelFactory

use of org.thymeleaf.model.IModelFactory in project thymeleaf-tests by thymeleaf.

the class ReplaceWithProcessableDocTypeProcessor 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, true);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory) IStandaloneElementTag(org.thymeleaf.model.IStandaloneElementTag)

Aggregations

IModelFactory (org.thymeleaf.model.IModelFactory)22 IModel (org.thymeleaf.model.IModel)15 IStandaloneElementTag (org.thymeleaf.model.IStandaloneElementTag)13 IProcessableElementTag (org.thymeleaf.model.IProcessableElementTag)6 AttributeName (org.thymeleaf.engine.AttributeName)1 StandardModelFactory (org.thymeleaf.engine.StandardModelFactory)1 TemplateProcessingException (org.thymeleaf.exceptions.TemplateProcessingException)1 IAttribute (org.thymeleaf.model.IAttribute)1 ICloseElementTag (org.thymeleaf.model.ICloseElementTag)1 IOpenElementTag (org.thymeleaf.model.IOpenElementTag)1 ITemplateEvent (org.thymeleaf.model.ITemplateEvent)1