|
28 | 28 |
|
29 | 29 | import java.io.File;
|
30 | 30 | import java.io.IOException;
|
31 |
| -import java.io.InputStream; |
32 | 31 | import java.nio.file.InvalidPathException;
|
33 | 32 | import java.nio.file.Path;
|
34 | 33 | import java.util.ArrayList;
|
|
60 | 59 | import javax.tools.StandardJavaFileManager;
|
61 | 60 |
|
62 | 61 | import com.sun.source.tree.CompilationUnitTree;
|
63 |
| -import com.sun.source.util.DocTreePath; |
64 | 62 | import com.sun.source.util.TreePath;
|
65 | 63 | import com.sun.tools.javac.util.DefinedBy;
|
66 | 64 | import com.sun.tools.javac.util.DefinedBy.Api;
|
|
74 | 72 | import jdk.javadoc.internal.doclets.toolkit.util.Comparators;
|
75 | 73 | import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
|
76 | 74 | import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory;
|
77 |
| -import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
78 | 75 | import jdk.javadoc.internal.doclets.toolkit.util.Extern;
|
79 | 76 | import jdk.javadoc.internal.doclets.toolkit.util.Group;
|
80 | 77 | import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords;
|
|
85 | 82 | import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberCache;
|
86 | 83 | import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
|
87 | 84 | import jdk.javadoc.internal.doclint.DocLint;
|
| 85 | +import jdk.javadoc.internal.doclint.Env; |
88 | 86 |
|
89 | 87 | /**
|
90 | 88 | * Configure the output based on the options. Doclets should subclass
|
@@ -640,10 +638,6 @@ public boolean isGeneratedDoc(TypeElement te) {
|
640 | 638 | */
|
641 | 639 | public abstract JavaFileManager getFileManager();
|
642 | 640 |
|
643 |
| - public abstract boolean showMessage(DocTreePath path, String key); |
644 |
| - |
645 |
| - public abstract boolean showMessage(Element e, String key); |
646 |
| - |
647 | 641 | /*
|
648 | 642 | * Splits the elements in a collection to its individual
|
649 | 643 | * collection.
|
@@ -803,8 +797,20 @@ public void initDocLint(List<String> opts, Set<String> customTagNames) {
|
803 | 797 | doclintOpts.toArray(new String[0]));
|
804 | 798 | }
|
805 | 799 |
|
806 |
| - public boolean haveDocLint() { |
807 |
| - return (doclint != null); |
| 800 | + public boolean isDocLintReferenceGroupEnabled() { |
| 801 | + return isDocLintGroupEnabled(jdk.javadoc.internal.doclint.Messages.Group.REFERENCE); |
| 802 | + } |
| 803 | + |
| 804 | + public boolean isDocLintSyntaxGroupEnabled() { |
| 805 | + return isDocLintGroupEnabled(jdk.javadoc.internal.doclint.Messages.Group.SYNTAX); |
| 806 | + } |
| 807 | + |
| 808 | + private boolean isDocLintGroupEnabled(jdk.javadoc.internal.doclint.Messages.Group group) { |
| 809 | + // Use AccessKind.PUBLIC as a stand-in, since it is not common to |
| 810 | + // set DocLint options per access kind (as is common with javac.) |
| 811 | + // A more sophisticated solution might be to derive the access kind from the |
| 812 | + // element owning the comment, and its enclosing elements. |
| 813 | + return doclint != null && doclint.isGroupEnabled(group, Env.AccessKind.PUBLIC); |
808 | 814 | }
|
809 | 815 | //</editor-fold>
|
810 | 816 | }
|
0 commit comments