author | jjg |
Mon, 22 Jan 2018 11:15:51 -0800 | |
changeset 48654 | 36f58bd6269f |
parent 48521 | 30243cf1503e |
child 48759 | ffa68af7da87 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48521 | 2 |
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.formats.html; |
10 | 27 |
|
14258 | 28 |
import java.net.*; |
29 |
import java.util.*; |
|
47849 | 30 |
import java.util.stream.Collectors; |
10 | 31 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
32 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
33 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
34 |
import javax.lang.model.element.TypeElement; |
14544 | 35 |
import javax.tools.JavaFileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
36 |
import javax.tools.JavaFileObject; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
37 |
import javax.tools.StandardJavaFileManager; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
38 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
39 |
import com.sun.source.util.DocTreePath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
40 |
import com.sun.tools.doclint.DocLint; |
14544 | 41 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
42 |
import jdk.javadoc.doclet.Doclet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
43 |
import jdk.javadoc.doclet.DocletEnvironment; |
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
44 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
45 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
46 |
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion; |
47850 | 47 |
import jdk.javadoc.internal.doclets.formats.html.markup.Links; |
45417 | 48 |
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
49 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
50 |
import jdk.javadoc.internal.doclets.toolkit.DocletException; |
40303 | 51 |
import jdk.javadoc.internal.doclets.toolkit.Messages; |
52 |
import jdk.javadoc.internal.doclets.toolkit.Resources; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
53 |
import jdk.javadoc.internal.doclets.toolkit.WriterFactory; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
54 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFile; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
55 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
56 |
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
57 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
58 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
59 |
import static javax.tools.Diagnostic.Kind.*; |
10 | 60 |
|
61 |
/** |
|
62 |
* Configure the output based on the command line options. |
|
63 |
* <p> |
|
64 |
* Also determine the length of the command line option. For example, |
|
65 |
* for a option "-header" there will be a string argument associated, then the |
|
66 |
* the length of option "-header" is two. But for option "-nohelp" no argument |
|
67 |
* is needed so it's length is 1. |
|
68 |
* </p> |
|
69 |
* <p> |
|
70 |
* Also do the error checking on the options used. For example it is illegal to |
|
71 |
* use "-helpfile" option when already "-nohelp" option is used. |
|
72 |
* </p> |
|
73 |
* |
|
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
74 |
* <p><b>This is NOT part of any supported API. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
75 |
* If you write code that depends on this, you do so at your own risk. |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
76 |
* This code and its internal interfaces are subject to change or |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
77 |
* deletion without notice.</b> |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
78 |
* |
10 | 79 |
* @author Robert Field. |
80 |
* @author Atul Dambalkar. |
|
81 |
* @author Jamie Ho |
|
9608 | 82 |
* @author Bhavesh Patel (Modified) |
10 | 83 |
*/ |
45417 | 84 |
public class HtmlConfiguration extends BaseConfiguration { |
10 | 85 |
|
86 |
/** |
|
87 |
* Argument for command line option "-header". |
|
88 |
*/ |
|
89 |
public String header = ""; |
|
90 |
||
91 |
/** |
|
92 |
* Argument for command line option "-packagesheader". |
|
93 |
*/ |
|
94 |
public String packagesheader = ""; |
|
95 |
||
96 |
/** |
|
97 |
* Argument for command line option "-footer". |
|
98 |
*/ |
|
99 |
public String footer = ""; |
|
100 |
||
101 |
/** |
|
102 |
* Argument for command line option "-doctitle". |
|
103 |
*/ |
|
104 |
public String doctitle = ""; |
|
105 |
||
106 |
/** |
|
107 |
* Argument for command line option "-windowtitle". |
|
108 |
*/ |
|
109 |
public String windowtitle = ""; |
|
110 |
||
111 |
/** |
|
112 |
* Argument for command line option "-top". |
|
113 |
*/ |
|
114 |
public String top = ""; |
|
115 |
||
116 |
/** |
|
117 |
* Argument for command line option "-bottom". |
|
118 |
*/ |
|
119 |
public String bottom = ""; |
|
120 |
||
121 |
/** |
|
122 |
* Argument for command line option "-helpfile". |
|
123 |
*/ |
|
124 |
public String helpfile = ""; |
|
125 |
||
126 |
/** |
|
127 |
* Argument for command line option "-stylesheetfile". |
|
128 |
*/ |
|
129 |
public String stylesheetfile = ""; |
|
130 |
||
131 |
/** |
|
47748
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
132 |
* Argument for command line option "--add-stylesheet". |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
133 |
*/ |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
134 |
public List<String> additionalStylesheets = new ArrayList<>(); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
135 |
|
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
136 |
/** |
9608 | 137 |
* Argument for command line option "-Xdocrootparent". |
138 |
*/ |
|
139 |
public String docrootparent = ""; |
|
140 |
||
141 |
/** |
|
10 | 142 |
* True if command line option "-nohelp" is used. Default value is false. |
143 |
*/ |
|
144 |
public boolean nohelp = false; |
|
145 |
||
146 |
/** |
|
147 |
* True if command line option "-splitindex" is used. Default value is |
|
148 |
* false. |
|
149 |
*/ |
|
150 |
public boolean splitindex = false; |
|
151 |
||
152 |
/** |
|
153 |
* False if command line option "-noindex" is used. Default value is true. |
|
154 |
*/ |
|
155 |
public boolean createindex = true; |
|
156 |
||
157 |
/** |
|
158 |
* True if command line option "-use" is used. Default value is false. |
|
159 |
*/ |
|
160 |
public boolean classuse = false; |
|
161 |
||
162 |
/** |
|
163 |
* False if command line option "-notree" is used. Default value is true. |
|
164 |
*/ |
|
165 |
public boolean createtree = true; |
|
166 |
||
167 |
/** |
|
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
168 |
* The META charset tag used for cross-platform viewing. |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
169 |
*/ |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
170 |
public String charset = null; |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
171 |
|
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
172 |
/** |
10 | 173 |
* True if command line option "-nodeprecated" is used. Default value is |
174 |
* false. |
|
175 |
*/ |
|
176 |
public boolean nodeprecatedlist = false; |
|
177 |
||
178 |
/** |
|
179 |
* True if command line option "-nonavbar" is used. Default value is false. |
|
180 |
*/ |
|
181 |
public boolean nonavbar = false; |
|
182 |
||
183 |
/** |
|
184 |
* True if command line option "-nooverview" is used. Default value is |
|
185 |
* false |
|
186 |
*/ |
|
187 |
private boolean nooverview = false; |
|
188 |
||
189 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
190 |
* The overview path specified with "-overview" flag. |
10 | 191 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
192 |
public String overviewpath = null; |
10 | 193 |
|
194 |
/** |
|
195 |
* This is true if option "-overview" is used or option "-overview" is not |
|
196 |
* used and number of packages is more than one. |
|
197 |
*/ |
|
198 |
public boolean createoverview = false; |
|
199 |
||
200 |
/** |
|
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
201 |
* Specifies whether or not frames should be generated. |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
202 |
* Defaults to true; can be set by --frames; can be set to false by --no-frames; last one wins. |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
203 |
*/ |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
204 |
public boolean frames = true; |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
205 |
|
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
206 |
/** |
48521 | 207 |
* This is the HTML version of the generated pages. |
208 |
* The default value is determined later. |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
209 |
*/ |
48521 | 210 |
public HtmlVersion htmlVersion = null; |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
211 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
212 |
/** |
15354 | 213 |
* Collected set of doclint options |
214 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
215 |
public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>(); |
15354 | 216 |
|
40303 | 217 |
public final Resources resources; |
10 | 218 |
|
219 |
/** |
|
220 |
* First file to appear in the right-hand frame in the generated |
|
221 |
* documentation. |
|
222 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14259
diff
changeset
|
223 |
public DocPath topFile = DocPath.empty; |
10 | 224 |
|
225 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
226 |
* The TypeElement for the class file getting generated. |
10 | 227 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
228 |
public TypeElement currentTypeElement = null; // Set this TypeElement in the ClassWriter. |
10 | 229 |
|
33920 | 230 |
protected List<SearchIndexItem> memberSearchIndex = new ArrayList<>(); |
231 |
||
40511 | 232 |
protected List<SearchIndexItem> moduleSearchIndex = new ArrayList<>(); |
233 |
||
33920 | 234 |
protected List<SearchIndexItem> packageSearchIndex = new ArrayList<>(); |
235 |
||
45913
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
236 |
protected SortedSet<SearchIndexItem> tagSearchIndex = new TreeSet<>(makeSearchTagComparator()); |
33920 | 237 |
|
238 |
protected List<SearchIndexItem> typeSearchIndex = new ArrayList<>(); |
|
239 |
||
240 |
protected Map<Character,List<SearchIndexItem>> tagSearchIndexMap = new HashMap<>(); |
|
241 |
||
242 |
protected Set<Character> tagSearchIndexKeys; |
|
243 |
||
47850 | 244 |
protected final Contents contents; |
40303 | 245 |
|
47850 | 246 |
protected final Messages messages; |
247 |
||
10 | 248 |
/** |
47849 | 249 |
* Creates an object to hold the configuration for a doclet. |
250 |
* |
|
251 |
* @param doclet the doclet |
|
10 | 252 |
*/ |
45417 | 253 |
public HtmlConfiguration(Doclet doclet) { |
44388 | 254 |
super(doclet); |
40303 | 255 |
resources = new Resources(this, |
45417 | 256 |
BaseConfiguration.sharedResourceBundleName, |
40303 | 257 |
"jdk.javadoc.internal.doclets.formats.html.resources.standard"); |
258 |
||
259 |
messages = new Messages(this); |
|
260 |
contents = new Contents(this); |
|
47849 | 261 |
|
262 |
String v; |
|
263 |
try { |
|
264 |
ResourceBundle rb = ResourceBundle.getBundle(versionBundleName, getLocale()); |
|
265 |
try { |
|
266 |
v = rb.getString("release"); |
|
267 |
} catch (MissingResourceException e) { |
|
268 |
v = defaultDocletVersion; |
|
269 |
} |
|
270 |
} catch (MissingResourceException e) { |
|
271 |
v = defaultDocletVersion; |
|
272 |
} |
|
273 |
docletVersion = v; |
|
10 | 274 |
} |
275 |
||
47849 | 276 |
private static final String versionBundleName = "jdk.javadoc.internal.tool.resources.version"; |
277 |
private static final String defaultDocletVersion = System.getProperty("java.version"); |
|
278 |
public final String docletVersion; |
|
21888
568c5da9f16b
6726154: javadoc generated with incorrect version in comment
kizune
parents:
21500
diff
changeset
|
279 |
|
14544 | 280 |
@Override |
47849 | 281 |
public String getDocletVersion() { |
282 |
return docletVersion; |
|
10 | 283 |
} |
284 |
||
40303 | 285 |
@Override |
286 |
public Resources getResources() { |
|
287 |
return resources; |
|
288 |
} |
|
289 |
||
290 |
@Override |
|
291 |
public Messages getMessages() { |
|
292 |
return messages; |
|
293 |
} |
|
294 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
295 |
protected boolean validateOptions() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
296 |
// check shared options |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
297 |
if (!generalValidOptions()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
298 |
return false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
299 |
} |
48521 | 300 |
|
301 |
if (htmlVersion == null) { |
|
302 |
reporter.print(WARNING, getText("doclet.HTML_version_not_specified", helpfile)); |
|
303 |
htmlVersion = HtmlVersion.HTML4; |
|
304 |
} |
|
305 |
||
42277 | 306 |
// check if helpfile exists |
307 |
if (!helpfile.isEmpty()) { |
|
308 |
DocFile help = DocFile.createFileForInput(this, helpfile); |
|
309 |
if (!help.exists()) { |
|
310 |
reporter.print(ERROR, getText("doclet.File_not_found", helpfile)); |
|
311 |
return false; |
|
312 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
313 |
} |
47748
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
314 |
// check if stylesheetfile exists |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
315 |
if (!stylesheetfile.isEmpty()) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
316 |
DocFile stylesheet = DocFile.createFileForInput(this, stylesheetfile); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
317 |
if (!stylesheet.exists()) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
318 |
reporter.print(ERROR, getText("doclet.File_not_found", stylesheetfile)); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
319 |
return false; |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
320 |
} |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
321 |
} |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
322 |
// check if additional stylesheets exists |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
323 |
for (String ssheet : additionalStylesheets) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
324 |
DocFile ssfile = DocFile.createFileForInput(this, ssheet); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
325 |
if (!ssfile.exists()) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
326 |
reporter.print(ERROR, getText("doclet.File_not_found", ssheet)); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
327 |
return false; |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
328 |
} |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
329 |
} |
43261 | 330 |
|
331 |
// In a more object-oriented world, this would be done by methods on the Option objects. |
|
332 |
// Note that -windowtitle silently removes any and all HTML elements, and so does not need |
|
333 |
// to be handled here. |
|
334 |
utils.checkJavaScriptInOption("-header", header); |
|
335 |
utils.checkJavaScriptInOption("-footer", footer); |
|
336 |
utils.checkJavaScriptInOption("-top", top); |
|
337 |
utils.checkJavaScriptInOption("-bottom", bottom); |
|
338 |
utils.checkJavaScriptInOption("-doctitle", doctitle); |
|
339 |
utils.checkJavaScriptInOption("-packagesheader", packagesheader); |
|
340 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
341 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
342 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
343 |
|
43261 | 344 |
|
14544 | 345 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
346 |
public boolean finishOptionSettings() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
347 |
if (!validateOptions()) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
348 |
return false; |
10 | 349 |
} |
42277 | 350 |
if (!getSpecifiedTypeElements().isEmpty()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
351 |
Map<String, PackageElement> map = new HashMap<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
352 |
PackageElement pkg; |
42277 | 353 |
for (TypeElement aClass : getIncludedTypeElements()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
354 |
pkg = utils.containingPackage(aClass); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
355 |
if (!map.containsKey(utils.getPackageName(pkg))) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
356 |
map.put(utils.getPackageName(pkg), pkg); |
10 | 357 |
} |
358 |
} |
|
359 |
} |
|
360 |
setCreateOverview(); |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
361 |
setTopFile(docEnv); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
362 |
workArounds.initDocLint(doclintOpts.values(), tagletManager.getCustomTagNames(), |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
363 |
Utils.toLowerCase(htmlVersion.name())); |
10 | 364 |
return true; |
365 |
} |
|
366 |
||
367 |
/** |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
368 |
* Return true if the generated output is HTML5. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
369 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
370 |
public boolean isOutputHtml5() { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
371 |
return htmlVersion == HtmlVersion.HTML5; |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
372 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
373 |
|
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
374 |
/** |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
375 |
* Return true if the tag is allowed for this specific version of HTML. |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
376 |
*/ |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
377 |
public boolean allowTag(HtmlTag htmlTag) { |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
378 |
return htmlTag.allowTag(this.htmlVersion); |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
379 |
} |
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
380 |
|
45913
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
381 |
public Comparator<SearchIndexItem> makeSearchTagComparator() { |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
382 |
return (SearchIndexItem sii1, SearchIndexItem sii2) -> { |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
383 |
int result = (sii1.getLabel()).compareTo(sii2.getLabel()); |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
384 |
if (result == 0) { |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
385 |
result = (sii1.getHolder()).compareTo(sii2.getHolder()); |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
386 |
} |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
387 |
return result; |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
388 |
}; |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
389 |
} |
90f6a96c1603
8181622: new {@index} tag generates multiple index entries
bpatel
parents:
45871
diff
changeset
|
390 |
|
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
391 |
/** |
10 | 392 |
* Decide the page which will appear first in the right-hand frame. It will |
393 |
* be "overview-summary.html" if "-overview" option is used or no |
|
394 |
* "-overview" but the number of packages is more than one. It will be |
|
395 |
* "package-summary.html" of the respective package if there is only one |
|
396 |
* package to document. It will be a class page(first in the sorted order), |
|
397 |
* if only classes are provided on the command line. |
|
398 |
* |
|
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40500
diff
changeset
|
399 |
* @param docEnv the doclet environment |
10 | 400 |
*/ |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
401 |
protected void setTopFile(DocletEnvironment docEnv) { |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
402 |
if (!checkForDeprecation(docEnv)) { |
10 | 403 |
return; |
404 |
} |
|
405 |
if (createoverview) { |
|
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
406 |
topFile = DocPaths.overviewSummary(frames); |
10 | 407 |
} else { |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40500
diff
changeset
|
408 |
if (showModules) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40500
diff
changeset
|
409 |
topFile = DocPath.empty.resolve(DocPaths.moduleSummary(modules.first())); |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40500
diff
changeset
|
410 |
} else if (packages.size() == 1 && packages.first().isUnnamed()) { |
42277 | 411 |
List<TypeElement> classes = new ArrayList<>(getIncludedTypeElements()); |
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
40500
diff
changeset
|
412 |
if (!classes.isEmpty()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
413 |
TypeElement te = getValidClass(classes); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
414 |
topFile = DocPath.forClass(utils, te); |
10 | 415 |
} |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
23968
diff
changeset
|
416 |
} else if (!packages.isEmpty()) { |
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
23968
diff
changeset
|
417 |
topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY); |
10 | 418 |
} |
419 |
} |
|
420 |
} |
|
421 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
422 |
protected TypeElement getValidClass(List<TypeElement> classes) { |
10 | 423 |
if (!nodeprecated) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
424 |
return classes.get(0); |
10 | 425 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
426 |
for (TypeElement te : classes) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
427 |
if (!utils.isDeprecated(te)) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
428 |
return te; |
10 | 429 |
} |
430 |
} |
|
431 |
return null; |
|
432 |
} |
|
433 |
||
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
434 |
protected boolean checkForDeprecation(DocletEnvironment docEnv) { |
42277 | 435 |
for (TypeElement te : getIncludedTypeElements()) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
436 |
if (isGeneratedDoc(te)) { |
10 | 437 |
return true; |
438 |
} |
|
439 |
} |
|
440 |
return false; |
|
441 |
} |
|
442 |
||
443 |
/** |
|
444 |
* Generate "overview.html" page if option "-overview" is used or number of |
|
445 |
* packages is more than one. Sets {@link #createoverview} field to true. |
|
446 |
*/ |
|
447 |
protected void setCreateOverview() { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
448 |
if ((overviewpath != null || packages.size() > 1) && !nooverview) { |
10 | 449 |
createoverview = true; |
450 |
} |
|
451 |
} |
|
452 |
||
453 |
/** |
|
454 |
* {@inheritDoc} |
|
455 |
*/ |
|
14544 | 456 |
@Override |
10 | 457 |
public WriterFactory getWriterFactory() { |
1475 | 458 |
return new WriterFactoryImpl(this); |
10 | 459 |
} |
460 |
||
461 |
/** |
|
462 |
* {@inheritDoc} |
|
463 |
*/ |
|
14544 | 464 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
465 |
public Locale getLocale() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
466 |
if (locale == null) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
467 |
return Locale.getDefault(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
468 |
return locale; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
469 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
470 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
471 |
/** |
40303 | 472 |
* Return the path of the overview file or null if it does not exist. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
473 |
* |
40303 | 474 |
* @return the path of the overview file or null if it does not exist. |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
475 |
*/ |
40303 | 476 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
477 |
public JavaFileObject getOverviewPath() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
478 |
if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
479 |
StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
480 |
return fm.getJavaFileObjects(overviewpath).iterator().next(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
481 |
} |
10 | 482 |
return null; |
483 |
} |
|
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
484 |
|
47849 | 485 |
public DocFile getMainStylesheet() { |
486 |
return stylesheetfile.isEmpty() ? null : DocFile.createFileForInput(this, stylesheetfile); |
|
487 |
} |
|
488 |
||
489 |
public List<DocFile> getAdditionalStylesheets() { |
|
490 |
return additionalStylesheets.stream() |
|
491 |
.map(ssf -> DocFile.createFileForInput(this, ssf)) |
|
492 |
.collect(Collectors.toList()); |
|
493 |
} |
|
494 |
||
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
495 |
/** |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
496 |
* {@inheritDoc} |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
497 |
*/ |
14544 | 498 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
499 |
public JavaFileManager getFileManager() { |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
39181
diff
changeset
|
500 |
return docEnv.getJavaFileManager(); |
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
501 |
} |
14544 | 502 |
|
503 |
@Override |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
504 |
public boolean showMessage(DocTreePath path, String key) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
505 |
return (path == null || workArounds.haveDocLint()); |
14544 | 506 |
} |
14545
2e7bab0639b8
6493690: javadoc should have a javax.tools.Tool service provider installed in tools.jar
jjg
parents:
14544
diff
changeset
|
507 |
|
15354 | 508 |
@Override |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
509 |
public boolean showMessage(Element e, String key) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
510 |
return (e == null || workArounds.haveDocLint()); |
15354 | 511 |
} |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
15354
diff
changeset
|
512 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
15354
diff
changeset
|
513 |
@Override |
40303 | 514 |
public String getText(String key) { |
515 |
return resources.getText(key); |
|
516 |
} |
|
517 |
||
518 |
@Override |
|
519 |
public String getText(String key, String... args) { |
|
520 |
return resources.getText(key, (Object[]) args); |
|
521 |
} |
|
522 |
||
523 |
/** |
|
524 |
* {@inheritdoc} |
|
525 |
*/ |
|
526 |
@Override |
|
527 |
public Content getContent(String key) { |
|
528 |
return contents.getContent(key); |
|
529 |
} |
|
530 |
||
531 |
/** |
|
532 |
* Get the configuration string as a content. |
|
533 |
* |
|
534 |
* @param key the key to look for in the configuration file |
|
535 |
* @param o string or content argument added to configuration text |
|
536 |
* @return a content tree for the text |
|
537 |
*/ |
|
538 |
@Override |
|
539 |
public Content getContent(String key, Object o) { |
|
540 |
return contents.getContent(key, o); |
|
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
15354
diff
changeset
|
541 |
} |
33920 | 542 |
|
40303 | 543 |
/** |
544 |
* Get the configuration string as a content. |
|
545 |
* |
|
546 |
* @param key the key to look for in the configuration file |
|
547 |
* @param o1 resource argument |
|
548 |
* @param o2 resource argument |
|
549 |
* @return a content tree for the text |
|
550 |
*/ |
|
551 |
@Override |
|
552 |
public Content getContent(String key, Object o1, Object o2) { |
|
553 |
return contents.getContent(key, o1, o2); |
|
554 |
} |
|
555 |
||
556 |
/** |
|
557 |
* Get the configuration string as a content. |
|
558 |
* |
|
559 |
* @param key the key to look for in the configuration file |
|
560 |
* @param o0 string or content argument added to configuration text |
|
561 |
* @param o1 string or content argument added to configuration text |
|
562 |
* @param o2 string or content argument added to configuration text |
|
563 |
* @return a content tree for the text |
|
564 |
*/ |
|
565 |
@Override |
|
566 |
public Content getContent(String key, Object o0, Object o1, Object o2) { |
|
567 |
return contents.getContent(key, o0, o1, o2); |
|
568 |
} |
|
569 |
||
33920 | 570 |
protected void buildSearchTagIndex() { |
571 |
for (SearchIndexItem sii : tagSearchIndex) { |
|
572 |
String tagLabel = sii.getLabel(); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
573 |
Character unicode = (tagLabel.length() == 0) |
33920 | 574 |
? '*' |
575 |
: Character.toUpperCase(tagLabel.charAt(0)); |
|
576 |
List<SearchIndexItem> list = tagSearchIndexMap.get(unicode); |
|
577 |
if (list == null) { |
|
578 |
list = new ArrayList<>(); |
|
579 |
tagSearchIndexMap.put(unicode, list); |
|
580 |
} |
|
581 |
list.add(sii); |
|
582 |
} |
|
583 |
tagSearchIndexKeys = tagSearchIndexMap.keySet(); |
|
584 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
585 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
586 |
@Override |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
587 |
public Set<Doclet.Option> getSupportedOptions() { |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
588 |
Resources resources = getResources(); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
589 |
Doclet.Option[] options = { |
47748
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
590 |
new Option(resources, "--add-stylesheet", 1) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
591 |
@Override |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
592 |
public boolean process(String opt, List<String> args) { |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
593 |
additionalStylesheets.add(args.get(0)); |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
594 |
return true; |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
595 |
} |
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
596 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
597 |
new Option(resources, "-bottom", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
598 |
@Override |
42277 | 599 |
public boolean process(String opt, List<String> args) { |
600 |
bottom = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
601 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
602 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
603 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
604 |
new Option(resources, "-charset", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
605 |
@Override |
42277 | 606 |
public boolean process(String opt, List<String> args) { |
607 |
charset = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
608 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
609 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
610 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
611 |
new Option(resources, "-doctitle", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
612 |
@Override |
42277 | 613 |
public boolean process(String opt, List<String> args) { |
614 |
doctitle = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
615 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
616 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
617 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
618 |
new Option(resources, "-footer", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
619 |
@Override |
42277 | 620 |
public boolean process(String opt, List<String> args) { |
621 |
footer = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
622 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
623 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
624 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
625 |
new Option(resources, "-header", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
626 |
@Override |
42277 | 627 |
public boolean process(String opt, List<String> args) { |
628 |
header = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
629 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
630 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
631 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
632 |
new Option(resources, "-helpfile", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
633 |
@Override |
42277 | 634 |
public boolean process(String opt, List<String> args) { |
635 |
if (nohelp == true) { |
|
636 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
637 |
"-helpfile", "-nohelp")); |
|
638 |
return false; |
|
639 |
} |
|
640 |
if (!helpfile.isEmpty()) { |
|
641 |
reporter.print(ERROR, getText("doclet.Option_reuse", |
|
642 |
"-helpfile")); |
|
643 |
return false; |
|
644 |
} |
|
645 |
helpfile = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
646 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
647 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
648 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
649 |
new Option(resources, "-html4") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
650 |
@Override |
42277 | 651 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
652 |
htmlVersion = HtmlVersion.HTML4; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
653 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
654 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
655 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
656 |
new Option(resources, "-html5") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
657 |
@Override |
42277 | 658 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
659 |
htmlVersion = HtmlVersion.HTML5; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
660 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
661 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
662 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
663 |
new Option(resources, "-nohelp") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
664 |
@Override |
42277 | 665 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
666 |
nohelp = true; |
42277 | 667 |
if (!helpfile.isEmpty()) { |
668 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
669 |
"-nohelp", "-helpfile")); |
|
670 |
return false; |
|
671 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
672 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
673 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
674 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
675 |
new Option(resources, "-nodeprecatedlist") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
676 |
@Override |
42277 | 677 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
678 |
nodeprecatedlist = true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
679 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
680 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
681 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
682 |
new Option(resources, "-noindex") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
683 |
@Override |
42277 | 684 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
685 |
createindex = false; |
42277 | 686 |
if (splitindex == true) { |
687 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
688 |
"-noindex", "-splitindex")); |
|
689 |
return false; |
|
690 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
691 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
692 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
693 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
694 |
new Option(resources, "-nonavbar") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
695 |
@Override |
42277 | 696 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
697 |
nonavbar = true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
698 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
699 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
700 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
701 |
new Hidden(resources, "-nooverview") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
702 |
@Override |
42277 | 703 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
704 |
nooverview = true; |
42277 | 705 |
if (overviewpath != null) { |
706 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
707 |
"-nooverview", "-overview")); |
|
708 |
return false; |
|
709 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
710 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
711 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
712 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
713 |
new Option(resources, "-notree") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
714 |
@Override |
42277 | 715 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
716 |
createtree = false; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
717 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
718 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
719 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
720 |
new Option(resources, "-overview", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
721 |
@Override |
42277 | 722 |
public boolean process(String opt, List<String> args) { |
723 |
overviewpath = args.get(0); |
|
724 |
if (nooverview == true) { |
|
725 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
726 |
"-overview", "-nooverview")); |
|
727 |
return false; |
|
728 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
729 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
730 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
731 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
732 |
new Option(resources, "--frames") { |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
733 |
@Override |
42277 | 734 |
public boolean process(String opt, List<String> args) { |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
735 |
frames = true; |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
736 |
return true; |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
737 |
} |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
738 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
739 |
new Option(resources, "--no-frames") { |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
740 |
@Override |
42277 | 741 |
public boolean process(String opt, List<String> args) { |
40500
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
742 |
frames = false; |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
743 |
return true; |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
744 |
} |
f293dbb81a53
8162353: javadoc should provide a way to disable use of frames
jjg
parents:
40303
diff
changeset
|
745 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
746 |
new Hidden(resources, "-packagesheader", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
747 |
@Override |
42277 | 748 |
public boolean process(String opt, List<String> args) { |
749 |
packagesheader = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
750 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
751 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
752 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
753 |
new Option(resources, "-splitindex") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
754 |
@Override |
42277 | 755 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
756 |
splitindex = true; |
42277 | 757 |
if (createindex == false) { |
758 |
reporter.print(ERROR, getText("doclet.Option_conflict", |
|
759 |
"-splitindex", "-noindex")); |
|
760 |
return false; |
|
761 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
762 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
763 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
764 |
}, |
47748
dfc709c80775
8185371: Support for multiple stylesheets in javadoc
bpatel
parents:
47395
diff
changeset
|
765 |
new Option(resources, "--main-stylesheet -stylesheetfile", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
766 |
@Override |
42277 | 767 |
public boolean process(String opt, List<String> args) { |
768 |
stylesheetfile = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
769 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
770 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
771 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
772 |
new Option(resources, "-top", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
773 |
@Override |
42277 | 774 |
public boolean process(String opt, List<String> args) { |
775 |
top = args.get(0); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
776 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
777 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
778 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
779 |
new Option(resources, "-use") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
780 |
@Override |
42277 | 781 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
782 |
classuse = true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
783 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
784 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
785 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
786 |
new Option(resources, "-windowtitle", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
787 |
@Override |
42277 | 788 |
public boolean process(String opt, List<String> args) { |
789 |
windowtitle = args.get(0).replaceAll("\\<.*?>", ""); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
790 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
791 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
792 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
793 |
new XOption(resources, "-Xdoclint") { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
794 |
@Override |
42277 | 795 |
public boolean process(String opt, List<String> args) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
796 |
doclintOpts.put(this, DocLint.XMSGS_OPTION); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
797 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
798 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
799 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
800 |
new XOption(resources, "-Xdocrootparent", 1) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
801 |
@Override |
42277 | 802 |
public boolean process(String opt, List<String> args) { |
803 |
docrootparent = args.get(0); |
|
804 |
try { |
|
805 |
URL ignored = new URL(docrootparent); |
|
806 |
} catch (MalformedURLException e) { |
|
807 |
reporter.print(ERROR, getText("doclet.MalformedURL", docrootparent)); |
|
808 |
return false; |
|
809 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
810 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
811 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
812 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
813 |
new XOption(resources, "doclet.usage.xdoclint-extended", "-Xdoclint:", 0) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
814 |
@Override |
42277 | 815 |
public boolean process(String opt, List<String> args) { |
816 |
String dopt = opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX); |
|
817 |
doclintOpts.put(this, dopt); |
|
818 |
if (dopt.contains("/")) { |
|
819 |
reporter.print(ERROR, getText("doclet.Option_doclint_no_qualifiers")); |
|
820 |
return false; |
|
821 |
} |
|
822 |
if (!DocLint.isValidOption(dopt)) { |
|
823 |
reporter.print(ERROR, getText("doclet.Option_doclint_invalid_arg")); |
|
824 |
return false; |
|
825 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
826 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
827 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
828 |
}, |
41252
058d83c9b1c7
8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents:
40587
diff
changeset
|
829 |
new XOption(resources, "doclet.usage.xdoclint-package", "-Xdoclint/package:", 0) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
830 |
@Override |
42277 | 831 |
public boolean process(String opt, List<String> args) { |
832 |
String dopt = opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE); |
|
833 |
doclintOpts.put(this, dopt); |
|
834 |
if (!DocLint.isValidOption(dopt)) { |
|
835 |
reporter.print(ERROR, getText("doclet.Option_doclint_package_invalid_arg")); |
|
836 |
return false; |
|
837 |
} |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
838 |
return true; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
839 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
840 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
841 |
}; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
842 |
Set<Doclet.Option> oset = new TreeSet<>(); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
843 |
oset.addAll(Arrays.asList(options)); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
844 |
oset.addAll(super.getSupportedOptions()); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
845 |
return oset; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
33920
diff
changeset
|
846 |
} |
46080
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
847 |
|
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
848 |
@Override |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
849 |
protected boolean finishOptionSettings0() throws DocletException { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
850 |
if (docencoding == null) { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
851 |
if (charset == null) { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
852 |
docencoding = charset = (encoding == null) ? HtmlConstants.HTML_DEFAULT_CHARSET : encoding; |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
853 |
} else { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
854 |
docencoding = charset; |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
855 |
} |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
856 |
} else { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
857 |
if (charset == null) { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
858 |
charset = docencoding; |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
859 |
} else if (!charset.equals(docencoding)) { |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
860 |
reporter.print(ERROR, getText("doclet.Option_conflict", "-charset", "-docencoding")); |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
861 |
return false; |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
862 |
} |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
863 |
} |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
864 |
return super.finishOptionSettings0(); |
65ccd412049b
8183582: Rationalize doclet -docencoding and -charset options
pmuthuswamy
parents:
45913
diff
changeset
|
865 |
} |
10 | 866 |
} |