Interface TemplateService
public interface TemplateService
Defines a service for processing templates with a template engine
-
Method Summary
Modifier and TypeMethodDescriptionReturn the expected template file extension.mergeTemplateIntoString(String templateReference, Map<String, Object> model) Call the templateReference engine to process the given templateReference with the given model object.
-
Method Details
-
mergeTemplateIntoString
String mergeTemplateIntoString(String templateReference, Map<String, Object> model) throws IOException, TemplateExceptionCall the templateReference engine to process the given templateReference with the given model object.- Parameters:
templateReference- a templateReference file to be processed. The name must be complaint with the position of the template your your resources folder. Usually, files inresources/templatesare resolved by passing the sole file name. Subfolders ofresources/templatesmust be explicitly reported. E.g., a templatetemplate.htmlunder the folderresources/templates/modulemust be reported as"module/template"model- the model object to process the templateReference- Returns:
- a processed template (an HTML, or XML, or whatever the templateReference engine can process)
- Throws:
IOException- thrown if the templateReference file is not found or cannot be accessedTemplateException- if the templateReference cannot be processed with the given model object
-
expectedTemplateExtension
String expectedTemplateExtension()Return the expected template file extension. The String must not start with '.'.- Returns:
- The expected extension of thr accepted template file
-