author | jjg |
Wed, 02 May 2018 11:11:06 -0700 | |
changeset 49952 | a6224ea48b66 |
parent 49879 | 601277b1d582 |
child 50240 | b9c483223a91 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48759
ffa68af7da87
8195795: Organize output files by module/package, not just package
jjg
parents:
48029
diff
changeset
|
2 |
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.toolkit; |
10 | 27 |
|
14258 | 28 |
import java.io.*; |
29 |
import java.util.*; |
|
35419 | 30 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
31 |
import javax.lang.model.element.Element; |
36526 | 32 |
import javax.lang.model.element.ModuleElement; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
33 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
34 |
import javax.lang.model.element.TypeElement; |
42277 | 35 |
import javax.lang.model.util.SimpleElementVisitor9; |
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
19937
diff
changeset
|
36 |
import javax.tools.JavaFileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
37 |
import javax.tools.JavaFileObject; |
14258 | 38 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
39 |
import com.sun.source.util.DocTreePath; |
42277 | 40 |
import com.sun.tools.javac.util.DefinedBy; |
41 |
import com.sun.tools.javac.util.DefinedBy.Api; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
42 |
import jdk.javadoc.doclet.Doclet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
43 |
import jdk.javadoc.doclet.DocletEnvironment; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
44 |
import jdk.javadoc.doclet.Reporter; |
49952
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
45 |
import jdk.javadoc.doclet.StandardDoclet; |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
46 |
import jdk.javadoc.doclet.Taglet; |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.formats.html.HtmlDoclet; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
49 |
import jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
50 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
51 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory; |
40587 | 52 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
54 |
import jdk.javadoc.internal.doclets.toolkit.util.Extern; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
55 |
import jdk.javadoc.internal.doclets.toolkit.util.Group; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
56 |
import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords; |
40587 | 57 |
import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
58 |
import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
59 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
60 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils.Pair; |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
61 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberCache; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
62 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
63 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
64 |
import static javax.tools.Diagnostic.Kind.*; |
10 | 65 |
|
66 |
/** |
|
67 |
* Configure the output based on the options. Doclets should sub-class |
|
45417 | 68 |
* BaseConfiguration, to configure and add their own options. This class contains |
48759
ffa68af7da87
8195795: Organize output files by module/package, not just package
jjg
parents:
48029
diff
changeset
|
69 |
* all user options which are supported by the standard doclet. |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
70 |
* <p> |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
71 |
* <p><b>This is NOT part of any supported API. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
72 |
* If you write code that depends on this, you do so at your own risk. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
73 |
* This code and its internal interfaces are subject to change or |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
74 |
* deletion without notice.</b> |
10 | 75 |
* |
76 |
* @author Robert Field. |
|
77 |
* @author Atul Dambalkar. |
|
78 |
* @author Jamie Ho |
|
79 |
*/ |
|
45417 | 80 |
public abstract class BaseConfiguration { |
44388 | 81 |
/** |
82 |
* The doclet that created this configuration. |
|
83 |
*/ |
|
84 |
public final Doclet doclet; |
|
10 | 85 |
|
86 |
/** |
|
87 |
* The factory for builders. |
|
88 |
*/ |
|
89 |
protected BuilderFactory builderFactory; |
|
90 |
||
91 |
/** |
|
92 |
* The taglet manager. |
|
93 |
*/ |
|
94 |
public TagletManager tagletManager; |
|
95 |
||
96 |
/** |
|
97 |
* The path to the builder XML input file. |
|
98 |
*/ |
|
99 |
public String builderXMLPath; |
|
100 |
||
101 |
/** |
|
102 |
* The default path to the builder XML. |
|
103 |
*/ |
|
40587 | 104 |
public static final String DEFAULT_BUILDER_XML = "resources/doclet.xml"; |
10 | 105 |
|
106 |
/** |
|
107 |
* The path to Taglets |
|
108 |
*/ |
|
42277 | 109 |
public String tagletpath = null; |
10 | 110 |
|
111 |
/** |
|
112 |
* This is true if option "-serialwarn" is used. Defualt value is false to |
|
14545
2e7bab0639b8
6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
14544
diff
changeset
|
113 |
* suppress excessive warnings about serial tag. |
10 | 114 |
*/ |
115 |
public boolean serialwarn = false; |
|
116 |
||
117 |
/** |
|
118 |
* The specified amount of space between tab stops. |
|
119 |
*/ |
|
14542 | 120 |
public int sourcetab; |
121 |
||
122 |
public String tabSpaces; |
|
10 | 123 |
|
124 |
/** |
|
125 |
* True if we should generate browsable sources. |
|
126 |
*/ |
|
127 |
public boolean linksource = false; |
|
128 |
||
129 |
/** |
|
130 |
* True if command line option "-nosince" is used. Default value is |
|
131 |
* false. |
|
132 |
*/ |
|
133 |
public boolean nosince = false; |
|
134 |
||
135 |
/** |
|
136 |
* True if we should recursively copy the doc-file subdirectories |
|
137 |
*/ |
|
138 |
public boolean copydocfilesubdirs = false; |
|
139 |
||
140 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
141 |
* Maintain backward compatibility with previous javadoc version |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
142 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
143 |
public boolean backwardCompatibility = true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
144 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
145 |
/** |
10 | 146 |
* True if user wants to add member names as meta keywords. |
147 |
* Set to false because meta keywords are ignored in general |
|
148 |
* by most Internet search engines. |
|
149 |
*/ |
|
150 |
public boolean keywords = false; |
|
151 |
||
152 |
/** |
|
1475 | 153 |
* The meta tag keywords instance. |
10 | 154 |
*/ |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
155 |
public final MetaKeywords metakeywords; |
10 | 156 |
|
157 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
158 |
* The set of doc-file subdirectories to exclude |
10 | 159 |
*/ |
868 | 160 |
protected Set<String> excludedDocFileDirs; |
10 | 161 |
|
162 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
163 |
* The set of qualifiers to exclude |
10 | 164 |
*/ |
868 | 165 |
protected Set<String> excludedQualifiers; |
10 | 166 |
|
167 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
168 |
* The doclet environment. |
10 | 169 |
*/ |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
170 |
public DocletEnvironment docEnv; |
10 | 171 |
|
172 |
/** |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
173 |
* An utility class for commonly used helpers |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
174 |
*/ |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
175 |
public Utils utils; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
176 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
177 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
178 |
* All the temporary accessors to javac internals. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
179 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
180 |
public WorkArounds workArounds; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
181 |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
182 |
/** |
10 | 183 |
* Destination directory name, in which doclet will generate the entire |
184 |
* documentation. Default is current directory. |
|
185 |
*/ |
|
186 |
public String destDirName = ""; |
|
187 |
||
188 |
/** |
|
189 |
* Destination directory name, in which doclet will copy the doc-files to. |
|
190 |
*/ |
|
191 |
public String docFileDestDirName = ""; |
|
192 |
||
193 |
/** |
|
194 |
* Encoding for this document. Default is default encoding for this |
|
195 |
* platform. |
|
196 |
*/ |
|
197 |
public String docencoding = null; |
|
198 |
||
199 |
/** |
|
200 |
* True if user wants to suppress descriptions and tags. |
|
201 |
*/ |
|
202 |
public boolean nocomment = false; |
|
203 |
||
204 |
/** |
|
205 |
* Encoding for this document. Default is default encoding for this |
|
206 |
* platform. |
|
207 |
*/ |
|
208 |
public String encoding = null; |
|
209 |
||
210 |
/** |
|
211 |
* Generate author specific information for all the classes if @author |
|
212 |
* tag is used in the doc comment and if -author option is used. |
|
213 |
* <code>showauthor</code> is set to true if -author option is used. |
|
214 |
* Default is don't show author information. |
|
215 |
*/ |
|
216 |
public boolean showauthor = false; |
|
217 |
||
218 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
219 |
* Generate documentation for JavaFX getters and setters automatically |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
220 |
* by copying it from the appropriate property definition. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
221 |
*/ |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
222 |
public boolean javafx = false; |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
223 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
224 |
/** |
10 | 225 |
* Generate version specific information for the all the classes |
226 |
* if @version tag is used in the doc comment and if -version option is |
|
227 |
* used. <code>showversion</code> is set to true if -version option is |
|
228 |
* used.Default is don't show version information. |
|
229 |
*/ |
|
230 |
public boolean showversion = false; |
|
231 |
||
232 |
/** |
|
43261 | 233 |
* Allow JavaScript in doc comments. |
234 |
*/ |
|
235 |
private boolean allowScriptInComments = false; |
|
236 |
||
237 |
/** |
|
36526 | 238 |
* Sourcepath from where to read the source files. Default is classpath. |
239 |
*/ |
|
240 |
public String sourcepath = ""; |
|
241 |
||
242 |
/** |
|
243 |
* Generate modules documentation if more than one module is present. |
|
244 |
*/ |
|
245 |
public boolean showModules = false; |
|
246 |
||
247 |
/** |
|
10 | 248 |
* Don't generate deprecated API information at all, if -nodeprecated |
249 |
* option is used. <code>nodepracted</code> is set to true if |
|
250 |
* -nodeprecated option is used. Default is generate deprected API |
|
251 |
* information. |
|
252 |
*/ |
|
253 |
public boolean nodeprecated = false; |
|
254 |
||
255 |
/** |
|
256 |
* The catalog of classes specified on the command-line |
|
257 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
258 |
public TypeElementCatalog typeElementCatalog; |
10 | 259 |
|
260 |
/** |
|
261 |
* True if user wants to suppress time stamp in output. |
|
262 |
* Default is false. |
|
263 |
*/ |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
264 |
public boolean notimestamp = false; |
10 | 265 |
|
266 |
/** |
|
1475 | 267 |
* The package grouping instance. |
10 | 268 |
*/ |
1475 | 269 |
public final Group group = new Group(this); |
10 | 270 |
|
271 |
/** |
|
1475 | 272 |
* The tracker of external package links. |
10 | 273 |
*/ |
274 |
public final Extern extern = new Extern(this); |
|
275 |
||
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
276 |
public Reporter reporter; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
277 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
278 |
public Locale locale; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
279 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
280 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
281 |
* Suppress all messages |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
282 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
283 |
public boolean quiet = false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
284 |
|
47395
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
285 |
/** |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
286 |
* Specifies whether those methods that override a super-type's method |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
287 |
* with no changes to the API contract should be summarized in the |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
288 |
* footnote section. |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
289 |
*/ |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
290 |
public boolean summarizeOverriddenMethods = false; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
291 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
292 |
// A list containing urls |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
293 |
private final List<String> linkList = new ArrayList<>(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
294 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
295 |
// A list of pairs containing urls and package list |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
296 |
private final List<Pair<String, String>> linkOfflineList = new ArrayList<>(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
297 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
298 |
|
41451 | 299 |
public boolean dumpOnError = false; |
300 |
||
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
301 |
private List<Pair<String, String>> groupPairs; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
302 |
|
40303 | 303 |
public abstract Messages getMessages(); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
304 |
|
40303 | 305 |
public abstract Resources getResources(); |
306 |
||
10 | 307 |
/** |
47849 | 308 |
* Returns a string identifying the version of the doclet. |
40587 | 309 |
* |
47849 | 310 |
* @return a version string |
10 | 311 |
*/ |
47849 | 312 |
public abstract String getDocletVersion(); |
10 | 313 |
|
314 |
/** |
|
40587 | 315 |
* This method should be defined in all those doclets (configurations), |
45417 | 316 |
* which want to derive themselves from this BaseConfiguration. This method |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
317 |
* can be used to finish up the options setup. |
40587 | 318 |
* |
319 |
* @return true if successful and false otherwise |
|
10 | 320 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
321 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
322 |
public abstract boolean finishOptionSettings(); |
10 | 323 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
324 |
public CommentUtils cmtUtils; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
325 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
326 |
/** |
41633
eec0f5b0465f
8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents:
41451
diff
changeset
|
327 |
* A sorted set of included packages. |
10 | 328 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
329 |
public SortedSet<PackageElement> packages = null; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
330 |
|
42277 | 331 |
public OverviewElement overviewElement; |
10 | 332 |
|
35420 | 333 |
public DocFileFactory docFileFactory; |
334 |
||
10 | 335 |
/** |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
336 |
* A sorted map, giving the (specified|included|other) packages for each module. |
36526 | 337 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
338 |
public SortedMap<ModuleElement, Set<PackageElement>> modulePackages; |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
339 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
340 |
/** |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
341 |
* The list of known modules, that should be documented. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
342 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
343 |
public SortedSet<ModuleElement> modules; |
36526 | 344 |
|
40303 | 345 |
protected static final String sharedResourceBundleName = |
346 |
"jdk.javadoc.internal.doclets.toolkit.resources.doclets"; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
347 |
|
36526 | 348 |
/** |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
349 |
* Primarily used to disable strict checks in the regression |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
350 |
* tests allowing those tests to be executed successfully, for |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
351 |
* instance, with OpenJDK builds which may not contain FX libraries. |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
352 |
*/ |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
353 |
public boolean disableJavaFxStrictChecks = false; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
354 |
|
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
355 |
VisibleMemberCache visibleMemberCache = null; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
356 |
|
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
357 |
public PropertyUtils propertyUtils = null; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
358 |
|
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
359 |
/** |
42277 | 360 |
* Constructs the configurations needed by the doclet. |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
361 |
* |
49952
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
362 |
* @apiNote |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
363 |
* The {@code doclet} parameter is used when {@link Taglet#init(DocletEnvironment, Doclet) |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
364 |
* initializing tags}. |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
365 |
* Some doclets (such as the {@link StandardDoclet), may delegate to another |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
366 |
* (such as the {@link HtmlDoclet}). In such cases, the primary doclet (i.e |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
367 |
* {@code StandardDoclet}) should be provided here, and not any internal |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
368 |
* class like {@code HtmlDoclet}. |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
369 |
* |
a6224ea48b66
8201817: Taglet.init should be called with the "primary" doclet
jjg
parents:
49879
diff
changeset
|
370 |
* @param doclet the doclet for this run of javadoc |
10 | 371 |
*/ |
45417 | 372 |
public BaseConfiguration(Doclet doclet) { |
44388 | 373 |
this.doclet = doclet; |
22163 | 374 |
excludedDocFileDirs = new HashSet<>(); |
375 |
excludedQualifiers = new HashSet<>(); |
|
14542 | 376 |
setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
377 |
metakeywords = new MetaKeywords(this); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
378 |
groupPairs = new ArrayList<>(0); |
42277 | 379 |
} |
380 |
||
381 |
private boolean initialized = false; |
|
382 |
||
383 |
protected void initConfiguration(DocletEnvironment docEnv) { |
|
384 |
if (initialized) { |
|
385 |
throw new IllegalStateException("configuration previously initialized"); |
|
386 |
} |
|
387 |
initialized = true; |
|
388 |
this.docEnv = docEnv; |
|
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
389 |
// Utils needs docEnv, safe to init now. |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
390 |
utils = new Utils(this); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
391 |
|
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
392 |
// Once docEnv and Utils have been initialized, others should be safe. |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
393 |
cmtUtils = new CommentUtils(this); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
394 |
workArounds = new WorkArounds(this); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
395 |
visibleMemberCache = new VisibleMemberCache(this); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
396 |
propertyUtils = new PropertyUtils(this); |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
397 |
|
42277 | 398 |
Splitter specifiedSplitter = new Splitter(docEnv, false); |
399 |
specifiedModuleElements = Collections.unmodifiableSet(specifiedSplitter.mset); |
|
400 |
specifiedPackageElements = Collections.unmodifiableSet(specifiedSplitter.pset); |
|
401 |
specifiedTypeElements = Collections.unmodifiableSet(specifiedSplitter.tset); |
|
402 |
||
403 |
Splitter includedSplitter = new Splitter(docEnv, true); |
|
404 |
includedModuleElements = Collections.unmodifiableSet(includedSplitter.mset); |
|
405 |
includedPackageElements = Collections.unmodifiableSet(includedSplitter.pset); |
|
406 |
includedTypeElements = Collections.unmodifiableSet(includedSplitter.tset); |
|
10 | 407 |
} |
408 |
||
409 |
/** |
|
410 |
* Return the builder factory for this doclet. |
|
411 |
* |
|
412 |
* @return the builder factory for this doclet. |
|
413 |
*/ |
|
414 |
public BuilderFactory getBuilderFactory() { |
|
415 |
if (builderFactory == null) { |
|
416 |
builderFactory = new BuilderFactory(this); |
|
417 |
} |
|
418 |
return builderFactory; |
|
419 |
} |
|
420 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
421 |
public Reporter getReporter() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
422 |
return this.reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
423 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
424 |
|
42277 | 425 |
private Set<ModuleElement> specifiedModuleElements; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
426 |
|
42277 | 427 |
public Set<ModuleElement> getSpecifiedModuleElements() { |
428 |
return specifiedModuleElements; |
|
429 |
} |
|
430 |
||
431 |
private Set<PackageElement> specifiedPackageElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
432 |
|
42277 | 433 |
public Set<PackageElement> getSpecifiedPackageElements() { |
434 |
return specifiedPackageElements; |
|
435 |
} |
|
436 |
||
437 |
private Set<TypeElement> specifiedTypeElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
438 |
|
42277 | 439 |
public Set<TypeElement> getSpecifiedTypeElements() { |
440 |
return specifiedTypeElements; |
|
441 |
} |
|
442 |
||
443 |
private Set<ModuleElement> includedModuleElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
444 |
|
42277 | 445 |
public Set<ModuleElement> getIncludedModuleElements() { |
446 |
return includedModuleElements; |
|
447 |
} |
|
448 |
||
449 |
private Set<PackageElement> includedPackageElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
450 |
|
42277 | 451 |
public Set<PackageElement> getIncludedPackageElements() { |
452 |
return includedPackageElements; |
|
453 |
} |
|
454 |
||
455 |
private Set<TypeElement> includedTypeElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
456 |
|
42277 | 457 |
public Set<TypeElement> getIncludedTypeElements() { |
458 |
return includedTypeElements; |
|
459 |
} |
|
460 |
||
36526 | 461 |
private void initModules() { |
462 |
// Build the modules structure used by the doclet |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
463 |
modules = new TreeSet<>(utils.makeModuleComparator()); |
42277 | 464 |
modules.addAll(getSpecifiedModuleElements()); |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
465 |
|
36526 | 466 |
modulePackages = new TreeMap<>(utils.makeModuleComparator()); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
467 |
for (PackageElement p : packages) { |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
468 |
ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p); |
36526 | 469 |
if (mdle != null && !mdle.isUnnamed()) { |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
470 |
Set<PackageElement> s = modulePackages |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
471 |
.computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator())); |
36526 | 472 |
s.add(p); |
473 |
} |
|
474 |
} |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
475 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
476 |
for (PackageElement p : getIncludedPackageElements()) { |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
477 |
ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
478 |
if (mdle != null && !mdle.isUnnamed()) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
479 |
Set<PackageElement> s = modulePackages |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
480 |
.computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator())); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
481 |
s.add(p); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
482 |
} |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
483 |
} |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
484 |
|
44293
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
485 |
// add entries for modules which may not have exported packages |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
486 |
modules.forEach((ModuleElement mdle) -> { |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
487 |
modulePackages.computeIfAbsent(mdle, m -> Collections.emptySet()); |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
488 |
}); |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
489 |
|
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37848
diff
changeset
|
490 |
modules.addAll(modulePackages.keySet()); |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
491 |
showModules = !modules.isEmpty(); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
492 |
for (Set<PackageElement> pkgs : modulePackages.values()) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
493 |
packages.addAll(pkgs); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
494 |
} |
36526 | 495 |
} |
496 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
497 |
private void initPackages() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
498 |
packages = new TreeSet<>(utils.makePackageComparator()); |
41633
eec0f5b0465f
8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents:
41451
diff
changeset
|
499 |
// add all the included packages |
42277 | 500 |
packages.addAll(includedPackageElements); |
10 | 501 |
} |
502 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
503 |
public Set<Doclet.Option> getSupportedOptions() { |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
504 |
Resources resources = getResources(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
505 |
Doclet.Option[] options = { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
506 |
new Option(resources, "-author") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
507 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
508 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
509 |
showauthor = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
510 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
511 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
512 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
513 |
new Option(resources, "-d", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
514 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
515 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
516 |
destDirName = addTrailingFileSep(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
517 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
518 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
519 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
520 |
new Option(resources, "-docencoding", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
521 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
522 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
523 |
docencoding = args.get(0); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
524 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
525 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
526 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
527 |
new Option(resources, "-docfilessubdirs") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
528 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
529 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
530 |
copydocfilesubdirs = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
531 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
532 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
533 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
534 |
new Hidden(resources, "-encoding", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
535 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
536 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
537 |
encoding = args.get(0); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
538 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
539 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
540 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
541 |
new Option(resources, "-excludedocfilessubdir", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
542 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
543 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
544 |
addToSet(excludedDocFileDirs, args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
545 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
546 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
547 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
548 |
new Option(resources, "-group", 2) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
549 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
550 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
551 |
groupPairs.add(new Pair<>(args.get(0), args.get(1))); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
552 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
553 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
554 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
555 |
new Option(resources, "--javafx -javafx") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
556 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
557 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
558 |
javafx = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
559 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
560 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
561 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
562 |
new Option(resources, "-keywords") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
563 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
564 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
565 |
keywords = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
566 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
567 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
568 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
569 |
new Option(resources, "-link", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
570 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
571 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
572 |
linkList.add(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
573 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
574 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
575 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
576 |
new Option(resources, "-linksource") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
577 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
578 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
579 |
linksource = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
580 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
581 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
582 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
583 |
new Option(resources, "-linkoffline", 2) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
584 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
585 |
public boolean process(String opt, List<String> args) { |
47427 | 586 |
linkOfflineList.add(new Pair<>(args.get(0), args.get(1))); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
587 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
588 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
589 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
590 |
new Option(resources, "-nocomment") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
591 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
592 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
593 |
nocomment = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
594 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
595 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
596 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
597 |
new Option(resources, "-nodeprecated") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
598 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
599 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
600 |
nodeprecated = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
601 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
602 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
603 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
604 |
new Option(resources, "-nosince") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
605 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
606 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
607 |
nosince = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
608 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
609 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
610 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
611 |
new Option(resources, "-notimestamp") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
612 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
613 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
614 |
notimestamp = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
615 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
616 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
617 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
618 |
new Option(resources, "-noqualifier", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
619 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
620 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
621 |
addToSet(excludedQualifiers, args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
622 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
623 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
624 |
}, |
47395
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
625 |
new Option(resources, "--override-methods", 1) { |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
626 |
@Override |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
627 |
public boolean process(String opt, List<String> args) { |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
628 |
String o = args.get(0); |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
629 |
switch (o) { |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
630 |
case "summary": |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
631 |
summarizeOverriddenMethods = true; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
632 |
break; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
633 |
case "detail": |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
634 |
summarizeOverriddenMethods = false; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
635 |
break; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
636 |
default: |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
637 |
reporter.print(ERROR, getText("doclet.Option_invalid", |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
638 |
o, "--override-methods")); |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
639 |
return false; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
640 |
} |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
641 |
return true; |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
642 |
} |
2ea4edfdef8e
8157000: Do not generate javadoc for overridden method with no spec change
ksrini
parents:
47216
diff
changeset
|
643 |
}, |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
644 |
new Hidden(resources, "-quiet") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
645 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
646 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
647 |
quiet = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
648 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
649 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
650 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
651 |
new Option(resources, "-serialwarn") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
652 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
653 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
654 |
serialwarn = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
655 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
656 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
657 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
658 |
new Option(resources, "-sourcetab", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
659 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
660 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
661 |
linksource = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
662 |
try { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
663 |
setTabWidth(Integer.parseInt(args.get(0))); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
664 |
} catch (NumberFormatException e) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
665 |
//Set to -1 so that warning will be printed |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
666 |
//to indicate what is valid argument. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
667 |
sourcetab = -1; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
668 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
669 |
if (sourcetab <= 0) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
670 |
getMessages().warning("doclet.sourcetab_warning"); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
671 |
setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
672 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
673 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
674 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
675 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
676 |
new Option(resources, "-tag", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
677 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
678 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
679 |
ArrayList<String> list = new ArrayList<>(); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
680 |
list.add(opt); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
681 |
list.add(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
682 |
customTagStrs.add(list); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
683 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
684 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
685 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
686 |
new Option(resources, "-taglet", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
687 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
688 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
689 |
ArrayList<String> list = new ArrayList<>(); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
690 |
list.add(opt); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
691 |
list.add(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
692 |
customTagStrs.add(list); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
693 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
694 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
695 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
696 |
new Option(resources, "-tagletpath", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
697 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
698 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
699 |
tagletpath = args.get(0); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
700 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
701 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
702 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
703 |
new Option(resources, "-version") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
704 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
705 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
706 |
showversion = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
707 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
708 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
709 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
710 |
new Hidden(resources, "--dump-on-error") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
711 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
712 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
713 |
dumpOnError = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
714 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
715 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
716 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
717 |
new Option(resources, "--allow-script-in-comments") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
718 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
719 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
720 |
allowScriptInComments = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
721 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
722 |
} |
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
723 |
}, |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
724 |
new Hidden(resources, "--disable-javafx-strict-checks") { |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
725 |
@Override |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
726 |
public boolean process(String opt, List<String> args) { |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
727 |
disableJavaFxStrictChecks = true; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
728 |
return true; |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
729 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
730 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
731 |
}; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
732 |
Set<Doclet.Option> set = new TreeSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
733 |
set.addAll(Arrays.asList(options)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
734 |
return set; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
735 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
736 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
737 |
final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
738 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
739 |
/* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
740 |
* when this is called all the option have been set, this method, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
741 |
* initializes certain components before anything else is started. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
742 |
*/ |
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
46079
diff
changeset
|
743 |
protected boolean finishOptionSettings0() throws DocletException { |
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47849
diff
changeset
|
744 |
|
40587 | 745 |
initDestDirectory(); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
746 |
for (String link : linkList) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
747 |
extern.link(link, reporter); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
748 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
749 |
for (Pair<String, String> linkOfflinePair : linkOfflineList) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
750 |
extern.link(linkOfflinePair.first, linkOfflinePair.second, reporter); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
751 |
} |
42277 | 752 |
typeElementCatalog = new TypeElementCatalog(includedTypeElements, this); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
753 |
initTagletManager(customTagStrs); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
754 |
groupPairs.stream().forEach((grp) -> { |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
755 |
if (showModules) { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
756 |
group.checkModuleGroups(grp.first, grp.second); |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
757 |
} else { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
758 |
group.checkPackageGroups(grp.first, grp.second); |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
759 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
760 |
}); |
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47849
diff
changeset
|
761 |
overviewElement = new OverviewElement(workArounds.getUnnamedPackage(), getOverviewPath()); |
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
46079
diff
changeset
|
762 |
return true; |
10 | 763 |
} |
764 |
||
765 |
/** |
|
766 |
* Set the command line options supported by this configuration. |
|
767 |
* |
|
36526 | 768 |
* @return true if the options are set successfully |
40587 | 769 |
* @throws DocletException if there is a problem while setting the options |
10 | 770 |
*/ |
40587 | 771 |
public boolean setOptions() throws DocletException { |
772 |
initPackages(); |
|
773 |
initModules(); |
|
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
46079
diff
changeset
|
774 |
if (!finishOptionSettings0() || !finishOptionSettings()) |
40587 | 775 |
return false; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
776 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
777 |
return true; |
10 | 778 |
} |
779 |
||
40587 | 780 |
private void initDestDirectory() throws DocletException { |
781 |
if (!destDirName.isEmpty()) { |
|
782 |
DocFile destDir = DocFile.createFileForDirectory(this, destDirName); |
|
783 |
if (!destDir.exists()) { |
|
784 |
//Create the output directory (in case it doesn't exist yet) |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
785 |
reporter.print(NOTE, getText("doclet.dest_dir_create", destDirName)); |
40587 | 786 |
destDir.mkdirs(); |
787 |
} else if (!destDir.isDirectory()) { |
|
788 |
throw new SimpleDocletException(getText( |
|
789 |
"doclet.destination_directory_not_directory_0", |
|
790 |
destDir.getPath())); |
|
791 |
} else if (!destDir.canWrite()) { |
|
792 |
throw new SimpleDocletException(getText( |
|
793 |
"doclet.destination_directory_not_writable_0", |
|
794 |
destDir.getPath())); |
|
795 |
} |
|
16324 | 796 |
} |
40587 | 797 |
DocFileFactory.getFactory(this).setDestDir(destDirName); |
16324 | 798 |
} |
799 |
||
10 | 800 |
/** |
801 |
* Initialize the taglet manager. The strings to initialize the simple custom tags should |
|
802 |
* be in the following format: "[tag name]:[location str]:[heading]". |
|
40587 | 803 |
* |
14545
2e7bab0639b8
6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
14544
diff
changeset
|
804 |
* @param customTagStrs the set two dimensional arrays of strings. These arrays contain |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
805 |
* either -tag or -taglet arguments. |
10 | 806 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
807 |
private void initTagletManager(Set<List<String>> customTagStrs) { |
10 | 808 |
tagletManager = tagletManager == null ? |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
809 |
new TagletManager(nosince, showversion, showauthor, javafx, this) : |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
810 |
tagletManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
811 |
for (List<String> args : customTagStrs) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
812 |
if (args.get(0).equals("-taglet")) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
813 |
tagletManager.addCustomTag(args.get(1), getFileManager(), tagletpath); |
10 | 814 |
continue; |
815 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
816 |
List<String> tokens = tokenize(args.get(1), TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
817 |
if (tokens.size() == 1) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
818 |
String tagName = args.get(1); |
10 | 819 |
if (tagletManager.isKnownCustomTag(tagName)) { |
820 |
//reorder a standard tag |
|
821 |
tagletManager.addNewSimpleCustomTag(tagName, null, ""); |
|
822 |
} else { |
|
823 |
//Create a simple tag with the heading that has the same name as the tag. |
|
14263 | 824 |
StringBuilder heading = new StringBuilder(tagName + ":"); |
10 | 825 |
heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); |
826 |
tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); |
|
827 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
828 |
} else if (tokens.size() == 2) { |
10 | 829 |
//Add simple taglet without heading, probably to excluding it in the output. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
830 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(1), ""); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
831 |
} else if (tokens.size() >= 3) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
832 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(2), tokens.get(1)); |
10 | 833 |
} else { |
40303 | 834 |
Messages messages = getMessages(); |
835 |
messages.error("doclet.Error_invalid_custom_tag_argument", args.get(1)); |
|
10 | 836 |
} |
837 |
} |
|
838 |
} |
|
839 |
||
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
840 |
/** |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
841 |
* Given a string, return an array of tokens. The separator can be escaped |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
842 |
* with the '\' character. The '\' character may also be escaped by the |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
843 |
* '\' character. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
844 |
* |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
845 |
* @param s the string to tokenize. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
846 |
* @param separator the separator char. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
847 |
* @param maxTokens the maximum number of tokens returned. If the |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
848 |
* max is reached, the remaining part of s is appended |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
849 |
* to the end of the last token. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
850 |
* @return an array of tokens. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
851 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
852 |
private List<String> tokenize(String s, char separator, int maxTokens) { |
22163 | 853 |
List<String> tokens = new ArrayList<>(); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
854 |
StringBuilder token = new StringBuilder(); |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
855 |
boolean prevIsEscapeChar = false; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
856 |
for (int i = 0; i < s.length(); i += Character.charCount(i)) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
857 |
int currentChar = s.codePointAt(i); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
858 |
if (prevIsEscapeChar) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
859 |
// Case 1: escaped character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
860 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
861 |
prevIsEscapeChar = false; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
862 |
} else if (currentChar == separator && tokens.size() < maxTokens - 1) { |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
863 |
// Case 2: separator |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
864 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
865 |
token = new StringBuilder(); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
866 |
} else if (currentChar == '\\') { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
867 |
// Case 3: escape character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
868 |
prevIsEscapeChar = true; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
869 |
} else { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
870 |
// Case 4: regular character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
871 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
872 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
873 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
874 |
if (token.length() > 0) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
875 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
876 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
877 |
return tokens; |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
878 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
879 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
880 |
private void addToSet(Set<String> s, String str) { |
10 | 881 |
StringTokenizer st = new StringTokenizer(str, ":"); |
882 |
String current; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
883 |
while (st.hasMoreTokens()) { |
10 | 884 |
current = st.nextToken(); |
885 |
s.add(current); |
|
886 |
} |
|
887 |
} |
|
888 |
||
889 |
/** |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
890 |
* Add a trailing file separator, if not found. Remove superfluous |
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
891 |
* file separators if any. Preserve the front double file separator for |
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
892 |
* UNC paths. |
10 | 893 |
* |
894 |
* @param path Path under consideration. |
|
895 |
* @return String Properly constructed path string. |
|
896 |
*/ |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
897 |
public static String addTrailingFileSep(String path) { |
10 | 898 |
String fs = System.getProperty("file.separator"); |
899 |
String dblfs = fs + fs; |
|
900 |
int indexDblfs; |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
901 |
while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) { |
10 | 902 |
path = path.substring(0, indexDblfs) + |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
903 |
path.substring(indexDblfs + fs.length()); |
10 | 904 |
} |
905 |
if (!path.endsWith(fs)) |
|
906 |
path += fs; |
|
907 |
return path; |
|
908 |
} |
|
909 |
||
910 |
/** |
|
911 |
* This checks for the validity of the options used by the user. |
|
42277 | 912 |
* As of this writing, this checks only docencoding. |
10 | 913 |
* |
914 |
* @return true if all the options are valid. |
|
915 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
916 |
public boolean generalValidOptions() { |
42277 | 917 |
if (docencoding != null) { |
918 |
if (!checkOutputFileEncoding(docencoding)) { |
|
919 |
return false; |
|
40587 | 920 |
} |
10 | 921 |
} |
42277 | 922 |
if (docencoding == null && (encoding != null && !encoding.isEmpty())) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
923 |
if (!checkOutputFileEncoding(encoding)) { |
10 | 924 |
return false; |
925 |
} |
|
926 |
} |
|
927 |
return true; |
|
928 |
} |
|
929 |
||
930 |
/** |
|
931 |
* Check the validity of the given Source or Output File encoding on this |
|
932 |
* platform. |
|
933 |
* |
|
934 |
* @param docencoding output file encoding. |
|
935 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
936 |
private boolean checkOutputFileEncoding(String docencoding) { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
937 |
OutputStream ost = new ByteArrayOutputStream(); |
10 | 938 |
OutputStreamWriter osw = null; |
939 |
try { |
|
940 |
osw = new OutputStreamWriter(ost, docencoding); |
|
941 |
} catch (UnsupportedEncodingException exc) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
942 |
reporter.print(ERROR, getText("doclet.Encoding_not_supported", docencoding)); |
10 | 943 |
return false; |
944 |
} finally { |
|
945 |
try { |
|
946 |
if (osw != null) { |
|
947 |
osw.close(); |
|
948 |
} |
|
949 |
} catch (IOException exc) { |
|
950 |
} |
|
951 |
} |
|
952 |
return true; |
|
953 |
} |
|
954 |
||
955 |
/** |
|
956 |
* Return true if the given doc-file subdirectory should be excluded and |
|
957 |
* false otherwise. |
|
40587 | 958 |
* |
10 | 959 |
* @param docfilesubdir the doc-files subdirectory to check. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
960 |
* @return true if the directory is excluded. |
10 | 961 |
*/ |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
962 |
public boolean shouldExcludeDocFileDir(String docfilesubdir) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
963 |
return excludedDocFileDirs.contains(docfilesubdir); |
10 | 964 |
} |
965 |
||
966 |
/** |
|
967 |
* Return true if the given qualifier should be excluded and false otherwise. |
|
40587 | 968 |
* |
10 | 969 |
* @param qualifier the qualifier to check. |
40587 | 970 |
* @return true if the qualifier should be excluded |
10 | 971 |
*/ |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
972 |
public boolean shouldExcludeQualifier(String qualifier) { |
10 | 973 |
if (excludedQualifiers.contains("all") || |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
974 |
excludedQualifiers.contains(qualifier) || |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
975 |
excludedQualifiers.contains(qualifier + ".*")) { |
10 | 976 |
return true; |
977 |
} else { |
|
978 |
int index = -1; |
|
979 |
while ((index = qualifier.indexOf(".", index + 1)) != -1) { |
|
980 |
if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) { |
|
981 |
return true; |
|
982 |
} |
|
983 |
} |
|
984 |
return false; |
|
985 |
} |
|
986 |
} |
|
987 |
||
988 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
989 |
* Return the qualified name of the Element if its qualifier is not excluded. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
990 |
* Otherwise return the unqualified Element name. |
40587 | 991 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
992 |
* @param te the TypeElement to check. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
993 |
* @return the class name |
10 | 994 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
995 |
public String getClassName(TypeElement te) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
996 |
PackageElement pkg = utils.containingPackage(te); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
997 |
return shouldExcludeQualifier(utils.getPackageName(pkg)) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
998 |
? utils.getSimpleName(te) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
999 |
: utils.getFullyQualifiedName(te); |
10 | 1000 |
} |
1001 |
||
40303 | 1002 |
/** |
1003 |
* Convenience method to obtain a resource from the doclet's |
|
1004 |
* {@link Resources resources}. |
|
1005 |
* Equivalent to <code>getResources.getText(key);</code>. |
|
40587 | 1006 |
* |
40303 | 1007 |
* @param key the key for the desired string |
1008 |
* @return the string for the given key |
|
1009 |
* @throws MissingResourceException if the key is not found in either |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1010 |
* bundle. |
40303 | 1011 |
*/ |
1012 |
public abstract String getText(String key); |
|
10 | 1013 |
|
40303 | 1014 |
/** |
1015 |
* Convenience method to obtain a resource from the doclet's |
|
1016 |
* {@link Resources resources}. |
|
1017 |
* Equivalent to <code>getResources.getText(key, args);</code>. |
|
40587 | 1018 |
* |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1019 |
* @param key the key for the desired string |
40303 | 1020 |
* @param args values to be substituted into the resulting string |
1021 |
* @return the string for the given key |
|
1022 |
* @throws MissingResourceException if the key is not found in either |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1023 |
* bundle. |
40303 | 1024 |
*/ |
1025 |
public abstract String getText(String key, String... args); |
|
10 | 1026 |
|
40303 | 1027 |
/** |
1028 |
* Convenience method to obtain a resource from the doclet's |
|
1029 |
* {@link Resources resources} as a {@code Content} object. |
|
1030 |
* |
|
1031 |
* @param key the key for the desired string |
|
1032 |
* @return a content tree for the text |
|
1033 |
*/ |
|
1034 |
public abstract Content getContent(String key); |
|
10 | 1035 |
|
40303 | 1036 |
/** |
1037 |
* Convenience method to obtain a resource from the doclet's |
|
1038 |
* {@link Resources resources} as a {@code Content} object. |
|
1039 |
* |
|
1040 |
* @param key the key for the desired string |
|
1041 |
* @param o string or content argument added to configuration text |
|
1042 |
* @return a content tree for the text |
|
1043 |
*/ |
|
1044 |
public abstract Content getContent(String key, Object o); |
|
10 | 1045 |
|
40303 | 1046 |
/** |
1047 |
* Convenience method to obtain a resource from the doclet's |
|
1048 |
* {@link Resources resources} as a {@code Content} object. |
|
1049 |
* |
|
1050 |
* @param key the key for the desired string |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1051 |
* @param o1 resource argument |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1052 |
* @param o2 resource argument |
40303 | 1053 |
* @return a content tree for the text |
1054 |
*/ |
|
1055 |
public abstract Content getContent(String key, Object o1, Object o2); |
|
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1056 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1057 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1058 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1059 |
* |
40303 | 1060 |
* @param key the key for the desired string |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1061 |
* @param o0 string or content argument added to configuration text |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1062 |
* @param o1 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1063 |
* @param o2 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1064 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1065 |
*/ |
40303 | 1066 |
public abstract Content getContent(String key, Object o0, Object o1, Object o2); |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1067 |
|
10 | 1068 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1069 |
* Return true if the TypeElement element is getting documented, depending upon |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
5520
diff
changeset
|
1070 |
* -nodeprecated option and the deprecation information. Return true if |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
5520
diff
changeset
|
1071 |
* -nodeprecated is not used. Return false if -nodeprecated is used and if |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1072 |
* either TypeElement element is deprecated or the containing package is deprecated. |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
5520
diff
changeset
|
1073 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1074 |
* @param te the TypeElement for which the page generation is checked |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1075 |
* @return true if it is a generated doc. |
10 | 1076 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1077 |
public boolean isGeneratedDoc(TypeElement te) { |
10 | 1078 |
if (!nodeprecated) { |
1079 |
return true; |
|
1080 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1081 |
return !(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te))); |
10 | 1082 |
} |
1083 |
||
1084 |
/** |
|
1085 |
* Return the doclet specific instance of a writer factory. |
|
40587 | 1086 |
* |
10 | 1087 |
* @return the {@link WriterFactory} for the doclet. |
1088 |
*/ |
|
1089 |
public abstract WriterFactory getWriterFactory(); |
|
1090 |
||
1091 |
/** |
|
1092 |
* Return the input stream to the builder XML. |
|
1093 |
* |
|
1094 |
* @return the input steam to the builder XML. |
|
40587 | 1095 |
* @throws DocFileIOException when the given XML file cannot be found or opened. |
10 | 1096 |
*/ |
40587 | 1097 |
public InputStream getBuilderXML() throws DocFileIOException { |
10 | 1098 |
return builderXMLPath == null ? |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1099 |
BaseConfiguration.class.getResourceAsStream(DEFAULT_BUILDER_XML) : |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1100 |
DocFile.createFileForInput(this, builderXMLPath).openInputStream(); |
10 | 1101 |
} |
1102 |
||
1103 |
/** |
|
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1104 |
* Return the Locale for this document. |
40587 | 1105 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1106 |
* @return the current locale |
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1107 |
*/ |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1108 |
public abstract Locale getLocale(); |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1109 |
|
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1110 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1111 |
* Return the path of the overview file and null if it does not exist. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1112 |
* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1113 |
* @return the path of the overview file. |
14544 | 1114 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1115 |
public abstract JavaFileObject getOverviewPath(); |
14544 | 1116 |
|
1117 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1118 |
* Return the current file manager. |
40587 | 1119 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1120 |
* @return JavaFileManager |
10 | 1121 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1122 |
public abstract JavaFileManager getFileManager(); |
14542 | 1123 |
|
1124 |
private void setTabWidth(int n) { |
|
1125 |
sourcetab = n; |
|
1126 |
tabSpaces = String.format("%" + n + "s", ""); |
|
1127 |
} |
|
15354 | 1128 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1129 |
public abstract boolean showMessage(DocTreePath path, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1130 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1131 |
public abstract boolean showMessage(Element e, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1132 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1133 |
public static abstract class Option implements Doclet.Option, Comparable<Option> { |
42277 | 1134 |
private final String[] names; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1135 |
private final String parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1136 |
private final String description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1137 |
private final int argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1138 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1139 |
protected Option(Resources resources, String name, int argCount) { |
44815
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1140 |
this(resources, null, name, argCount); |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1141 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1142 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1143 |
protected Option(Resources resources, String keyBase, String name, int argCount) { |
42277 | 1144 |
this.names = name.trim().split("\\s+"); |
44815
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1145 |
if (keyBase == null) { |
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1146 |
keyBase = "doclet.usage." + names[0].toLowerCase().replaceAll("^-+", ""); |
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1147 |
} |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1148 |
String desc = getOptionsMessage(resources, keyBase + ".description"); |
40314
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1149 |
if (desc.isEmpty()) { |
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1150 |
this.description = "<MISSING KEY>"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1151 |
this.parameters = "<MISSING KEY>"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1152 |
} else { |
40314
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1153 |
this.description = desc; |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1154 |
this.parameters = getOptionsMessage(resources, keyBase + ".parameters"); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1155 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1156 |
this.argCount = argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1157 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1158 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1159 |
protected Option(Resources resources, String name) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1160 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1161 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1162 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1163 |
private String getOptionsMessage(Resources resources, String key) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1164 |
try { |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1165 |
return resources.getText(key); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1166 |
} catch (MissingResourceException ignore) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1167 |
return ""; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1168 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1169 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1170 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1171 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1172 |
public String getDescription() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1173 |
return description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1174 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1175 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1176 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1177 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1178 |
return Doclet.Option.Kind.STANDARD; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1179 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1180 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1181 |
@Override |
42277 | 1182 |
public List<String> getNames() { |
1183 |
return Arrays.asList(names); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1184 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1185 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1186 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1187 |
public String getParameters() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1188 |
return parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1189 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1190 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1191 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1192 |
public String toString() { |
43872
b5ce3bc28931
8174839: javadoc crashes with a method which does not override a super.
ksrini
parents:
43261
diff
changeset
|
1193 |
return Arrays.toString(names); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1194 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1195 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1196 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1197 |
public int getArgumentCount() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1198 |
return argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1199 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1200 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1201 |
public boolean matches(String option) { |
42277 | 1202 |
for (String name : names) { |
1203 |
boolean matchCase = name.startsWith("--"); |
|
1204 |
if (option.startsWith("--") && option.contains("=")) { |
|
1205 |
return name.equals(option.substring(option.indexOf("=") + 1)); |
|
1206 |
} else if (matchCase) { |
|
1207 |
return name.equals(option); |
|
1208 |
} |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1209 |
return name.toLowerCase().equals(option.toLowerCase()); |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1210 |
} |
42277 | 1211 |
return false; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1212 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1213 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1214 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1215 |
public int compareTo(Option that) { |
42277 | 1216 |
return this.getNames().get(0).compareTo(that.getNames().get(0)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1217 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1218 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1219 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1220 |
public abstract class XOption extends Option { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1221 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1222 |
public XOption(Resources resources, String prefix, String name, int argCount) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1223 |
super(resources, prefix, name, argCount); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1224 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1225 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1226 |
public XOption(Resources resources, String name, int argCount) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1227 |
super(resources, name, argCount); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1228 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1229 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1230 |
public XOption(Resources resources, String name) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1231 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1232 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1233 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1234 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1235 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1236 |
return Doclet.Option.Kind.EXTENDED; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1237 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1238 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1239 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1240 |
public abstract class Hidden extends Option { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1241 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1242 |
public Hidden(Resources resources, String name, int argCount) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1243 |
super(resources, name, argCount); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1244 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1245 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1246 |
public Hidden(Resources resources, String name) { |
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1247 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1248 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1249 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1250 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1251 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1252 |
return Doclet.Option.Kind.OTHER; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1253 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1254 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1255 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1256 |
/* |
42277 | 1257 |
* Splits the elements in a collection to its individual |
1258 |
* collection. |
|
1259 |
*/ |
|
1260 |
static private class Splitter { |
|
1261 |
||
1262 |
final Set<ModuleElement> mset = new LinkedHashSet<>(); |
|
1263 |
final Set<PackageElement> pset = new LinkedHashSet<>(); |
|
1264 |
final Set<TypeElement> tset = new LinkedHashSet<>(); |
|
1265 |
||
1266 |
Splitter(DocletEnvironment docEnv, boolean included) { |
|
1267 |
||
1268 |
Set<? extends Element> inset = included |
|
1269 |
? docEnv.getIncludedElements() |
|
1270 |
: docEnv.getSpecifiedElements(); |
|
1271 |
||
1272 |
for (Element e : inset) { |
|
1273 |
new SimpleElementVisitor9<Void, Void>() { |
|
1274 |
@Override |
|
1275 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1276 |
public Void visitModule(ModuleElement e, Void p) { |
|
1277 |
mset.add(e); |
|
1278 |
return null; |
|
1279 |
} |
|
1280 |
||
1281 |
@Override |
|
1282 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1283 |
public Void visitPackage(PackageElement e, Void p) { |
|
1284 |
pset.add(e); |
|
1285 |
return null; |
|
1286 |
} |
|
1287 |
||
1288 |
@Override |
|
1289 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1290 |
public Void visitType(TypeElement e, Void p) { |
|
1291 |
tset.add(e); |
|
1292 |
return null; |
|
1293 |
} |
|
1294 |
||
1295 |
@Override |
|
1296 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1297 |
protected Void defaultAction(Element e, Void p) { |
|
1298 |
throw new AssertionError("unexpected element: " + e); |
|
1299 |
} |
|
1300 |
||
1301 |
}.visit(e); |
|
1302 |
} |
|
1303 |
} |
|
1304 |
} |
|
43261 | 1305 |
|
1306 |
/** |
|
1307 |
* Returns whether or not to allow JavaScript in comments. |
|
1308 |
* Default is off; can be set true from a command line option. |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1309 |
* |
43261 | 1310 |
* @return the allowScriptInComments |
1311 |
*/ |
|
1312 |
public boolean isAllowScriptInComments() { |
|
1313 |
return allowScriptInComments; |
|
1314 |
} |
|
44460 | 1315 |
|
49879
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
1316 |
public synchronized VisibleMemberTable getVisibleMemberTable(TypeElement te) { |
601277b1d582
8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents:
48759
diff
changeset
|
1317 |
return visibleMemberCache.getVisibleMemberTable(te); |
44460 | 1318 |
} |
10 | 1319 |
} |