Search in sources :

Example 1 with TemplateRepository

use of org.thymeleaf.TemplateRepository in project thymeleaf-tests by thymeleaf.

the class TemplateParserTest method createOutput.

private String createOutput(final Document document) throws IOException {
    final TemplateProcessingParameters templateProcessingParameters = new TemplateProcessingParameters(this.configuration, "test", new Context());
    final TemplateResolution templateResolution = new TemplateResolution("test", "test", new ClassLoaderResourceResolver(), "UTF-8", "XHTML", new NonCacheableCacheEntryValidity());
    final Arguments arguments = new Arguments(new TemplateEngine(), templateProcessingParameters, templateResolution, new TemplateRepository(this.configuration), document);
    final StringWriter stringWriter = new StringWriter();
    final ITemplateWriter templateWriter = this.configuration.getTemplateModeHandler("XHTML").getTemplateWriter();
    templateWriter.write(arguments, stringWriter, document);
    return stringWriter.toString();
}
Also used : Context(org.thymeleaf.context.Context) TemplateEngine(org.thymeleaf.TemplateEngine) TemplateRepository(org.thymeleaf.TemplateRepository) TemplateProcessingParameters(org.thymeleaf.TemplateProcessingParameters) StringWriter(java.io.StringWriter) TemplateResolution(org.thymeleaf.templateresolver.TemplateResolution) Arguments(org.thymeleaf.Arguments) ITemplateWriter(org.thymeleaf.templatewriter.ITemplateWriter) ClassLoaderResourceResolver(org.thymeleaf.resourceresolver.ClassLoaderResourceResolver) NonCacheableCacheEntryValidity(org.thymeleaf.cache.NonCacheableCacheEntryValidity)

Aggregations

StringWriter (java.io.StringWriter)1 Arguments (org.thymeleaf.Arguments)1 TemplateEngine (org.thymeleaf.TemplateEngine)1 TemplateProcessingParameters (org.thymeleaf.TemplateProcessingParameters)1 TemplateRepository (org.thymeleaf.TemplateRepository)1 NonCacheableCacheEntryValidity (org.thymeleaf.cache.NonCacheableCacheEntryValidity)1 Context (org.thymeleaf.context.Context)1 ClassLoaderResourceResolver (org.thymeleaf.resourceresolver.ClassLoaderResourceResolver)1 TemplateResolution (org.thymeleaf.templateresolver.TemplateResolution)1 ITemplateWriter (org.thymeleaf.templatewriter.ITemplateWriter)1