Class AbstractMustacheTemplate

  • All Implemented Interfaces:
    MustacheTemplate

    public abstract class AbstractMustacheTemplate
    extends Object
    implements MustacheTemplate
    Abstract that define commons code to template implementation.
    • Constructor Detail

      • AbstractMustacheTemplate

        public AbstractMustacheTemplate()
    • Method Detail

      • execute

        public void execute​(Map<String,​Object> model,
                            Writer writer)
        Description copied from interface: MustacheTemplate
        Render template and print output to given writer.
        Specified by:
        execute in interface MustacheTemplate
        Parameters:
        model - Model object that will be rendered into template.
        writer - Writer output.
      • doExecute

        protected abstract void doExecute​(Map<String,​Object> model,
                                          Writer writer)
                                   throws Exception
        Process template execution. This methods should rethrows exception since it will be catches later (and a new MustacheExecutionException will be thrown).
        Parameters:
        model - Data model.
        writer - Target writer.
        Throws:
        Exception - If something bad happens (will be catched an rethrows).