Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. public static String getJavaDoc(MethodDeclaration a) {
  2.         try {
  3.             String javadoc = a.getJavadoc().tags().get(0).toString();
  4.             // javadoc = javadoc.split("\\.")[0].replace("*", "").trim();
  5.             javadoc = javadoc.replace("*", "").trim();
  6.             javadoc = javadoc.replaceAll("\\<.*?>",""); // Remove html tags
  7.             if (javadoc.charAt(0) == '@' || !javadoc.matches("^\\p{ASCII}+$")) {
  8.                 javadoc = "";
  9.             }
  10.  
  11.             return javadoc;
  12.  
  13.         } catch (Exception e) {
  14.             return "";
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement