use of org.thymeleaf.model.IStandaloneElementTag in project thymeleaf-tests by thymeleaf.
the class StandaloneElementTagTest method testXmlStandaloneElementPropertyManagement.
@Test
public void testXmlStandaloneElementPropertyManagement() {
IStandaloneElementTag tag;
final ElementDefinitions elementDefinitions = TEMPLATE_ENGINE_CONFIGURATION.getElementDefinitions();
tag = computeXmlTag("<input/>");
Assert.assertSame(elementDefinitions.forXMLName("input"), tag.getElementDefinition());
try {
// XML standalone elements cannot be un-minimized
tag.setMinimized(false);
Assert.assertTrue(false);
} catch (final IllegalArgumentException e) {
Assert.assertTrue(true);
}
}
use of org.thymeleaf.model.IStandaloneElementTag 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.IStandaloneElementTag 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.IStandaloneElementTag 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.IStandaloneElementTag 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