Search in sources :

Example 11 with StringResource

use of org.thymeleaf.resource.StringResource in project thymeleaf-tests by thymeleaf.

the class ElementAttributesTest method computeXmlAttributes.

private static IElementAttributes computeXmlAttributes(final String input) {
    final String templateName = "test";
    final ElementAttributeObtentionTemplateHandler handler = new ElementAttributeObtentionTemplateHandler();
    XML_PARSER.parse(TEMPLATE_ENGINE_CONFIGURATION, TemplateMode.XML, new StringResource(templateName, input), handler);
    return handler.elementAttributes;
}
Also used : StringResource(org.thymeleaf.resource.StringResource)

Example 12 with StringResource

use of org.thymeleaf.resource.StringResource in project thymeleaf-tests by thymeleaf.

the class ElementAttributesTest method computeHtmlAttributes.

private static IElementAttributes computeHtmlAttributes(final String input) {
    final String templateName = "test";
    final ElementAttributeObtentionTemplateHandler handler = new ElementAttributeObtentionTemplateHandler();
    HTML_PARSER.parse(TEMPLATE_ENGINE_CONFIGURATION, TemplateMode.HTML, new StringResource(templateName, input), handler);
    return handler.elementAttributes;
}
Also used : StringResource(org.thymeleaf.resource.StringResource)

Aggregations

StringResource (org.thymeleaf.resource.StringResource)12 StringWriter (java.io.StringWriter)2 IEngineConfiguration (org.thymeleaf.IEngineConfiguration)2 Context (org.thymeleaf.context.Context)1 ProcessingContext (org.thymeleaf.context.ProcessingContext)1 ITemplateHandler (org.thymeleaf.engine.ITemplateHandler)1 OutputTemplateHandler (org.thymeleaf.engine.OutputTemplateHandler)1