fr.sii.ogham.template.thymeleaf.resolver.StringResourceResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ogham-template-thymeleaf Show documentation
Show all versions of ogham-template-thymeleaf Show documentation
Use ThymeLeaf as template engine in Ogham
package fr.sii.ogham.template.thymeleaf.resolver;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.thymeleaf.TemplateProcessingParameters;
import org.thymeleaf.resourceresolver.IResourceResolver;
public class StringResourceResolver implements IResourceResolver {
private static final String NAME = "STRING";
@Override
public String getName() {
return NAME;
}
@Override
public InputStream getResourceAsStream(TemplateProcessingParameters templateProcessingParameters, String resourceName) {
return new ByteArrayInputStream(resourceName.getBytes());
}
}