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