Interface TemplateRenderer

  • All Implemented Interfaces:
    com.embabel.common.textio.template.TemplateCompiler

    
    public interface TemplateRenderer
     implements TemplateCompiler
                        

    Object that can render templates with a model. Methods throw unchecked exceptions if the template is not found or is invalid. The exceptions defined in this interface will wrap exceptions from an underlying implementation. "loaded" methods load Spring Resource's, while "literal" methods take a string literal

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • load

         abstract String load(String templateName)

        Load the template. Useful if we have to introspect it

        Parameters:
        templateName - name of the template
        Returns:

        template content

      • renderLoadedTemplate

         abstract String renderLoadedTemplate(String templateName, Map<String, Object> model)

        Render a template with the given model

        Parameters:
        templateName - template to use.
        model - model
        Returns:

        string result of rendering string

      • renderLiteralTemplate

         abstract String renderLiteralTemplate(String template, Map<String, Object> model)

        Render a template string without loading it

        Parameters:
        template - template as string literal
        model - model to render
        Returns:

        rendered string