code: private void generateHTMLReport(BufferedWriter writer, BufferedReader templateReader, String jsonReport)
              throws IOException {
  
          logger.entering(new Object[] { writer, templateReader, jsonReport });
  
          String readLine = null;
          while ((readLine = templateReader.readLine()) != null) {
              if (readLine.trim().equals("${reports}")) {
                  writer.write(jsonReport);
                  writer.newLine();
              } else {
                  writer.write(readLine);
                  writer.newLine();
              }
          }
          logger.exiting();
      }
docs: Writing JSON content to HTML file
  
  @param writer
  @param templateReader
  @param jsonReport
  @throws IOException