code: public void writeTo(Writer writer) throws IOException {
          JsonSerializer.write(Json.jObject("template", asJson()), writer);
          writer.flush();
      }
docs: /*
  Writes to the supplied Writer.
  Note: Does NOT close the writer.