Interface Template<T>

Type Parameters:
T - the model type
All Superinterfaces:
Renderer<T>, TemplateInfo
All Known Implementing Classes:
HelloModelView, HelloModelView, MessagePageRenderer, MessagePageRenderer

public interface Template<T> extends Renderer<T>, TemplateInfo
A JStachio Template is a renderer that has template meta data.

Generated code implements this interface.

Author:
agentgt
  • Method Details

    • execute

      default void execute(T model, Appendable appendable) throws IOException
      Renders the passed in model.
      Specified by:
      execute in interface Renderer<T>
      Parameters:
      model - a model assumed never to be null.
      appendable - the appendable to write to.
      Throws:
      IOException - if there is an error writing to the appendable
    • execute

      void execute(T model, Appendable a, Formatter formatter, Escaper escaper) throws IOException
      Renders the passed in model.
      Parameters:
      model - a model assumed never to be null.
      a - appendable to write to.
      formatter - formats variables before they are passed to the escaper
      escaper - used to write escaped variables
      Throws:
      IOException - if an error occurs while writing to the appendable
    • execute

      default void execute(T model, Appendable a, Function<@Nullable Object,String> formatter, Function<String,String> escaper) throws IOException
      Renders the passed in model.
      Parameters:
      model - a model assumed never to be null.
      a - appendable to write to.
      formatter - formats variables before they are passed to the escaper
      escaper - used to write escaped variables
      Throws:
      IOException - if an error occurs while writing to the appendable
    • modelClass

      Return the model class (root context class annotated with JStache) that generated this template.
      Returns:
      model class