Interface TemplateEngine


public interface TemplateEngine
The template engine is responsible for processing templates, replacing placeholders with values from the context. Templates can be processed from strings or from files.
  • Method Details

    • getTemplateEngine

      static TemplateEngine getTemplateEngine()
      Returns an instance of the template engine.
      Returns:
      An instance of the template engine.
    • process

      default List<TemplateFileOutput> process(Class<?> cls, List<TemplateDescriptor> templateDescriptors, Map<String,Object> context)
      Processes the template files specified in the template descriptor list, using the context provided.
      Parameters:
      cls - The class to use as the base for reading the template files.
      templateDescriptors - The list of template descriptors to process.
      context - The context to use when processing the templates.
      Returns:
      A list of template file outputs.
    • process

      String process(String templateContent, Map<String,Object> context)
      Processes the template content, replacing placeholders with values from the context.
      Parameters:
      templateContent - The template content to process.
      context - The context to use when processing the template.
      Returns:
      The processed template content.
    • process

      default String process(InputStream templateStream, Map<String,Object> context)
      Processes the template file, replacing placeholders with values from the context.
      Parameters:
      templateStream - The template file to process.
      context - The context to use when processing the template.
      Returns:
      The processed template content.