28 import java.io.File; |
28 import java.io.File; |
29 import java.io.IOException; |
29 import java.io.IOException; |
30 import java.io.PrintWriter; |
30 import java.io.PrintWriter; |
31 import java.util.ArrayList; |
31 import java.util.ArrayList; |
32 import java.util.List; |
32 import java.util.List; |
|
33 import java.util.regex.Pattern; |
33 |
34 |
34 import javax.lang.model.element.Name; |
35 import javax.lang.model.element.Name; |
35 import javax.tools.StandardLocation; |
36 import javax.tools.StandardLocation; |
36 |
37 |
37 import com.sun.source.doctree.DocCommentTree; |
38 import com.sun.source.doctree.DocCommentTree; |
70 public class DocLint implements Plugin { |
71 public class DocLint implements Plugin { |
71 |
72 |
72 public static final String XMSGS_OPTION = "-Xmsgs"; |
73 public static final String XMSGS_OPTION = "-Xmsgs"; |
73 public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:"; |
74 public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:"; |
74 private static final String STATS = "-stats"; |
75 private static final String STATS = "-stats"; |
|
76 public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:"; |
75 |
77 |
76 // <editor-fold defaultstate="collapsed" desc="Command-line entry point"> |
78 // <editor-fold defaultstate="collapsed" desc="Command-line entry point"> |
77 public static void main(String... args) { |
79 public static void main(String... args) { |
78 try { |
80 try { |
79 new DocLint().run(args); |
81 new DocLint().run(args); |
287 String arg = args[i]; |
289 String arg = args[i]; |
288 if (arg.equals(XMSGS_OPTION)) { |
290 if (arg.equals(XMSGS_OPTION)) { |
289 env.messages.setOptions(null); |
291 env.messages.setOptions(null); |
290 } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) { |
292 } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) { |
291 env.messages.setOptions(arg.substring(arg.indexOf(":") + 1)); |
293 env.messages.setOptions(arg.substring(arg.indexOf(":") + 1)); |
|
294 } else if (arg.matches(XIMPLICIT_HEADERS + "[1-6]")) { |
|
295 char ch = arg.charAt(arg.length() - 1); |
|
296 env.setImplicitHeaders(Character.digit(ch, 10)); |
292 } else |
297 } else |
293 throw new IllegalArgumentException(arg); |
298 throw new IllegalArgumentException(arg); |
294 } |
299 } |
295 env.init(task); |
300 env.init(task); |
296 |
301 |