author | ksrini |
Fri, 28 Jul 2017 15:00:53 -0700 | |
changeset 46079 | 059faa5e1267 |
parent 45871 | 878e21603932 |
child 46080 | 65ccd412049b |
permissions | -rw-r--r-- |
10 | 1 |
/* |
43872
b5ce3bc28931
8174839: javadoc crashes with a method which does not override a super.
ksrini
parents:
43261
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, 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.*; |
44460 | 29 |
import java.lang.ref.*; |
14258 | 30 |
import java.util.*; |
35419 | 31 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
32 |
import javax.lang.model.element.Element; |
36526 | 33 |
import javax.lang.model.element.ModuleElement; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
34 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
35 |
import javax.lang.model.element.TypeElement; |
42277 | 36 |
import javax.lang.model.util.SimpleElementVisitor9; |
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
19937
diff
changeset
|
37 |
import javax.tools.JavaFileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
38 |
import javax.tools.JavaFileObject; |
14258 | 39 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
40 |
import com.sun.source.util.DocTreePath; |
42277 | 41 |
import com.sun.tools.javac.util.DefinedBy; |
42 |
import com.sun.tools.javac.util.DefinedBy.Api; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
43 |
import jdk.javadoc.doclet.Doclet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
44 |
import jdk.javadoc.doclet.DocletEnvironment; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
45 |
import jdk.javadoc.doclet.Reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
49 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory; |
40587 | 50 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
51 |
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
52 |
import jdk.javadoc.internal.doclets.toolkit.util.Extern; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.toolkit.util.Group; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
54 |
import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords; |
40587 | 55 |
import jdk.javadoc.internal.doclets.toolkit.util.SimpleDocletException; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
56 |
import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
57 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
58 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils.Pair; |
44460 | 59 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
60 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.GetterSetter; |
44460 | 61 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
62 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
63 |
import static javax.tools.Diagnostic.Kind.*; |
10 | 64 |
|
65 |
/** |
|
66 |
* Configure the output based on the options. Doclets should sub-class |
|
45417 | 67 |
* BaseConfiguration, to configure and add their own options. This class contains |
10 | 68 |
* all user options which are supported by the 1.1 doclet and the standard |
69 |
* 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 |
* The META charset tag used for cross-platform viewing. |
147 |
*/ |
|
148 |
public String charset = ""; |
|
149 |
||
150 |
/** |
|
151 |
* True if user wants to add member names as meta keywords. |
|
152 |
* Set to false because meta keywords are ignored in general |
|
153 |
* by most Internet search engines. |
|
154 |
*/ |
|
155 |
public boolean keywords = false; |
|
156 |
||
157 |
/** |
|
1475 | 158 |
* The meta tag keywords instance. |
10 | 159 |
*/ |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
160 |
public final MetaKeywords metakeywords; |
10 | 161 |
|
162 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
163 |
* The set of doc-file subdirectories to exclude |
10 | 164 |
*/ |
868 | 165 |
protected Set<String> excludedDocFileDirs; |
10 | 166 |
|
167 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
168 |
* The set of qualifiers to exclude |
10 | 169 |
*/ |
868 | 170 |
protected Set<String> excludedQualifiers; |
10 | 171 |
|
172 |
/** |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
173 |
* The doclet environment. |
10 | 174 |
*/ |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
175 |
public DocletEnvironment docEnv; |
10 | 176 |
|
177 |
/** |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
178 |
* An utility class for commonly used helpers |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
179 |
*/ |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
180 |
public Utils utils; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
181 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
182 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
183 |
* All the temporary accessors to javac internals. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
184 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
185 |
public WorkArounds workArounds; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
186 |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
187 |
/** |
10 | 188 |
* Destination directory name, in which doclet will generate the entire |
189 |
* documentation. Default is current directory. |
|
190 |
*/ |
|
191 |
public String destDirName = ""; |
|
192 |
||
193 |
/** |
|
194 |
* Destination directory name, in which doclet will copy the doc-files to. |
|
195 |
*/ |
|
196 |
public String docFileDestDirName = ""; |
|
197 |
||
198 |
/** |
|
199 |
* Encoding for this document. Default is default encoding for this |
|
200 |
* platform. |
|
201 |
*/ |
|
202 |
public String docencoding = null; |
|
203 |
||
204 |
/** |
|
205 |
* True if user wants to suppress descriptions and tags. |
|
206 |
*/ |
|
207 |
public boolean nocomment = false; |
|
208 |
||
209 |
/** |
|
210 |
* Encoding for this document. Default is default encoding for this |
|
211 |
* platform. |
|
212 |
*/ |
|
213 |
public String encoding = null; |
|
214 |
||
215 |
/** |
|
216 |
* Generate author specific information for all the classes if @author |
|
217 |
* tag is used in the doc comment and if -author option is used. |
|
218 |
* <code>showauthor</code> is set to true if -author option is used. |
|
219 |
* Default is don't show author information. |
|
220 |
*/ |
|
221 |
public boolean showauthor = false; |
|
222 |
||
223 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
224 |
* 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
|
225 |
* 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
|
226 |
*/ |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
227 |
public boolean javafx = false; |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
228 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
229 |
/** |
10 | 230 |
* Generate version specific information for the all the classes |
231 |
* if @version tag is used in the doc comment and if -version option is |
|
232 |
* used. <code>showversion</code> is set to true if -version option is |
|
233 |
* used.Default is don't show version information. |
|
234 |
*/ |
|
235 |
public boolean showversion = false; |
|
236 |
||
237 |
/** |
|
43261 | 238 |
* Allow JavaScript in doc comments. |
239 |
*/ |
|
240 |
private boolean allowScriptInComments = false; |
|
241 |
||
242 |
/** |
|
36526 | 243 |
* Sourcepath from where to read the source files. Default is classpath. |
244 |
*/ |
|
245 |
public String sourcepath = ""; |
|
246 |
||
247 |
/** |
|
248 |
* Generate modules documentation if more than one module is present. |
|
249 |
*/ |
|
250 |
public boolean showModules = false; |
|
251 |
||
252 |
/** |
|
10 | 253 |
* Don't generate deprecated API information at all, if -nodeprecated |
254 |
* option is used. <code>nodepracted</code> is set to true if |
|
255 |
* -nodeprecated option is used. Default is generate deprected API |
|
256 |
* information. |
|
257 |
*/ |
|
258 |
public boolean nodeprecated = false; |
|
259 |
||
260 |
/** |
|
261 |
* The catalog of classes specified on the command-line |
|
262 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
263 |
public TypeElementCatalog typeElementCatalog; |
10 | 264 |
|
265 |
/** |
|
266 |
* True if user wants to suppress time stamp in output. |
|
267 |
* Default is false. |
|
268 |
*/ |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
269 |
public boolean notimestamp = false; |
10 | 270 |
|
271 |
/** |
|
1475 | 272 |
* The package grouping instance. |
10 | 273 |
*/ |
1475 | 274 |
public final Group group = new Group(this); |
10 | 275 |
|
276 |
/** |
|
1475 | 277 |
* The tracker of external package links. |
10 | 278 |
*/ |
279 |
public final Extern extern = new Extern(this); |
|
280 |
||
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
281 |
public Reporter reporter; |
35426
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 Locale locale; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
284 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
285 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
286 |
* Suppress all messages |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
287 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
288 |
public boolean quiet = false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
289 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
290 |
// A list containing urls |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
291 |
private final List<String> linkList = new ArrayList<>(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
292 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
293 |
// A list of pairs containing urls and package list |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
294 |
private final List<Pair<String, String>> linkOfflineList = new ArrayList<>(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
295 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
296 |
|
41451 | 297 |
public boolean dumpOnError = false; |
298 |
||
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
299 |
private List<Pair<String, String>> groupPairs; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
300 |
|
44460 | 301 |
private final Map<TypeElement, EnumMap<Kind, Reference<VisibleMemberMap>>> typeElementMemberCache; |
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 |
/** |
308 |
* Return the build date for the doclet. |
|
40587 | 309 |
* |
310 |
* @return the build date |
|
10 | 311 |
*/ |
312 |
public abstract String getDocletSpecificBuildDate(); |
|
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 |
|
35419 | 333 |
// The following three fields provide caches for use by all instances of VisibleMemberMap. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
334 |
public final Map<TypeElement, List<Element>> propertiesCache = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
335 |
public final Map<Element, Element> classPropertiesMap = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
336 |
public final Map<Element, GetterSetter> getterSetterMap = new HashMap<>(); |
35419 | 337 |
|
35420 | 338 |
public DocFileFactory docFileFactory; |
339 |
||
10 | 340 |
/** |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
341 |
* A sorted map, giving the (specified|included|other) packages for each module. |
36526 | 342 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
343 |
public SortedMap<ModuleElement, Set<PackageElement>> modulePackages; |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
344 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
345 |
/** |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
346 |
* The list of known modules, that should be documented. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
347 |
*/ |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
348 |
public SortedSet<ModuleElement> modules; |
36526 | 349 |
|
40303 | 350 |
protected static final String sharedResourceBundleName = |
351 |
"jdk.javadoc.internal.doclets.toolkit.resources.doclets"; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
352 |
|
36526 | 353 |
/** |
42277 | 354 |
* Constructs the configurations needed by the doclet. |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
355 |
* |
44388 | 356 |
* @param doclet the doclet that created this configuration |
10 | 357 |
*/ |
45417 | 358 |
public BaseConfiguration(Doclet doclet) { |
44388 | 359 |
this.doclet = doclet; |
22163 | 360 |
excludedDocFileDirs = new HashSet<>(); |
361 |
excludedQualifiers = new HashSet<>(); |
|
14542 | 362 |
setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
363 |
metakeywords = new MetaKeywords(this); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
364 |
groupPairs = new ArrayList<>(0); |
44460 | 365 |
typeElementMemberCache = new HashMap<>(); |
42277 | 366 |
} |
367 |
||
368 |
private boolean initialized = false; |
|
369 |
||
370 |
protected void initConfiguration(DocletEnvironment docEnv) { |
|
371 |
if (initialized) { |
|
372 |
throw new IllegalStateException("configuration previously initialized"); |
|
373 |
} |
|
374 |
initialized = true; |
|
375 |
this.docEnv = docEnv; |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
376 |
overviewElement = new OverviewElement(docEnv); |
42277 | 377 |
Splitter specifiedSplitter = new Splitter(docEnv, false); |
378 |
specifiedModuleElements = Collections.unmodifiableSet(specifiedSplitter.mset); |
|
379 |
specifiedPackageElements = Collections.unmodifiableSet(specifiedSplitter.pset); |
|
380 |
specifiedTypeElements = Collections.unmodifiableSet(specifiedSplitter.tset); |
|
381 |
||
382 |
Splitter includedSplitter = new Splitter(docEnv, true); |
|
383 |
includedModuleElements = Collections.unmodifiableSet(includedSplitter.mset); |
|
384 |
includedPackageElements = Collections.unmodifiableSet(includedSplitter.pset); |
|
385 |
includedTypeElements = Collections.unmodifiableSet(includedSplitter.tset); |
|
10 | 386 |
} |
387 |
||
388 |
/** |
|
389 |
* Return the builder factory for this doclet. |
|
390 |
* |
|
391 |
* @return the builder factory for this doclet. |
|
392 |
*/ |
|
393 |
public BuilderFactory getBuilderFactory() { |
|
394 |
if (builderFactory == null) { |
|
395 |
builderFactory = new BuilderFactory(this); |
|
396 |
} |
|
397 |
return builderFactory; |
|
398 |
} |
|
399 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
400 |
public Reporter getReporter() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
401 |
return this.reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
402 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
403 |
|
42277 | 404 |
private Set<ModuleElement> specifiedModuleElements; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
405 |
|
42277 | 406 |
public Set<ModuleElement> getSpecifiedModuleElements() { |
407 |
return specifiedModuleElements; |
|
408 |
} |
|
409 |
||
410 |
private Set<PackageElement> specifiedPackageElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
411 |
|
42277 | 412 |
public Set<PackageElement> getSpecifiedPackageElements() { |
413 |
return specifiedPackageElements; |
|
414 |
} |
|
415 |
||
416 |
private Set<TypeElement> specifiedTypeElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
417 |
|
42277 | 418 |
public Set<TypeElement> getSpecifiedTypeElements() { |
419 |
return specifiedTypeElements; |
|
420 |
} |
|
421 |
||
422 |
private Set<ModuleElement> includedModuleElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
423 |
|
42277 | 424 |
public Set<ModuleElement> getIncludedModuleElements() { |
425 |
return includedModuleElements; |
|
426 |
} |
|
427 |
||
428 |
private Set<PackageElement> includedPackageElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
429 |
|
42277 | 430 |
public Set<PackageElement> getIncludedPackageElements() { |
431 |
return includedPackageElements; |
|
432 |
} |
|
433 |
||
434 |
private Set<TypeElement> includedTypeElements; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
435 |
|
42277 | 436 |
public Set<TypeElement> getIncludedTypeElements() { |
437 |
return includedTypeElements; |
|
438 |
} |
|
439 |
||
36526 | 440 |
private void initModules() { |
441 |
// 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
|
442 |
modules = new TreeSet<>(utils.makeModuleComparator()); |
42277 | 443 |
modules.addAll(getSpecifiedModuleElements()); |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
444 |
|
36526 | 445 |
modulePackages = new TreeMap<>(utils.makeModuleComparator()); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
446 |
for (PackageElement p : packages) { |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
447 |
ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p); |
36526 | 448 |
if (mdle != null && !mdle.isUnnamed()) { |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
449 |
Set<PackageElement> s = modulePackages |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
450 |
.computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator())); |
36526 | 451 |
s.add(p); |
452 |
} |
|
453 |
} |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
454 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
455 |
for (PackageElement p : getIncludedPackageElements()) { |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
456 |
ModuleElement mdle = docEnv.getElementUtils().getModuleOf(p); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
457 |
if (mdle != null && !mdle.isUnnamed()) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
458 |
Set<PackageElement> s = modulePackages |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
459 |
.computeIfAbsent(mdle, m -> new TreeSet<>(utils.makePackageComparator())); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
460 |
s.add(p); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
461 |
} |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
462 |
} |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
463 |
|
44293
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
464 |
// 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
|
465 |
modules.forEach((ModuleElement mdle) -> { |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
466 |
modulePackages.computeIfAbsent(mdle, m -> Collections.emptySet()); |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
467 |
}); |
2f47b2c16612
8176778: javadoc does not produce summary pages for aggregated modules
ksrini
parents:
43872
diff
changeset
|
468 |
|
37943
2efb75c09230
8154262: Navigation bar in javadoc generated pages needs to be updated to display module information
bpatel
parents:
37848
diff
changeset
|
469 |
modules.addAll(modulePackages.keySet()); |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
470 |
showModules = !modules.isEmpty(); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
471 |
for (Set<PackageElement> pkgs : modulePackages.values()) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
472 |
packages.addAll(pkgs); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40314
diff
changeset
|
473 |
} |
36526 | 474 |
} |
475 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
476 |
private void initPackages() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
477 |
packages = new TreeSet<>(utils.makePackageComparator()); |
41633
eec0f5b0465f
8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents:
41451
diff
changeset
|
478 |
// add all the included packages |
42277 | 479 |
packages.addAll(includedPackageElements); |
10 | 480 |
} |
481 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
482 |
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
|
483 |
Resources resources = getResources(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
484 |
Doclet.Option[] options = { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
485 |
new Option(resources, "-author") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
486 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
487 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
488 |
showauthor = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
489 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
490 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
491 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
492 |
new Option(resources, "-d", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
493 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
494 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
495 |
destDirName = addTrailingFileSep(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
496 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
497 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
498 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
499 |
new Option(resources, "-docencoding", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
500 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
501 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
502 |
docencoding = args.get(0); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
503 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
504 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
505 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
506 |
new Option(resources, "-docfilessubdirs") { |
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 |
copydocfilesubdirs = 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 Hidden(resources, "-encoding", 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 |
encoding = 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, "-excludedocfilessubdir", 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 |
addToSet(excludedDocFileDirs, 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, "-group", 2) { |
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 |
groupPairs.add(new Pair<>(args.get(0), args.get(1))); |
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 Option(resources, "--javafx -javafx") { |
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 |
javafx = true; |
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, "-keywords") { |
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 |
keywords = true; |
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, "-link", 1) { |
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 |
linkList.add(args.get(0)); |
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, "-linksource") { |
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 |
linksource = 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, "-linkoffline", 2) { |
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 |
linkOfflineList.add(new Pair<String, String>(args.get(0), args.get(1))); |
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, "-nocomment") { |
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 |
nocomment = true; |
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, "-nodeprecated") { |
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 |
nodeprecated = 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, "-nosince") { |
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) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
586 |
nosince = true; |
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, "-notimestamp") { |
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 |
notimestamp = 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, "-noqualifier", 1) { |
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 |
addToSet(excludedQualifiers, args.get(0)); |
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 Hidden(resources, "-quiet") { |
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 |
quiet = 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, "-serialwarn") { |
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 |
serialwarn = 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, "-sourcetab", 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 |
linksource = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
622 |
try { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
623 |
setTabWidth(Integer.parseInt(args.get(0))); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
624 |
} catch (NumberFormatException e) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
625 |
//Set to -1 so that warning will be printed |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
626 |
//to indicate what is valid argument. |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
627 |
sourcetab = -1; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
628 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
629 |
if (sourcetab <= 0) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
630 |
getMessages().warning("doclet.sourcetab_warning"); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
631 |
setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
632 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
633 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
634 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
635 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
636 |
new Option(resources, "-tag", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
637 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
638 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
639 |
ArrayList<String> list = new ArrayList<>(); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
640 |
list.add(opt); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
641 |
list.add(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
642 |
customTagStrs.add(list); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
643 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
644 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
645 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
646 |
new Option(resources, "-taglet", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
647 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
648 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
649 |
ArrayList<String> list = new ArrayList<>(); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
650 |
list.add(opt); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
651 |
list.add(args.get(0)); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
652 |
customTagStrs.add(list); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
653 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
654 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
655 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
656 |
new Option(resources, "-tagletpath", 1) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
657 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
658 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
659 |
tagletpath = args.get(0); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
660 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
661 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
662 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
663 |
new Option(resources, "-version") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
664 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
665 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
666 |
showversion = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
667 |
return true; |
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 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
670 |
new Hidden(resources, "--dump-on-error") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
671 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
672 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
673 |
dumpOnError = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
674 |
return true; |
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 |
}, |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
677 |
new Option(resources, "--allow-script-in-comments") { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
678 |
@Override |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
679 |
public boolean process(String opt, List<String> args) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
680 |
allowScriptInComments = true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
681 |
return true; |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
682 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
683 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
684 |
}; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
685 |
Set<Doclet.Option> set = new TreeSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
686 |
set.addAll(Arrays.asList(options)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
687 |
return set; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
688 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
689 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
690 |
final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
691 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
692 |
/* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
693 |
* 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
|
694 |
* initializes certain components before anything else is started. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
695 |
*/ |
40587 | 696 |
private void finishOptionSettings0() throws DocletException { |
697 |
initDestDirectory(); |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
698 |
for (String link : linkList) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
699 |
extern.link(link, reporter); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
700 |
} |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
701 |
for (Pair<String, String> linkOfflinePair : linkOfflineList) { |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
702 |
extern.link(linkOfflinePair.first, linkOfflinePair.second, reporter); |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
703 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
704 |
if (docencoding == null) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
705 |
docencoding = encoding; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
706 |
} |
42277 | 707 |
typeElementCatalog = new TypeElementCatalog(includedTypeElements, this); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
708 |
initTagletManager(customTagStrs); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
709 |
groupPairs.stream().forEach((grp) -> { |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
710 |
if (showModules) { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
711 |
group.checkModuleGroups(grp.first, grp.second); |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
712 |
} else { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
713 |
group.checkPackageGroups(grp.first, grp.second); |
45157
f5f796453339
8178043: Support grouping modules in unified javadoc
bpatel
parents:
44815
diff
changeset
|
714 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
715 |
}); |
10 | 716 |
} |
717 |
||
718 |
/** |
|
719 |
* Set the command line options supported by this configuration. |
|
720 |
* |
|
36526 | 721 |
* @return true if the options are set successfully |
40587 | 722 |
* @throws DocletException if there is a problem while setting the options |
10 | 723 |
*/ |
40587 | 724 |
public boolean setOptions() throws DocletException { |
725 |
initPackages(); |
|
726 |
initModules(); |
|
727 |
finishOptionSettings0(); |
|
728 |
if (!finishOptionSettings()) |
|
729 |
return false; |
|
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 |
return true; |
10 | 732 |
} |
733 |
||
40587 | 734 |
private void initDestDirectory() throws DocletException { |
735 |
if (!destDirName.isEmpty()) { |
|
736 |
DocFile destDir = DocFile.createFileForDirectory(this, destDirName); |
|
737 |
if (!destDir.exists()) { |
|
738 |
//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
|
739 |
reporter.print(NOTE, getText("doclet.dest_dir_create", destDirName)); |
40587 | 740 |
destDir.mkdirs(); |
741 |
} else if (!destDir.isDirectory()) { |
|
742 |
throw new SimpleDocletException(getText( |
|
743 |
"doclet.destination_directory_not_directory_0", |
|
744 |
destDir.getPath())); |
|
745 |
} else if (!destDir.canWrite()) { |
|
746 |
throw new SimpleDocletException(getText( |
|
747 |
"doclet.destination_directory_not_writable_0", |
|
748 |
destDir.getPath())); |
|
749 |
} |
|
16324 | 750 |
} |
40587 | 751 |
DocFileFactory.getFactory(this).setDestDir(destDirName); |
16324 | 752 |
} |
753 |
||
10 | 754 |
/** |
755 |
* Initialize the taglet manager. The strings to initialize the simple custom tags should |
|
756 |
* be in the following format: "[tag name]:[location str]:[heading]". |
|
40587 | 757 |
* |
14545
2e7bab0639b8
6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
14544
diff
changeset
|
758 |
* @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
|
759 |
* either -tag or -taglet arguments. |
10 | 760 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
761 |
private void initTagletManager(Set<List<String>> customTagStrs) { |
10 | 762 |
tagletManager = tagletManager == null ? |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
763 |
new TagletManager(nosince, showversion, showauthor, javafx, this) : |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
764 |
tagletManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
765 |
for (List<String> args : customTagStrs) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
766 |
if (args.get(0).equals("-taglet")) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
767 |
tagletManager.addCustomTag(args.get(1), getFileManager(), tagletpath); |
10 | 768 |
continue; |
769 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
770 |
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
|
771 |
if (tokens.size() == 1) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
772 |
String tagName = args.get(1); |
10 | 773 |
if (tagletManager.isKnownCustomTag(tagName)) { |
774 |
//reorder a standard tag |
|
775 |
tagletManager.addNewSimpleCustomTag(tagName, null, ""); |
|
776 |
} else { |
|
777 |
//Create a simple tag with the heading that has the same name as the tag. |
|
14263 | 778 |
StringBuilder heading = new StringBuilder(tagName + ":"); |
10 | 779 |
heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); |
780 |
tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); |
|
781 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
782 |
} else if (tokens.size() == 2) { |
10 | 783 |
//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
|
784 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(1), ""); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
785 |
} else if (tokens.size() >= 3) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
786 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(2), tokens.get(1)); |
10 | 787 |
} else { |
40303 | 788 |
Messages messages = getMessages(); |
789 |
messages.error("doclet.Error_invalid_custom_tag_argument", args.get(1)); |
|
10 | 790 |
} |
791 |
} |
|
792 |
} |
|
793 |
||
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
794 |
/** |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
795 |
* 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
|
796 |
* 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
|
797 |
* '\' character. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
798 |
* |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
799 |
* @param s the string to tokenize. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
800 |
* @param separator the separator char. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
801 |
* @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
|
802 |
* 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
|
803 |
* to the end of the last token. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
804 |
* @return an array of tokens. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
805 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
806 |
private List<String> tokenize(String s, char separator, int maxTokens) { |
22163 | 807 |
List<String> tokens = new ArrayList<>(); |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
808 |
StringBuilder token = new StringBuilder(); |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
809 |
boolean prevIsEscapeChar = false; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
810 |
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
|
811 |
int currentChar = s.codePointAt(i); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
812 |
if (prevIsEscapeChar) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
813 |
// Case 1: escaped character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
814 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
815 |
prevIsEscapeChar = false; |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
816 |
} else if (currentChar == separator && tokens.size() < maxTokens - 1) { |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
817 |
// Case 2: separator |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
818 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
819 |
token = new StringBuilder(); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
820 |
} else if (currentChar == '\\') { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
821 |
// Case 3: escape character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
822 |
prevIsEscapeChar = true; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
823 |
} else { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
824 |
// Case 4: regular character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
825 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
826 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
827 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
828 |
if (token.length() > 0) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
829 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
830 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
831 |
return tokens; |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
832 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
833 |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
834 |
private void addToSet(Set<String> s, String str) { |
10 | 835 |
StringTokenizer st = new StringTokenizer(str, ":"); |
836 |
String current; |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
837 |
while (st.hasMoreTokens()) { |
10 | 838 |
current = st.nextToken(); |
839 |
s.add(current); |
|
840 |
} |
|
841 |
} |
|
842 |
||
843 |
/** |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
844 |
* 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
|
845 |
* 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
|
846 |
* UNC paths. |
10 | 847 |
* |
848 |
* @param path Path under consideration. |
|
849 |
* @return String Properly constructed path string. |
|
850 |
*/ |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
851 |
public static String addTrailingFileSep(String path) { |
10 | 852 |
String fs = System.getProperty("file.separator"); |
853 |
String dblfs = fs + fs; |
|
854 |
int indexDblfs; |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
855 |
while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) { |
10 | 856 |
path = path.substring(0, indexDblfs) + |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
857 |
path.substring(indexDblfs + fs.length()); |
10 | 858 |
} |
859 |
if (!path.endsWith(fs)) |
|
860 |
path += fs; |
|
861 |
return path; |
|
862 |
} |
|
863 |
||
864 |
/** |
|
865 |
* This checks for the validity of the options used by the user. |
|
42277 | 866 |
* As of this writing, this checks only docencoding. |
10 | 867 |
* |
868 |
* @return true if all the options are valid. |
|
869 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
870 |
public boolean generalValidOptions() { |
42277 | 871 |
if (docencoding != null) { |
872 |
if (!checkOutputFileEncoding(docencoding)) { |
|
873 |
return false; |
|
40587 | 874 |
} |
10 | 875 |
} |
42277 | 876 |
if (docencoding == null && (encoding != null && !encoding.isEmpty())) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
877 |
if (!checkOutputFileEncoding(encoding)) { |
10 | 878 |
return false; |
879 |
} |
|
880 |
} |
|
881 |
return true; |
|
882 |
} |
|
883 |
||
884 |
/** |
|
885 |
* Check the validity of the given Source or Output File encoding on this |
|
886 |
* platform. |
|
887 |
* |
|
888 |
* @param docencoding output file encoding. |
|
889 |
* @param reporter used to report errors. |
|
890 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
891 |
private boolean checkOutputFileEncoding(String docencoding) { |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
892 |
OutputStream ost = new ByteArrayOutputStream(); |
10 | 893 |
OutputStreamWriter osw = null; |
894 |
try { |
|
895 |
osw = new OutputStreamWriter(ost, docencoding); |
|
896 |
} catch (UnsupportedEncodingException exc) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
897 |
reporter.print(ERROR, getText("doclet.Encoding_not_supported", docencoding)); |
10 | 898 |
return false; |
899 |
} finally { |
|
900 |
try { |
|
901 |
if (osw != null) { |
|
902 |
osw.close(); |
|
903 |
} |
|
904 |
} catch (IOException exc) { |
|
905 |
} |
|
906 |
} |
|
907 |
return true; |
|
908 |
} |
|
909 |
||
910 |
/** |
|
911 |
* Return true if the given doc-file subdirectory should be excluded and |
|
912 |
* false otherwise. |
|
40587 | 913 |
* |
10 | 914 |
* @param docfilesubdir the doc-files subdirectory to check. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
915 |
* @return true if the directory is excluded. |
10 | 916 |
*/ |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
917 |
public boolean shouldExcludeDocFileDir(String docfilesubdir) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
918 |
return excludedDocFileDirs.contains(docfilesubdir); |
10 | 919 |
} |
920 |
||
921 |
/** |
|
922 |
* Return true if the given qualifier should be excluded and false otherwise. |
|
40587 | 923 |
* |
10 | 924 |
* @param qualifier the qualifier to check. |
40587 | 925 |
* @return true if the qualifier should be excluded |
10 | 926 |
*/ |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
927 |
public boolean shouldExcludeQualifier(String qualifier) { |
10 | 928 |
if (excludedQualifiers.contains("all") || |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
929 |
excludedQualifiers.contains(qualifier) || |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
930 |
excludedQualifiers.contains(qualifier + ".*")) { |
10 | 931 |
return true; |
932 |
} else { |
|
933 |
int index = -1; |
|
934 |
while ((index = qualifier.indexOf(".", index + 1)) != -1) { |
|
935 |
if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) { |
|
936 |
return true; |
|
937 |
} |
|
938 |
} |
|
939 |
return false; |
|
940 |
} |
|
941 |
} |
|
942 |
||
943 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
944 |
* 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
|
945 |
* Otherwise return the unqualified Element name. |
40587 | 946 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
947 |
* @param te the TypeElement to check. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
948 |
* @return the class name |
10 | 949 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
950 |
public String getClassName(TypeElement te) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
951 |
PackageElement pkg = utils.containingPackage(te); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
952 |
return shouldExcludeQualifier(utils.getPackageName(pkg)) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
953 |
? utils.getSimpleName(te) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
954 |
: utils.getFullyQualifiedName(te); |
10 | 955 |
} |
956 |
||
40303 | 957 |
/** |
958 |
* Convenience method to obtain a resource from the doclet's |
|
959 |
* {@link Resources resources}. |
|
960 |
* Equivalent to <code>getResources.getText(key);</code>. |
|
40587 | 961 |
* |
40303 | 962 |
* @param key the key for the desired string |
963 |
* @return the string for the given key |
|
964 |
* @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
|
965 |
* bundle. |
40303 | 966 |
*/ |
967 |
public abstract String getText(String key); |
|
10 | 968 |
|
40303 | 969 |
/** |
970 |
* Convenience method to obtain a resource from the doclet's |
|
971 |
* {@link Resources resources}. |
|
972 |
* Equivalent to <code>getResources.getText(key, args);</code>. |
|
40587 | 973 |
* |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
974 |
* @param key the key for the desired string |
40303 | 975 |
* @param args values to be substituted into the resulting string |
976 |
* @return the string for the given key |
|
977 |
* @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
|
978 |
* bundle. |
40303 | 979 |
*/ |
980 |
public abstract String getText(String key, String... args); |
|
10 | 981 |
|
40303 | 982 |
/** |
983 |
* Convenience method to obtain a resource from the doclet's |
|
984 |
* {@link Resources resources} as a {@code Content} object. |
|
985 |
* |
|
986 |
* @param key the key for the desired string |
|
987 |
* @return a content tree for the text |
|
988 |
*/ |
|
989 |
public abstract Content getContent(String key); |
|
10 | 990 |
|
40303 | 991 |
/** |
992 |
* Convenience method to obtain a resource from the doclet's |
|
993 |
* {@link Resources resources} as a {@code Content} object. |
|
994 |
* |
|
995 |
* @param key the key for the desired string |
|
996 |
* @param o string or content argument added to configuration text |
|
997 |
* @return a content tree for the text |
|
998 |
*/ |
|
999 |
public abstract Content getContent(String key, Object o); |
|
10 | 1000 |
|
40303 | 1001 |
/** |
1002 |
* Convenience method to obtain a resource from the doclet's |
|
1003 |
* {@link Resources resources} as a {@code Content} object. |
|
1004 |
* |
|
1005 |
* @param key the key for the desired string |
|
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1006 |
* @param o1 resource argument |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1007 |
* @param o2 resource argument |
40303 | 1008 |
* @return a content tree for the text |
1009 |
*/ |
|
1010 |
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
|
1011 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1012 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1013 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1014 |
* |
40303 | 1015 |
* @param key the key for the desired string |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1016 |
* @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
|
1017 |
* @param o1 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1018 |
* @param o2 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1019 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1020 |
*/ |
40303 | 1021 |
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
|
1022 |
|
10 | 1023 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1024 |
* 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
|
1025 |
* -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
|
1026 |
* -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
|
1027 |
* 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
|
1028 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1029 |
* @param te the TypeElement for which the page generation is checked |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1030 |
* @return true if it is a generated doc. |
10 | 1031 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1032 |
public boolean isGeneratedDoc(TypeElement te) { |
10 | 1033 |
if (!nodeprecated) { |
1034 |
return true; |
|
1035 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1036 |
return !(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te))); |
10 | 1037 |
} |
1038 |
||
1039 |
/** |
|
1040 |
* Return the doclet specific instance of a writer factory. |
|
40587 | 1041 |
* |
10 | 1042 |
* @return the {@link WriterFactory} for the doclet. |
1043 |
*/ |
|
1044 |
public abstract WriterFactory getWriterFactory(); |
|
1045 |
||
1046 |
/** |
|
1047 |
* Return the input stream to the builder XML. |
|
1048 |
* |
|
1049 |
* @return the input steam to the builder XML. |
|
40587 | 1050 |
* @throws DocFileIOException when the given XML file cannot be found or opened. |
10 | 1051 |
*/ |
40587 | 1052 |
public InputStream getBuilderXML() throws DocFileIOException { |
10 | 1053 |
return builderXMLPath == null ? |
46079
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1054 |
BaseConfiguration.class.getResourceAsStream(DEFAULT_BUILDER_XML) : |
059faa5e1267
8184969: Cannot specify multiple -link to jdk9 javadoc
ksrini
parents:
45871
diff
changeset
|
1055 |
DocFile.createFileForInput(this, builderXMLPath).openInputStream(); |
10 | 1056 |
} |
1057 |
||
1058 |
/** |
|
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1059 |
* Return the Locale for this document. |
40587 | 1060 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1061 |
* @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
|
1062 |
*/ |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1063 |
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
|
1064 |
|
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1065 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1066 |
* 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
|
1067 |
* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1068 |
* @return the path of the overview file. |
14544 | 1069 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1070 |
public abstract JavaFileObject getOverviewPath(); |
14544 | 1071 |
|
1072 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1073 |
* Return the current file manager. |
40587 | 1074 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1075 |
* @return JavaFileManager |
10 | 1076 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1077 |
public abstract JavaFileManager getFileManager(); |
14542 | 1078 |
|
1079 |
private void setTabWidth(int n) { |
|
1080 |
sourcetab = n; |
|
1081 |
tabSpaces = String.format("%" + n + "s", ""); |
|
1082 |
} |
|
15354 | 1083 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1084 |
public abstract boolean showMessage(DocTreePath path, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1085 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1086 |
public abstract boolean showMessage(Element e, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1087 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1088 |
public static abstract class Option implements Doclet.Option, Comparable<Option> { |
42277 | 1089 |
private final String[] names; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1090 |
private final String parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1091 |
private final String description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1092 |
private final int argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1093 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1094 |
protected Option(Resources resources, String name, int argCount) { |
44815
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1095 |
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
|
1096 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1097 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1098 |
protected Option(Resources resources, String keyBase, String name, int argCount) { |
42277 | 1099 |
this.names = name.trim().split("\\s+"); |
44815
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1100 |
if (keyBase == null) { |
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1101 |
keyBase = "doclet.usage." + names[0].toLowerCase().replaceAll("^-+", ""); |
2a0f6c7033bd
8178830: standard doclet: -javafx option should be unhidden
ksrini
parents:
44460
diff
changeset
|
1102 |
} |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1103 |
String desc = getOptionsMessage(resources, keyBase + ".description"); |
40314
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1104 |
if (desc.isEmpty()) { |
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1105 |
this.description = "<MISSING KEY>"; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1106 |
this.parameters = "<MISSING KEY>"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1107 |
} else { |
40314
52f8470ce3e4
8163524: doclet resources doclet.usage.NAME.name are redundant
jjg
parents:
40303
diff
changeset
|
1108 |
this.description = desc; |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1109 |
this.parameters = getOptionsMessage(resources, keyBase + ".parameters"); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1110 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1111 |
this.argCount = argCount; |
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 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1114 |
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
|
1115 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1116 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1117 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1118 |
private String getOptionsMessage(Resources resources, String key) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1119 |
try { |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1120 |
return resources.getText(key); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1121 |
} catch (MissingResourceException ignore) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1122 |
return ""; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1123 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1124 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1125 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1126 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1127 |
public String getDescription() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1128 |
return description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1129 |
} |
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 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1132 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1133 |
return Doclet.Option.Kind.STANDARD; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1134 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1135 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1136 |
@Override |
42277 | 1137 |
public List<String> getNames() { |
1138 |
return Arrays.asList(names); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1139 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1140 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1141 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1142 |
public String getParameters() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1143 |
return parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1144 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1145 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1146 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1147 |
public String toString() { |
43872
b5ce3bc28931
8174839: javadoc crashes with a method which does not override a super.
ksrini
parents:
43261
diff
changeset
|
1148 |
return Arrays.toString(names); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1149 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1150 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1151 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1152 |
public int getArgumentCount() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1153 |
return argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1154 |
} |
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 |
public boolean matches(String option) { |
42277 | 1157 |
for (String name : names) { |
1158 |
boolean matchCase = name.startsWith("--"); |
|
1159 |
if (option.startsWith("--") && option.contains("=")) { |
|
1160 |
return name.equals(option.substring(option.indexOf("=") + 1)); |
|
1161 |
} else if (matchCase) { |
|
1162 |
return name.equals(option); |
|
1163 |
} |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1164 |
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
|
1165 |
} |
42277 | 1166 |
return false; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1167 |
} |
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 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1170 |
public int compareTo(Option that) { |
42277 | 1171 |
return this.getNames().get(0).compareTo(that.getNames().get(0)); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1172 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1173 |
} |
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 |
public abstract class XOption extends Option { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1176 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1177 |
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
|
1178 |
super(resources, prefix, name, argCount); |
35426
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 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1181 |
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
|
1182 |
super(resources, name, argCount); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1183 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1184 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1185 |
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
|
1186 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1187 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1188 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1189 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1190 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1191 |
return Doclet.Option.Kind.EXTENDED; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1192 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1193 |
} |
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 |
public abstract class Hidden extends Option { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1196 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1197 |
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
|
1198 |
super(resources, name, argCount); |
35426
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 |
|
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
1201 |
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
|
1202 |
this(resources, name, 0); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1203 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1204 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1205 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1206 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1207 |
return Doclet.Option.Kind.OTHER; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1208 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1209 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1210 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1211 |
/* |
42277 | 1212 |
* Splits the elements in a collection to its individual |
1213 |
* collection. |
|
1214 |
*/ |
|
1215 |
static private class Splitter { |
|
1216 |
||
1217 |
final Set<ModuleElement> mset = new LinkedHashSet<>(); |
|
1218 |
final Set<PackageElement> pset = new LinkedHashSet<>(); |
|
1219 |
final Set<TypeElement> tset = new LinkedHashSet<>(); |
|
1220 |
||
1221 |
Splitter(DocletEnvironment docEnv, boolean included) { |
|
1222 |
||
1223 |
Set<? extends Element> inset = included |
|
1224 |
? docEnv.getIncludedElements() |
|
1225 |
: docEnv.getSpecifiedElements(); |
|
1226 |
||
1227 |
for (Element e : inset) { |
|
1228 |
new SimpleElementVisitor9<Void, Void>() { |
|
1229 |
@Override |
|
1230 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1231 |
public Void visitModule(ModuleElement e, Void p) { |
|
1232 |
mset.add(e); |
|
1233 |
return null; |
|
1234 |
} |
|
1235 |
||
1236 |
@Override |
|
1237 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1238 |
public Void visitPackage(PackageElement e, Void p) { |
|
1239 |
pset.add(e); |
|
1240 |
return null; |
|
1241 |
} |
|
1242 |
||
1243 |
@Override |
|
1244 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1245 |
public Void visitType(TypeElement e, Void p) { |
|
1246 |
tset.add(e); |
|
1247 |
return null; |
|
1248 |
} |
|
1249 |
||
1250 |
@Override |
|
1251 |
@DefinedBy(Api.LANGUAGE_MODEL) |
|
1252 |
protected Void defaultAction(Element e, Void p) { |
|
1253 |
throw new AssertionError("unexpected element: " + e); |
|
1254 |
} |
|
1255 |
||
1256 |
}.visit(e); |
|
1257 |
} |
|
1258 |
} |
|
1259 |
} |
|
43261 | 1260 |
|
1261 |
/** |
|
1262 |
* Returns whether or not to allow JavaScript in comments. |
|
1263 |
* 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
|
1264 |
* |
43261 | 1265 |
* @return the allowScriptInComments |
1266 |
*/ |
|
1267 |
public boolean isAllowScriptInComments() { |
|
1268 |
return allowScriptInComments; |
|
1269 |
} |
|
44460 | 1270 |
|
1271 |
public VisibleMemberMap getVisibleMemberMap(TypeElement te, VisibleMemberMap.Kind kind) { |
|
1272 |
EnumMap<Kind, Reference<VisibleMemberMap>> cacheMap = typeElementMemberCache |
|
1273 |
.computeIfAbsent(te, k -> new EnumMap<>(VisibleMemberMap.Kind.class)); |
|
1274 |
||
1275 |
Reference<VisibleMemberMap> vmapRef = cacheMap.get(kind); |
|
1276 |
// recompute, if referent has been garbage collected |
|
1277 |
VisibleMemberMap vMap = vmapRef == null ? null : vmapRef.get(); |
|
1278 |
if (vMap == null) { |
|
1279 |
vMap = new VisibleMemberMap(te, kind, this); |
|
1280 |
cacheMap.put(kind, new SoftReference<>(vMap)); |
|
1281 |
} |
|
1282 |
return vMap; |
|
1283 |
} |
|
10 | 1284 |
} |