Interface TemplateService


public interface TemplateService
Defines a service for processing templates with a template engine
  • Method Details

    • mergeTemplateIntoString

      String mergeTemplateIntoString(String templateReference, Map<String,Object> model) throws IOException, TemplateException
      Call 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 in resources/templates are resolved by passing the sole file name. Subfolders of resources/templates must be explicitly reported. E.g., a template template.html under the folder resources/templates/module must 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 accessed
      TemplateException - 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