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