Interface Renderer<T>

Type Parameters:
T - Engine Type
All Known Implementing Classes:
HandlebarsRenderer

public interface Renderer<T>
Renderer is an interface that can render templates and lookup templates from multiple class loaders.
  • Method Details

    • render

      HTMLResponse render(String template, ViewModel<?> model)
      Given a template and a model, returns a TemplateResponse
      Parameters:
      template - String representation of a template the engine can use.
      model - ViewModel to be passed in with the template
      Returns:
      TemplateResponse
    • renderTemplate

      HTMLResponse renderTemplate(String location, ViewModel<?> model)
      Given a template location and a model, returns a TemplateResponse
      Parameters:
      location - Location where the engine can find the template.
      model - ViewModel to be passed in with the template
      Returns:
      TemplateResponse
    • getTemplateLoaders

      Iterable<com.github.jknack.handlebars.io.TemplateLoader> getTemplateLoaders()
      List of all template loaders available for this Renderer
      Returns:
      List of TemplateLoaders
    • addTemplateLoader

      void addTemplateLoader(ClassLoader loader)
      Provide a class path for this renderer to lookup templates.
      Parameters:
      loader - classloader for use in template lookup
    • removeTemplateLoader

      void removeTemplateLoader(ClassLoader loader)
      Remove a template loader based on classpath
      Parameters:
      loader - classloader to remove from template lookup.
    • getEngine

      T getEngine()
      The implementation of the actual engine to be used in this renderer
      Returns:
      engine