code: public static String stringToDocComment(String doc, DocCommentStyle style) {
      if (doc == null || doc.trim().isEmpty()) return "";
  
      String commentNewline = (style == DocCommentStyle.ASTRISK_MARGIN) ? "\n * " : "\n";
      String schemadoc = wrap(escape(doc)).replaceAll("\\n", commentNewline);
      StringBuilder builder = new StringBuilder();
      builder.append("/**\n");
      if (style == DocCommentStyle.ASTRISK_MARGIN) builder.append(" * ");
      builder.append(schemadoc).append("\n");
      if (style == DocCommentStyle.ASTRISK_MARGIN) builder.append(" ");
      builder.append("*/");
      return builder.toString();
    }
docs: Returns a doc comment, as a string of source, for the given documentation string
  and deprecated property.
  
  @param doc provides the schemadoc for the symbol, if any.  May be null.
  @return an escaped schemadoc string.