Search in sources :

Example 6 with IModel

use of org.thymeleaf.model.IModel 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)

Example 7 with IModel

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

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

Example 8 with IModel

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

the class Dialect02Div2Processor method doProcess.

@Override
protected void doProcess(final ITemplateContext processingContext, final IProcessableElementTag tag, final IElementTagStructureHandler structureHandler) {
    final IModelFactory modelFactory = processingContext.getModelFactory();
    final IModel markup = modelFactory.createModel();
    markup.add(modelFactory.createText("[From Dialect 02-2]"));
    structureHandler.insertBefore(markup);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory)

Example 9 with IModel

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

the class Dialect02DivProcessor method doProcess.

@Override
protected void doProcess(final ITemplateContext processingContext, final IProcessableElementTag tag, final IElementTagStructureHandler structureHandler) {
    final IModelFactory modelFactory = processingContext.getModelFactory();
    final IModel markup = modelFactory.createModel();
    markup.add(modelFactory.createText("[From Dialect 02]"));
    structureHandler.insertImmediatelyAfter(markup, true);
}
Also used : IModel(org.thymeleaf.model.IModel) IModelFactory(org.thymeleaf.model.IModelFactory)

Example 10 with IModel

use of org.thymeleaf.model.IModel in project thymeleaf by thymeleaf.

the class StandardModelFactory method createModel.

public IModel createModel(final ITemplateEvent event) {
    final Model model = new Model(this.configuration, this.templateMode);
    model.add(event);
    return model;
}
Also used : IModel(org.thymeleaf.model.IModel)

Aggregations

IModel (org.thymeleaf.model.IModel)19 IModelFactory (org.thymeleaf.model.IModelFactory)15 IStandaloneElementTag (org.thymeleaf.model.IStandaloneElementTag)12 Writer (java.io.Writer)1 Map (java.util.Map)1 IEngineConfiguration (org.thymeleaf.IEngineConfiguration)1 IEngineContext (org.thymeleaf.context.IEngineContext)1 ITemplateContext (org.thymeleaf.context.ITemplateContext)1 TemplateData (org.thymeleaf.engine.TemplateData)1 TemplateModel (org.thymeleaf.engine.TemplateModel)1 TemplateInputException (org.thymeleaf.exceptions.TemplateInputException)1 TemplateProcessingException (org.thymeleaf.exceptions.TemplateProcessingException)1 ICloseElementTag (org.thymeleaf.model.ICloseElementTag)1 IOpenElementTag (org.thymeleaf.model.IOpenElementTag)1 IProcessableElementTag (org.thymeleaf.model.IProcessableElementTag)1 ITemplateEvent (org.thymeleaf.model.ITemplateEvent)1 Fragment (org.thymeleaf.standard.expression.Fragment)1 FragmentSignature (org.thymeleaf.standard.expression.FragmentSignature)1 FastStringWriter (org.thymeleaf.util.FastStringWriter)1