Exemplo n.º 1
0
 /**
  * Print documentation comment, if it exists
  *
  * @param tree The tree for which a documentation comment should be printed.
  */
 public void printDocComment(JCTree tree) throws IOException {
   if (docComments != null) {
     String dc = docComments.getCommentText(tree);
     if (dc != null) {
       print("/**");
       println();
       int pos = 0;
       int endpos = lineEndPos(dc, pos);
       while (pos < dc.length()) {
         align();
         print(" *");
         if (pos < dc.length() && dc.charAt(pos) > ' ') print(" ");
         print(dc.substring(pos, endpos));
         println();
         pos = endpos + 1;
         endpos = lineEndPos(dc, pos);
       }
       align();
       print(" */");
       println();
       align();
     }
   }
 }