author | alanb |
Tue, 03 May 2016 09:11:12 +0100 | |
changeset 37848 | 3c8ff4204d2d |
parent 36526 | 3b41f1c69604 |
child 37943 | 2efb75c09230 |
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.*; |
|
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
30 |
import java.util.regex.Matcher; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
31 |
import java.util.regex.Pattern; |
35419 | 32 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
33 |
import javax.lang.model.element.Element; |
36526 | 34 |
import javax.lang.model.element.ModuleElement; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
35 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
36 |
import javax.lang.model.element.TypeElement; |
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
19937
diff
changeset
|
37 |
import javax.tools.JavaFileManager; |
36526 | 38 |
import javax.tools.JavaFileManager.Location; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
39 |
import javax.tools.JavaFileObject; |
14258 | 40 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
41 |
import com.sun.source.util.DocTreePath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
42 |
import jdk.javadoc.doclet.Doclet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
43 |
import jdk.javadoc.doclet.DocletEnvironment; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
44 |
import jdk.javadoc.doclet.Reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.toolkit.builders.BuilderFactory; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
47 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
48 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileFactory; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
49 |
import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
50 |
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
51 |
import jdk.javadoc.internal.doclets.toolkit.util.Extern; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
52 |
import jdk.javadoc.internal.doclets.toolkit.util.Group; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.toolkit.util.MessageRetriever; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
54 |
import jdk.javadoc.internal.doclets.toolkit.util.MetaKeywords; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
55 |
import jdk.javadoc.internal.doclets.toolkit.util.TypeElementCatalog; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
56 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
57 |
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.GetterSetter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
58 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
59 |
import static javax.tools.Diagnostic.Kind.*; |
10 | 60 |
|
61 |
/** |
|
62 |
* Configure the output based on the options. Doclets should sub-class |
|
63 |
* Configuration, to configure and add their own options. This class contains |
|
64 |
* all user options which are supported by the 1.1 doclet and the standard |
|
65 |
* doclet. |
|
66 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
67 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
68 |
* 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
|
69 |
* 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
|
70 |
* deletion without notice.</b> |
10 | 71 |
* |
72 |
* @author Robert Field. |
|
73 |
* @author Atul Dambalkar. |
|
74 |
* @author Jamie Ho |
|
75 |
*/ |
|
76 |
public abstract class Configuration { |
|
77 |
||
78 |
/** |
|
16324 | 79 |
* Exception used to report a problem during setOptions. |
80 |
*/ |
|
16560 | 81 |
public static class Fault extends Exception { |
16324 | 82 |
private static final long serialVersionUID = 0; |
83 |
||
84 |
Fault(String msg) { |
|
85 |
super(msg); |
|
86 |
} |
|
87 |
||
88 |
Fault(String msg, Exception cause) { |
|
89 |
super(msg, cause); |
|
90 |
} |
|
91 |
} |
|
92 |
||
93 |
/** |
|
10 | 94 |
* The factory for builders. |
95 |
*/ |
|
96 |
protected BuilderFactory builderFactory; |
|
97 |
||
98 |
/** |
|
99 |
* The taglet manager. |
|
100 |
*/ |
|
101 |
public TagletManager tagletManager; |
|
102 |
||
103 |
/** |
|
104 |
* The path to the builder XML input file. |
|
105 |
*/ |
|
106 |
public String builderXMLPath; |
|
107 |
||
108 |
/** |
|
109 |
* The default path to the builder XML. |
|
110 |
*/ |
|
111 |
private static final String DEFAULT_BUILDER_XML = "resources/doclet.xml"; |
|
112 |
||
113 |
/** |
|
114 |
* The path to Taglets |
|
115 |
*/ |
|
116 |
public String tagletpath = ""; |
|
117 |
||
118 |
/** |
|
119 |
* 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
|
120 |
* suppress excessive warnings about serial tag. |
10 | 121 |
*/ |
122 |
public boolean serialwarn = false; |
|
123 |
||
124 |
/** |
|
125 |
* The specified amount of space between tab stops. |
|
126 |
*/ |
|
14542 | 127 |
public int sourcetab; |
128 |
||
129 |
public String tabSpaces; |
|
10 | 130 |
|
131 |
/** |
|
132 |
* True if we should generate browsable sources. |
|
133 |
*/ |
|
134 |
public boolean linksource = false; |
|
135 |
||
136 |
/** |
|
137 |
* True if command line option "-nosince" is used. Default value is |
|
138 |
* false. |
|
139 |
*/ |
|
140 |
public boolean nosince = false; |
|
141 |
||
142 |
/** |
|
143 |
* True if we should recursively copy the doc-file subdirectories |
|
144 |
*/ |
|
145 |
public boolean copydocfilesubdirs = false; |
|
146 |
||
147 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
148 |
* Maintain backward compatibility with previous javadoc version |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
149 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
150 |
public boolean backwardCompatibility = true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
151 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
152 |
/** |
10 | 153 |
* The META charset tag used for cross-platform viewing. |
154 |
*/ |
|
155 |
public String charset = ""; |
|
156 |
||
157 |
/** |
|
158 |
* True if user wants to add member names as meta keywords. |
|
159 |
* Set to false because meta keywords are ignored in general |
|
160 |
* by most Internet search engines. |
|
161 |
*/ |
|
162 |
public boolean keywords = false; |
|
163 |
||
164 |
/** |
|
1475 | 165 |
* The meta tag keywords instance. |
10 | 166 |
*/ |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
167 |
public final MetaKeywords metakeywords; |
10 | 168 |
|
169 |
/** |
|
170 |
* The list of doc-file subdirectories to exclude |
|
171 |
*/ |
|
868 | 172 |
protected Set<String> excludedDocFileDirs; |
10 | 173 |
|
174 |
/** |
|
175 |
* The list of qualifiers to exclude |
|
176 |
*/ |
|
868 | 177 |
protected Set<String> excludedQualifiers; |
10 | 178 |
|
179 |
/** |
|
180 |
* The Root of the generated Program Structure from the Doclet API. |
|
181 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
182 |
public DocletEnvironment root; |
10 | 183 |
|
184 |
/** |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
185 |
* An utility class for commonly used helpers |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
186 |
*/ |
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
187 |
public Utils utils; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
188 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
189 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
190 |
* All the temporary accessors to javac internals. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
191 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
192 |
public WorkArounds workArounds; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
193 |
|
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
194 |
/** |
10 | 195 |
* Destination directory name, in which doclet will generate the entire |
196 |
* documentation. Default is current directory. |
|
197 |
*/ |
|
198 |
public String destDirName = ""; |
|
199 |
||
200 |
/** |
|
201 |
* Destination directory name, in which doclet will copy the doc-files to. |
|
202 |
*/ |
|
203 |
public String docFileDestDirName = ""; |
|
204 |
||
205 |
/** |
|
206 |
* Encoding for this document. Default is default encoding for this |
|
207 |
* platform. |
|
208 |
*/ |
|
209 |
public String docencoding = null; |
|
210 |
||
211 |
/** |
|
212 |
* True if user wants to suppress descriptions and tags. |
|
213 |
*/ |
|
214 |
public boolean nocomment = false; |
|
215 |
||
216 |
/** |
|
217 |
* Encoding for this document. Default is default encoding for this |
|
218 |
* platform. |
|
219 |
*/ |
|
220 |
public String encoding = null; |
|
221 |
||
222 |
/** |
|
223 |
* Generate author specific information for all the classes if @author |
|
224 |
* tag is used in the doc comment and if -author option is used. |
|
225 |
* <code>showauthor</code> is set to true if -author option is used. |
|
226 |
* Default is don't show author information. |
|
227 |
*/ |
|
228 |
public boolean showauthor = false; |
|
229 |
||
230 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
231 |
* 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
|
232 |
* 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
|
233 |
*/ |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
234 |
public boolean javafx = false; |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
235 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
236 |
/** |
10 | 237 |
* Generate version specific information for the all the classes |
238 |
* if @version tag is used in the doc comment and if -version option is |
|
239 |
* used. <code>showversion</code> is set to true if -version option is |
|
240 |
* used.Default is don't show version information. |
|
241 |
*/ |
|
242 |
public boolean showversion = false; |
|
243 |
||
244 |
/** |
|
36526 | 245 |
* Sourcepath from where to read the source files. Default is classpath. |
246 |
* |
|
247 |
*/ |
|
248 |
public String sourcepath = ""; |
|
249 |
||
250 |
/** |
|
251 |
* Generate modules documentation if more than one module is present. |
|
252 |
*/ |
|
253 |
public boolean showModules = false; |
|
254 |
||
255 |
/** |
|
10 | 256 |
* Don't generate deprecated API information at all, if -nodeprecated |
257 |
* option is used. <code>nodepracted</code> is set to true if |
|
258 |
* -nodeprecated option is used. Default is generate deprected API |
|
259 |
* information. |
|
260 |
*/ |
|
261 |
public boolean nodeprecated = false; |
|
262 |
||
263 |
/** |
|
264 |
* The catalog of classes specified on the command-line |
|
265 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
266 |
public TypeElementCatalog typeElementCatalog; |
10 | 267 |
|
268 |
/** |
|
269 |
* Message Retriever for the doclet, to retrieve message from the resource |
|
270 |
* file for this Configuration, which is common for 1.1 and standard |
|
271 |
* doclets. |
|
272 |
* |
|
273 |
* TODO: Make this private!!! |
|
274 |
*/ |
|
275 |
public MessageRetriever message = null; |
|
276 |
||
277 |
/** |
|
278 |
* True if user wants to suppress time stamp in output. |
|
279 |
* Default is false. |
|
280 |
*/ |
|
281 |
public boolean notimestamp= false; |
|
282 |
||
283 |
/** |
|
1475 | 284 |
* The package grouping instance. |
10 | 285 |
*/ |
1475 | 286 |
public final Group group = new Group(this); |
10 | 287 |
|
288 |
/** |
|
1475 | 289 |
* The tracker of external package links. |
10 | 290 |
*/ |
291 |
public final Extern extern = new Extern(this); |
|
292 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
293 |
public Reporter reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
294 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
295 |
public Locale locale; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
296 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
297 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
298 |
* Suppress all messages |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
299 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
300 |
public boolean quiet = false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
301 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
302 |
private String urlForLink; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
303 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
304 |
private String pkglistUrlForLink; |
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 |
private String urlForLinkOffline; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
307 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
308 |
private String pkglistUrlForLinkOffline; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
309 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
310 |
private List<GroupContainer> groups; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
311 |
|
10 | 312 |
/** |
313 |
* Return the build date for the doclet. |
|
314 |
*/ |
|
315 |
public abstract String getDocletSpecificBuildDate(); |
|
316 |
||
317 |
/** |
|
318 |
* This method should be defined in all those doclets(configurations), |
|
319 |
* which want to derive themselves from this Configuration. This method |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
320 |
* can be used to finish up the options setup. |
10 | 321 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
322 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
323 |
public abstract boolean finishOptionSettings(); |
10 | 324 |
|
325 |
/** |
|
326 |
* Return the doclet specific {@link MessageRetriever} |
|
327 |
* @return the doclet specific MessageRetriever. |
|
328 |
*/ |
|
329 |
public abstract MessageRetriever getDocletSpecificMsg(); |
|
330 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
331 |
public CommentUtils cmtUtils; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
332 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
333 |
/** |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22165
diff
changeset
|
334 |
* 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
|
335 |
* collection of packages that contain the classes specified on the |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
22165
diff
changeset
|
336 |
* command-line. |
10 | 337 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
338 |
public SortedSet<PackageElement> packages; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
339 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
340 |
protected final List<Doclet.Option> optionsProcessed; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
341 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
342 |
public final OverviewElement overviewElement; |
10 | 343 |
|
35419 | 344 |
// 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
|
345 |
public final Map<TypeElement, List<Element>> propertiesCache = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
346 |
public final Map<Element, Element> classPropertiesMap = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
347 |
public final Map<Element, GetterSetter> getterSetterMap = new HashMap<>(); |
35419 | 348 |
|
35420 | 349 |
public DocFileFactory docFileFactory; |
350 |
||
10 | 351 |
/** |
36526 | 352 |
* A sorted set of modules containing the packages. |
353 |
*/ |
|
354 |
public Map<ModuleElement, Set<PackageElement>> modulePackages; |
|
355 |
||
356 |
/** |
|
10 | 357 |
* Constructor. Constructs the message retriever with resource file. |
358 |
*/ |
|
359 |
public Configuration() { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
360 |
message = new MessageRetriever(this, "jdk.javadoc.internal.doclets.toolkit.resources.doclets"); |
22163 | 361 |
excludedDocFileDirs = new HashSet<>(); |
362 |
excludedQualifiers = new HashSet<>(); |
|
14542 | 363 |
setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
24221
diff
changeset
|
364 |
metakeywords = new MetaKeywords(this); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
365 |
optionsProcessed = new ArrayList<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
366 |
groups = new ArrayList<>(0); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
367 |
overviewElement = new OverviewElement(root); |
10 | 368 |
} |
369 |
||
370 |
/** |
|
371 |
* Return the builder factory for this doclet. |
|
372 |
* |
|
373 |
* @return the builder factory for this doclet. |
|
374 |
*/ |
|
375 |
public BuilderFactory getBuilderFactory() { |
|
376 |
if (builderFactory == null) { |
|
377 |
builderFactory = new BuilderFactory(this); |
|
378 |
} |
|
379 |
return builderFactory; |
|
380 |
} |
|
381 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
382 |
public Reporter getReporter() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
383 |
return this.reporter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
384 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
385 |
|
36526 | 386 |
private void initModules() { |
387 |
// Build the modules structure used by the doclet |
|
388 |
modulePackages = new TreeMap<>(utils.makeModuleComparator()); |
|
389 |
for (PackageElement p: packages) { |
|
390 |
ModuleElement mdle = root.getElementUtils().getModuleOf(p); |
|
391 |
if (mdle != null && !mdle.isUnnamed()) { |
|
392 |
Set<PackageElement> s = modulePackages.get(mdle); |
|
393 |
if (s == null) |
|
394 |
modulePackages.put(mdle, s = new TreeSet<>(utils.makePackageComparator())); |
|
395 |
s.add(p); |
|
396 |
} |
|
397 |
} |
|
398 |
showModules = (modulePackages.size() > 1); |
|
399 |
} |
|
400 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
401 |
private void initPackages() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
402 |
packages = new TreeSet<>(utils.makePackageComparator()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
403 |
packages.addAll(utils.getSpecifiedPackages()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
404 |
for (TypeElement aClass : utils.getSpecifiedClasses()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
405 |
packages.add(utils.containingPackage(aClass)); |
10 | 406 |
} |
407 |
} |
|
408 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
409 |
public Set<Doclet.Option> getSupportedOptions() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
410 |
Doclet.Option[] options = { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
411 |
new Option(this, "author") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
419 |
new Option(this, "d", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
427 |
new Option(this, "docencoding", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
435 |
new Option(this, "docfilessubdirs") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
443 |
new Hidden(this, "encoding", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
451 |
new Option(this, "excludedocfilessubdir", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
459 |
new Option(this, "group", 2) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
467 |
new Hidden(this, "javafx") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
475 |
new Option(this, "keywords") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
483 |
new Option(this, "link", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
492 |
new Option(this, "linksource") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
500 |
new Option(this, "linkoffline", 2) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
509 |
new Option(this, "nocomment") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
517 |
new Option(this, "nodeprecated") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
525 |
new Option(this, "nosince") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
533 |
new Option(this, "notimestamp") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
541 |
new Option(this, "noqualifier", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
549 |
new Hidden(this, "quiet") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
557 |
new Option(this, "serialwarn") { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
565 |
new Option(this, "sourcetab", 1) { |
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) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
578 |
message.warning("doclet.sourcetab_warning"); |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
584 |
new Option(this, "tag", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
595 |
new Option(this, "taglet", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
606 |
new Option(this, "tagletpath", 1) { |
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 |
}, |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
614 |
new Option(this, "version") { |
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 |
} |
19937
7dacecdfbad4
8015496: Information that package is deprecated is missing in profiles view
bpatel
parents:
19911
diff
changeset
|
621 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
622 |
}; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
623 |
Set<Doclet.Option> set = new TreeSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
624 |
set.addAll(Arrays.asList(options)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
625 |
return set; |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
626 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
627 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
628 |
final LinkedHashSet<List<String>> customTagStrs = new LinkedHashSet<>(); |
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 |
/* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
631 |
* 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
|
632 |
* initializes certain components before anything else is started. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
633 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
634 |
private void finishOptionSettings0() throws Fault { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
635 |
ensureOutputDirExists(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
636 |
if (urlForLink != null && pkglistUrlForLink != null) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
637 |
extern.link(urlForLink, pkglistUrlForLink, reporter, false); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
638 |
if (urlForLinkOffline != null && pkglistUrlForLinkOffline != null) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
639 |
extern.link(urlForLinkOffline, pkglistUrlForLinkOffline, reporter, true); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
640 |
if (docencoding == null) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
641 |
docencoding = encoding; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
642 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
643 |
typeElementCatalog = new TypeElementCatalog(utils.getSpecifiedClasses(), this); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
644 |
initTagletManager(customTagStrs); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
645 |
groups.stream().forEach((grp) -> { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
646 |
group.checkPackageGroups(grp.value1, grp.value2); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
647 |
}); |
10 | 648 |
} |
649 |
||
650 |
/** |
|
651 |
* Set the command line options supported by this configuration. |
|
652 |
* |
|
36526 | 653 |
* @return true if the options are set successfully |
10 | 654 |
* @throws DocletAbortException |
655 |
*/ |
|
36526 | 656 |
public boolean setOptions() throws Fault { |
19911 | 657 |
try { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
658 |
initPackages(); |
36526 | 659 |
initModules(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
660 |
finishOptionSettings0(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
661 |
if (!finishOptionSettings()) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
662 |
return false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
663 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
664 |
} catch (Fault f) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
665 |
throw new DocletAbortException(f.getMessage()); |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
14545
diff
changeset
|
666 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
667 |
return true; |
10 | 668 |
} |
669 |
||
16324 | 670 |
private void ensureOutputDirExists() throws Fault { |
671 |
DocFile destDir = DocFile.createFileForDirectory(this, destDirName); |
|
672 |
if (!destDir.exists()) { |
|
673 |
//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
|
674 |
if (!destDirName.isEmpty()) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
675 |
reporter.print(NOTE, getText("doclet.dest_dir_create", destDirName)); |
16324 | 676 |
destDir.mkdirs(); |
677 |
} else if (!destDir.isDirectory()) { |
|
678 |
throw new Fault(getText( |
|
679 |
"doclet.destination_directory_not_directory_0", |
|
680 |
destDir.getPath())); |
|
681 |
} else if (!destDir.canWrite()) { |
|
682 |
throw new Fault(getText( |
|
683 |
"doclet.destination_directory_not_writable_0", |
|
684 |
destDir.getPath())); |
|
685 |
} |
|
686 |
} |
|
687 |
||
10 | 688 |
/** |
689 |
* Initialize the taglet manager. The strings to initialize the simple custom tags should |
|
690 |
* be in the following format: "[tag name]:[location str]:[heading]". |
|
14545
2e7bab0639b8
6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
14544
diff
changeset
|
691 |
* @param customTagStrs the set two dimensional arrays of strings. These arrays contain |
10 | 692 |
* either -tag or -taglet arguments. |
693 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
694 |
private void initTagletManager(Set<List<String>> customTagStrs) { |
10 | 695 |
tagletManager = tagletManager == null ? |
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
696 |
new TagletManager(nosince, showversion, showauthor, javafx, message) : |
10 | 697 |
tagletManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
698 |
for (List<String> args : customTagStrs) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
699 |
if (args.get(0).equals("-taglet")) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
700 |
tagletManager.addCustomTag(args.get(1), getFileManager(), tagletpath); |
10 | 701 |
continue; |
702 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
703 |
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
|
704 |
if (tokens.size() == 1) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
705 |
String tagName = args.get(1); |
10 | 706 |
if (tagletManager.isKnownCustomTag(tagName)) { |
707 |
//reorder a standard tag |
|
708 |
tagletManager.addNewSimpleCustomTag(tagName, null, ""); |
|
709 |
} else { |
|
710 |
//Create a simple tag with the heading that has the same name as the tag. |
|
14263 | 711 |
StringBuilder heading = new StringBuilder(tagName + ":"); |
10 | 712 |
heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); |
713 |
tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); |
|
714 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
715 |
} else if (tokens.size() == 2) { |
10 | 716 |
//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
|
717 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(1), ""); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
718 |
} else if (tokens.size() >= 3) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
719 |
tagletManager.addNewSimpleCustomTag(tokens.get(0), tokens.get(2), tokens.get(1)); |
10 | 720 |
} else { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
721 |
message.error("doclet.Error_invalid_custom_tag_argument", args.get(1)); |
10 | 722 |
} |
723 |
} |
|
724 |
} |
|
725 |
||
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
726 |
/** |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
727 |
* 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
|
728 |
* 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
|
729 |
* '\' character. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
730 |
* |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
731 |
* @param s the string to tokenize. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
732 |
* @param separator the separator char. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
733 |
* @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
|
734 |
* 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
|
735 |
* to the end of the last token. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
736 |
* |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
737 |
* @return an array of tokens. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
738 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
739 |
private List<String> tokenize(String s, char separator, int maxTokens) { |
22163 | 740 |
List<String> tokens = new ArrayList<>(); |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
741 |
StringBuilder token = new StringBuilder (); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
742 |
boolean prevIsEscapeChar = false; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
743 |
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
|
744 |
int currentChar = s.codePointAt(i); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
745 |
if (prevIsEscapeChar) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
746 |
// Case 1: escaped character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
747 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
748 |
prevIsEscapeChar = false; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
749 |
} else if (currentChar == separator && tokens.size() < maxTokens-1) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
750 |
// Case 2: separator |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
751 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
752 |
token = new StringBuilder(); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
753 |
} else if (currentChar == '\\') { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
754 |
// Case 3: escape character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
755 |
prevIsEscapeChar = true; |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
756 |
} else { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
757 |
// Case 4: regular character |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
758 |
token.appendCodePoint(currentChar); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
759 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
760 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
761 |
if (token.length() > 0) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
762 |
tokens.add(token.toString()); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
763 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
764 |
return tokens; |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
765 |
} |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
766 |
|
868 | 767 |
private void addToSet(Set<String> s, String str){ |
10 | 768 |
StringTokenizer st = new StringTokenizer(str, ":"); |
769 |
String current; |
|
770 |
while(st.hasMoreTokens()){ |
|
771 |
current = st.nextToken(); |
|
772 |
s.add(current); |
|
773 |
} |
|
774 |
} |
|
775 |
||
776 |
/** |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
777 |
* 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
|
778 |
* 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
|
779 |
* UNC paths. |
10 | 780 |
* |
781 |
* @param path Path under consideration. |
|
782 |
* @return String Properly constructed path string. |
|
783 |
*/ |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
784 |
public static String addTrailingFileSep(String path) { |
10 | 785 |
String fs = System.getProperty("file.separator"); |
786 |
String dblfs = fs + fs; |
|
787 |
int indexDblfs; |
|
14061
9ac68cf0048b
4696488: javadoc doesn't handle UNC paths for destination directory
bpatel
parents:
13842
diff
changeset
|
788 |
while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) { |
10 | 789 |
path = path.substring(0, indexDblfs) + |
790 |
path.substring(indexDblfs + fs.length()); |
|
791 |
} |
|
792 |
if (!path.endsWith(fs)) |
|
793 |
path += fs; |
|
794 |
return path; |
|
795 |
} |
|
796 |
||
797 |
/** |
|
798 |
* 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
|
799 |
* This works exactly like DocErrorReporter. This will validate the options which are shared |
10 | 800 |
* by our doclets. For example, this method will flag an error using |
801 |
* the DocErrorReporter if user has used "-nohelp" and "-helpfile" option |
|
802 |
* together. |
|
803 |
* |
|
804 |
* @return true if all the options are valid. |
|
805 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
806 |
public boolean generalValidOptions() { |
10 | 807 |
boolean docencodingfound = false; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
808 |
for (Doclet.Option opt : optionsProcessed) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
809 |
if (opt.matches("-docencoding")) { |
10 | 810 |
docencodingfound = true; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
811 |
if (!checkOutputFileEncoding(docencoding)) { |
10 | 812 |
return false; |
813 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
814 |
}; |
10 | 815 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
816 |
if (!docencodingfound && (encoding != null && !encoding.isEmpty())) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
817 |
if (!checkOutputFileEncoding(encoding)) { |
10 | 818 |
return false; |
819 |
} |
|
820 |
} |
|
821 |
return true; |
|
822 |
} |
|
823 |
||
824 |
/** |
|
825 |
* Check the validity of the given Source or Output File encoding on this |
|
826 |
* platform. |
|
827 |
* |
|
828 |
* @param docencoding output file encoding. |
|
829 |
* @param reporter used to report errors. |
|
830 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
831 |
private boolean checkOutputFileEncoding(String docencoding) { |
10 | 832 |
OutputStream ost= new ByteArrayOutputStream(); |
833 |
OutputStreamWriter osw = null; |
|
834 |
try { |
|
835 |
osw = new OutputStreamWriter(ost, docencoding); |
|
836 |
} catch (UnsupportedEncodingException exc) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
837 |
reporter.print(ERROR, getText("doclet.Encoding_not_supported", docencoding)); |
10 | 838 |
return false; |
839 |
} finally { |
|
840 |
try { |
|
841 |
if (osw != null) { |
|
842 |
osw.close(); |
|
843 |
} |
|
844 |
} catch (IOException exc) { |
|
845 |
} |
|
846 |
} |
|
847 |
return true; |
|
848 |
} |
|
849 |
||
850 |
/** |
|
851 |
* Return true if the given doc-file subdirectory should be excluded and |
|
852 |
* false otherwise. |
|
853 |
* @param docfilesubdir the doc-files subdirectory to check. |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
854 |
* @return true if the directory is excluded. |
10 | 855 |
*/ |
856 |
public boolean shouldExcludeDocFileDir(String docfilesubdir){ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
857 |
return excludedDocFileDirs.contains(docfilesubdir); |
10 | 858 |
} |
859 |
||
860 |
/** |
|
861 |
* Return true if the given qualifier should be excluded and false otherwise. |
|
862 |
* @param qualifier the qualifier to check. |
|
863 |
*/ |
|
864 |
public boolean shouldExcludeQualifier(String qualifier){ |
|
865 |
if (excludedQualifiers.contains("all") || |
|
866 |
excludedQualifiers.contains(qualifier) || |
|
867 |
excludedQualifiers.contains(qualifier + ".*")) { |
|
868 |
return true; |
|
869 |
} else { |
|
870 |
int index = -1; |
|
871 |
while ((index = qualifier.indexOf(".", index + 1)) != -1) { |
|
872 |
if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) { |
|
873 |
return true; |
|
874 |
} |
|
875 |
} |
|
876 |
return false; |
|
877 |
} |
|
878 |
} |
|
879 |
||
880 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
881 |
* 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
|
882 |
* Otherwise return the unqualified Element name. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
883 |
* @param te the TypeElement to check. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
884 |
* @return the class name |
10 | 885 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
886 |
public String getClassName(TypeElement te) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
887 |
PackageElement pkg = utils.containingPackage(te); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
888 |
return shouldExcludeQualifier(utils.getPackageName(pkg)) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
889 |
? utils.getSimpleName(te) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
890 |
: utils.getFullyQualifiedName(te); |
10 | 891 |
} |
892 |
||
893 |
public String getText(String key) { |
|
894 |
try { |
|
895 |
//Check the doclet specific properties file. |
|
896 |
return getDocletSpecificMsg().getText(key); |
|
897 |
} catch (Exception e) { |
|
898 |
//Check the shared properties file. |
|
899 |
return message.getText(key); |
|
900 |
} |
|
901 |
} |
|
902 |
||
903 |
public String getText(String key, String a1) { |
|
904 |
try { |
|
905 |
//Check the doclet specific properties file. |
|
906 |
return getDocletSpecificMsg().getText(key, a1); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
907 |
} catch (MissingResourceException e) { |
10 | 908 |
//Check the shared properties file. |
909 |
return message.getText(key, a1); |
|
910 |
} |
|
911 |
} |
|
912 |
||
913 |
public String getText(String key, String a1, String a2) { |
|
914 |
try { |
|
915 |
//Check the doclet specific properties file. |
|
916 |
return getDocletSpecificMsg().getText(key, a1, a2); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
917 |
} catch (MissingResourceException e) { |
10 | 918 |
//Check the shared properties file. |
919 |
return message.getText(key, a1, a2); |
|
920 |
} |
|
921 |
} |
|
922 |
||
923 |
public String getText(String key, String a1, String a2, String a3) { |
|
924 |
try { |
|
925 |
//Check the doclet specific properties file. |
|
926 |
return getDocletSpecificMsg().getText(key, a1, a2, a3); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
927 |
} catch (MissingResourceException e) { |
10 | 928 |
//Check the shared properties file. |
929 |
return message.getText(key, a1, a2, a3); |
|
930 |
} |
|
931 |
} |
|
932 |
||
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17563
diff
changeset
|
933 |
public abstract Content newContent(); |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
934 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
935 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
936 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
937 |
* |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
938 |
* @param key the key to look for in the configuration file |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
939 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
940 |
*/ |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
941 |
public Content getResource(String key) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17563
diff
changeset
|
942 |
Content c = newContent(); |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
943 |
c.addContent(getText(key)); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
944 |
return c; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
945 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
946 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
947 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
948 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
949 |
* |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
950 |
* @param key the key to look for in the configuration file |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
951 |
* @param o string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
952 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
953 |
*/ |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
954 |
public Content getResource(String key, Object o) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
955 |
return getResource(key, o, null, null); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
956 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
957 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
958 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
959 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
960 |
* |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
961 |
* @param key the key to look for in the configuration file |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
962 |
* @param o1 resource argument |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
963 |
* @param o2 resource argument |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
964 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
965 |
*/ |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
966 |
public Content getResource(String key, Object o1, Object o2) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
967 |
return getResource(key, o1, o2, null); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
968 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
969 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
970 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
971 |
* Get the configuration string as a content. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
972 |
* |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
973 |
* @param key the key to look for in the configuration file |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
974 |
* @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
|
975 |
* @param o1 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
976 |
* @param o2 string or content argument added to configuration text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
977 |
* @return a content tree for the text |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
978 |
*/ |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
979 |
public Content getResource(String key, Object o0, Object o1, Object o2) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17563
diff
changeset
|
980 |
Content c = newContent(); |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
981 |
Pattern p = Pattern.compile("\\{([012])\\}"); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
982 |
String text = getText(key); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
983 |
Matcher m = p.matcher(text); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
984 |
int start = 0; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
985 |
while (m.find(start)) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
986 |
c.addContent(text.substring(start, m.start())); |
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 |
Object o = null; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
989 |
switch (m.group(1).charAt(0)) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
990 |
case '0': o = o0; break; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
991 |
case '1': o = o1; break; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
992 |
case '2': o = o2; break; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
993 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
994 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
995 |
if (o == null) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
996 |
c.addContent("{" + m.group(1) + "}"); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
997 |
} else if (o instanceof String) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
998 |
c.addContent((String) o); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
999 |
} else if (o instanceof Content) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1000 |
c.addContent((Content) o); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1001 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1002 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1003 |
start = m.end(); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1004 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1005 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1006 |
c.addContent(text.substring(start)); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1007 |
return c; |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1008 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1009 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
16560
diff
changeset
|
1010 |
|
10 | 1011 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1012 |
* 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
|
1013 |
* -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
|
1014 |
* -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
|
1015 |
* 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
|
1016 |
* |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1017 |
* @param te the TypeElement for which the page generation is checked |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1018 |
* @return true if it is a generated doc. |
10 | 1019 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1020 |
public boolean isGeneratedDoc(TypeElement te) { |
10 | 1021 |
if (!nodeprecated) { |
1022 |
return true; |
|
1023 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1024 |
return !(utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te))); |
10 | 1025 |
} |
1026 |
||
1027 |
/** |
|
1028 |
* Return the doclet specific instance of a writer factory. |
|
1029 |
* @return the {@link WriterFactory} for the doclet. |
|
1030 |
*/ |
|
1031 |
public abstract WriterFactory getWriterFactory(); |
|
1032 |
||
1033 |
/** |
|
1034 |
* Return the input stream to the builder XML. |
|
1035 |
* |
|
1036 |
* @return the input steam to the builder XML. |
|
1037 |
* @throws FileNotFoundException when the given XML file cannot be found. |
|
1038 |
*/ |
|
14544 | 1039 |
public InputStream getBuilderXML() throws IOException { |
10 | 1040 |
return builderXMLPath == null ? |
1041 |
Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) : |
|
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14361
diff
changeset
|
1042 |
DocFile.createFileForInput(this, builderXMLPath).openInputStream(); |
10 | 1043 |
} |
1044 |
||
1045 |
/** |
|
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1046 |
* Return the Locale for this document. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1047 |
* @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
|
1048 |
*/ |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1049 |
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
|
1050 |
|
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1789
diff
changeset
|
1051 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1052 |
* 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
|
1053 |
* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1054 |
* @return the path of the overview file. |
14544 | 1055 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1056 |
public abstract JavaFileObject getOverviewPath(); |
14544 | 1057 |
|
1058 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1059 |
* Return the current file manager. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1060 |
* @return JavaFileManager |
10 | 1061 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1062 |
public abstract JavaFileManager getFileManager(); |
14542 | 1063 |
|
1064 |
private void setTabWidth(int n) { |
|
1065 |
sourcetab = n; |
|
1066 |
tabSpaces = String.format("%" + n + "s", ""); |
|
1067 |
} |
|
15354 | 1068 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1069 |
public abstract boolean showMessage(DocTreePath path, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1070 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1071 |
public abstract boolean showMessage(Element e, String key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1072 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1073 |
public static abstract class Option implements Doclet.Option, Comparable<Option> { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1074 |
private final String name; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1075 |
private final String parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1076 |
private final String description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1077 |
private final int argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1078 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1079 |
protected final Configuration c; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1080 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1081 |
protected Option(Configuration config, String keyName, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1082 |
c = config; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1083 |
String key = keyName + "name"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1084 |
String oname = getOptionsMessage(key); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1085 |
if (oname.isEmpty()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1086 |
this.name = name; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1087 |
this.parameters = "<MISSING KEY>"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1088 |
this.description = "<MISSING KEY>"; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1089 |
} else { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1090 |
this.name = oname; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1091 |
this.parameters = getOptionsMessage(keyName + "parameters"); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1092 |
this.description = getOptionsMessage(keyName + "description"); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1093 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1094 |
this.argCount = argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1095 |
} |
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 |
protected Option(String prefix, Configuration config, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1098 |
this(config, prefix + name.toLowerCase() + ".", name, argCount); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1099 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1100 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1101 |
protected Option(Configuration config, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1102 |
this("doclet.usage.", config, name, argCount); |
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 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1105 |
protected Option(Configuration config, String name) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1106 |
this(config, name, 0); |
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 |
private String getOptionsMessage(String key) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1110 |
try { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1111 |
return c.getDocletSpecificMsg().getText(key, (Object[]) null); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1112 |
} catch (MissingResourceException ignore) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1113 |
return ""; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1114 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1115 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1116 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1117 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1118 |
public String getDescription() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1119 |
return description; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1120 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1121 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1122 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1123 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1124 |
return Doclet.Option.Kind.STANDARD; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1125 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1126 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1127 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1128 |
public String getName() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1129 |
return name; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1130 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1131 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1132 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1133 |
public String getParameters() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1134 |
return parameters; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1135 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1136 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1137 |
/** |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1138 |
* Maintains the formatting for javadoc -help. Note the space |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1139 |
* alignment. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1140 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1141 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1142 |
public String toString() { |
37848
3c8ff4204d2d
8154956: Module system implementation refresh (4/2016)
alanb
parents:
36526
diff
changeset
|
1143 |
String opt = name + (name.endsWith(":") ? "" : " ") + parameters; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1144 |
int optlen = opt.length(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1145 |
int spaces = 32 - optlen; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1146 |
StringBuffer sb = new StringBuffer(" -").append(opt); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1147 |
for (int i = 0; i < spaces; i++) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1148 |
sb.append(" "); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1149 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1150 |
sb.append(description); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1151 |
return sb.toString(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1152 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1153 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1154 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1155 |
public int getArgumentCount() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1156 |
return argCount; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1157 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1158 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1159 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1160 |
public boolean matches(String option) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1161 |
String arg = option.startsWith("-") ? option.substring(1) : option; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1162 |
return name.toLowerCase().equals(arg.toLowerCase()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1163 |
} |
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 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1166 |
public int compareTo(Option that) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1167 |
return this.getName().compareTo(that.getName()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1168 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1169 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1170 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1171 |
public abstract class XOption extends Option { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1172 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1173 |
public XOption(Configuration config, String keyname, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1174 |
super(config, keyname, name, argCount); |
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 |
public XOption(Configuration config, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1178 |
super("doclet.xusage.", config, name, argCount); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1179 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1180 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1181 |
public XOption(Configuration config, String name) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1182 |
this(config, name, 0); |
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 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1185 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1186 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1187 |
return Doclet.Option.Kind.EXTENDED; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1188 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1189 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1190 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1191 |
public abstract class Hidden extends Option { |
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 |
public Hidden(Configuration config, String name, int argCount) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1194 |
super("doclet.xusage.", config, name, argCount); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1195 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1196 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1197 |
public Hidden(Configuration config, String name) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1198 |
this(config, name, 0); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1199 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1200 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1201 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1202 |
public Option.Kind getKind() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1203 |
return Doclet.Option.Kind.OTHER; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1204 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1205 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1206 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1207 |
/* |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1208 |
* Stores a pair of Strings. |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1209 |
*/ |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1210 |
protected static class GroupContainer { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1211 |
final String value1; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1212 |
final String value2; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1213 |
public GroupContainer(String value1, String value2) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1214 |
this.value1 = value1; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1215 |
this.value2 = value2; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1216 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
35420
diff
changeset
|
1217 |
} |
36526 | 1218 |
|
1219 |
public abstract Location getLocationForPackage(PackageElement pd); |
|
10 | 1220 |
} |