code: public void generate(Writer writer) throws IOException {
      final String templatePath = getTemplateFileName();
      InputStream input = this.getClass().getClassLoader().getResourceAsStream(templatePath);
      if (input == null) {
        throw new IOException("Could not find template file " + templatePath);
      }
      InputStreamReader reader = new InputStreamReader(input);
      performPreMerge();
      Template template = engine.getTemplate(templatePath, "UTF-8");
      template.merge(context, writer, getMacroTemplates());
      writer.flush();
      writer.close();
    }
docs: Public