author | jjg |
Thu, 15 Nov 2012 09:18:36 -0800 | |
changeset 14542 | 7062120649c2 |
parent 14368 | 6f4c62de6985 |
child 14544 | d71d992cb905 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
2 |
* Copyright (c) 1998, 2012, 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 |
||
26 |
package com.sun.tools.doclets.formats.html; |
|
27 |
||
14258 | 28 |
import java.net.*; |
29 |
import java.util.*; |
|
10 | 30 |
|
31 |
import com.sun.javadoc.*; |
|
14258 | 32 |
import com.sun.tools.doclets.internal.toolkit.*; |
33 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
|
10 | 34 |
|
35 |
/** |
|
36 |
* Configure the output based on the command line options. |
|
37 |
* <p> |
|
38 |
* Also determine the length of the command line option. For example, |
|
39 |
* for a option "-header" there will be a string argument associated, then the |
|
40 |
* the length of option "-header" is two. But for option "-nohelp" no argument |
|
41 |
* is needed so it's length is 1. |
|
42 |
* </p> |
|
43 |
* <p> |
|
44 |
* Also do the error checking on the options used. For example it is illegal to |
|
45 |
* use "-helpfile" option when already "-nohelp" option is used. |
|
46 |
* </p> |
|
47 |
* |
|
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
48 |
* <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
|
49 |
* 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
|
50 |
* 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
|
51 |
* deletion without notice.</b> |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
52 |
* |
10 | 53 |
* @author Robert Field. |
54 |
* @author Atul Dambalkar. |
|
55 |
* @author Jamie Ho |
|
9608 | 56 |
* @author Bhavesh Patel (Modified) |
10 | 57 |
*/ |
58 |
public class ConfigurationImpl extends Configuration { |
|
59 |
||
60 |
/** |
|
61 |
* The build date. Note: For now, we will use |
|
62 |
* a version number instead of a date. |
|
63 |
*/ |
|
64 |
public static final String BUILD_DATE = System.getProperty("java.version"); |
|
65 |
||
66 |
/** |
|
67 |
* Argument for command line option "-header". |
|
68 |
*/ |
|
69 |
public String header = ""; |
|
70 |
||
71 |
/** |
|
72 |
* Argument for command line option "-packagesheader". |
|
73 |
*/ |
|
74 |
public String packagesheader = ""; |
|
75 |
||
76 |
/** |
|
77 |
* Argument for command line option "-footer". |
|
78 |
*/ |
|
79 |
public String footer = ""; |
|
80 |
||
81 |
/** |
|
82 |
* Argument for command line option "-doctitle". |
|
83 |
*/ |
|
84 |
public String doctitle = ""; |
|
85 |
||
86 |
/** |
|
87 |
* Argument for command line option "-windowtitle". |
|
88 |
*/ |
|
89 |
public String windowtitle = ""; |
|
90 |
||
91 |
/** |
|
92 |
* Argument for command line option "-top". |
|
93 |
*/ |
|
94 |
public String top = ""; |
|
95 |
||
96 |
/** |
|
97 |
* Argument for command line option "-bottom". |
|
98 |
*/ |
|
99 |
public String bottom = ""; |
|
100 |
||
101 |
/** |
|
102 |
* Argument for command line option "-helpfile". |
|
103 |
*/ |
|
104 |
public String helpfile = ""; |
|
105 |
||
106 |
/** |
|
107 |
* Argument for command line option "-stylesheetfile". |
|
108 |
*/ |
|
109 |
public String stylesheetfile = ""; |
|
110 |
||
111 |
/** |
|
9608 | 112 |
* Argument for command line option "-Xdocrootparent". |
113 |
*/ |
|
114 |
public String docrootparent = ""; |
|
115 |
||
116 |
/** |
|
10 | 117 |
* True if command line option "-nohelp" is used. Default value is false. |
118 |
*/ |
|
119 |
public boolean nohelp = false; |
|
120 |
||
121 |
/** |
|
122 |
* True if command line option "-splitindex" is used. Default value is |
|
123 |
* false. |
|
124 |
*/ |
|
125 |
public boolean splitindex = false; |
|
126 |
||
127 |
/** |
|
128 |
* False if command line option "-noindex" is used. Default value is true. |
|
129 |
*/ |
|
130 |
public boolean createindex = true; |
|
131 |
||
132 |
/** |
|
133 |
* True if command line option "-use" is used. Default value is false. |
|
134 |
*/ |
|
135 |
public boolean classuse = false; |
|
136 |
||
137 |
/** |
|
138 |
* False if command line option "-notree" is used. Default value is true. |
|
139 |
*/ |
|
140 |
public boolean createtree = true; |
|
141 |
||
142 |
/** |
|
143 |
* True if command line option "-nodeprecated" is used. Default value is |
|
144 |
* false. |
|
145 |
*/ |
|
146 |
public boolean nodeprecatedlist = false; |
|
147 |
||
148 |
/** |
|
149 |
* True if command line option "-nonavbar" is used. Default value is false. |
|
150 |
*/ |
|
151 |
public boolean nonavbar = false; |
|
152 |
||
153 |
/** |
|
154 |
* True if command line option "-nooverview" is used. Default value is |
|
155 |
* false |
|
156 |
*/ |
|
157 |
private boolean nooverview = false; |
|
158 |
||
159 |
/** |
|
160 |
* True if command line option "-overview" is used. Default value is false. |
|
161 |
*/ |
|
162 |
public boolean overview = false; |
|
163 |
||
164 |
/** |
|
165 |
* This is true if option "-overview" is used or option "-overview" is not |
|
166 |
* used and number of packages is more than one. |
|
167 |
*/ |
|
168 |
public boolean createoverview = false; |
|
169 |
||
170 |
/** |
|
171 |
* Unique Resource Handler for this package. |
|
172 |
*/ |
|
173 |
public final MessageRetriever standardmessage; |
|
174 |
||
175 |
/** |
|
176 |
* First file to appear in the right-hand frame in the generated |
|
177 |
* documentation. |
|
178 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14259
diff
changeset
|
179 |
public DocPath topFile = DocPath.empty; |
10 | 180 |
|
181 |
/** |
|
182 |
* The classdoc for the class file getting generated. |
|
183 |
*/ |
|
14542 | 184 |
public ClassDoc currentcd = null; // Set this classdoc in the ClassWriter. |
10 | 185 |
|
186 |
/** |
|
14259 | 187 |
* Constructor. Initializes resource for the |
188 |
* {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}. |
|
10 | 189 |
*/ |
14542 | 190 |
public ConfigurationImpl() { |
10 | 191 |
standardmessage = new MessageRetriever(this, |
192 |
"com.sun.tools.doclets.formats.html.resources.standard"); |
|
193 |
} |
|
194 |
||
1475 | 195 |
/** |
10 | 196 |
* Return the build date for the doclet. |
197 |
*/ |
|
198 |
public String getDocletSpecificBuildDate() { |
|
199 |
return BUILD_DATE; |
|
200 |
} |
|
201 |
||
202 |
/** |
|
203 |
* Depending upon the command line options provided by the user, set |
|
204 |
* configure the output generation environment. |
|
205 |
* |
|
206 |
* @param options The array of option names and values. |
|
207 |
*/ |
|
208 |
public void setSpecificDocletOptions(String[][] options) { |
|
209 |
for (int oi = 0; oi < options.length; ++oi) { |
|
210 |
String[] os = options[oi]; |
|
211 |
String opt = os[0].toLowerCase(); |
|
212 |
if (opt.equals("-footer")) { |
|
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
213 |
footer = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
214 |
} else if (opt.equals("-header")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
215 |
header = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
216 |
} else if (opt.equals("-packagesheader")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
217 |
packagesheader = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
218 |
} else if (opt.equals("-doctitle")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
219 |
doctitle = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
220 |
} else if (opt.equals("-windowtitle")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
221 |
windowtitle = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
222 |
} else if (opt.equals("-top")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
223 |
top = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
224 |
} else if (opt.equals("-bottom")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
225 |
bottom = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
226 |
} else if (opt.equals("-helpfile")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
227 |
helpfile = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
228 |
} else if (opt.equals("-stylesheetfile")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
229 |
stylesheetfile = os[1]; |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
230 |
} else if (opt.equals("-charset")) { |
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
231 |
charset = os[1]; |
9608 | 232 |
} else if (opt.equals("-xdocrootparent")) { |
233 |
docrootparent = os[1]; |
|
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
234 |
} else if (opt.equals("-nohelp")) { |
10 | 235 |
nohelp = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
236 |
} else if (opt.equals("-splitindex")) { |
10 | 237 |
splitindex = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
238 |
} else if (opt.equals("-noindex")) { |
10 | 239 |
createindex = false; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
240 |
} else if (opt.equals("-use")) { |
10 | 241 |
classuse = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
242 |
} else if (opt.equals("-notree")) { |
10 | 243 |
createtree = false; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
244 |
} else if (opt.equals("-nodeprecatedlist")) { |
10 | 245 |
nodeprecatedlist = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
246 |
} else if (opt.equals("-nonavbar")) { |
10 | 247 |
nonavbar = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
248 |
} else if (opt.equals("-nooverview")) { |
10 | 249 |
nooverview = true; |
13842
6908f6badce4
7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
9608
diff
changeset
|
250 |
} else if (opt.equals("-overview")) { |
10 | 251 |
overview = true; |
252 |
} |
|
253 |
} |
|
254 |
if (root.specifiedClasses().length > 0) { |
|
868 | 255 |
Map<String,PackageDoc> map = new HashMap<String,PackageDoc>(); |
10 | 256 |
PackageDoc pd; |
257 |
ClassDoc[] classes = root.classes(); |
|
258 |
for (int i = 0; i < classes.length; i++) { |
|
259 |
pd = classes[i].containingPackage(); |
|
260 |
if(! map.containsKey(pd.name())) { |
|
261 |
map.put(pd.name(), pd); |
|
262 |
} |
|
263 |
} |
|
264 |
} |
|
265 |
setCreateOverview(); |
|
266 |
setTopFile(root); |
|
267 |
} |
|
268 |
||
269 |
/** |
|
270 |
* Returns the "length" of a given option. If an option takes no |
|
271 |
* arguments, its length is one. If it takes one argument, it's |
|
272 |
* length is two, and so on. This method is called by JavaDoc to |
|
273 |
* parse the options it does not recognize. It then calls |
|
274 |
* {@link #validOptions(String[][], DocErrorReporter)} to |
|
275 |
* validate them. |
|
276 |
* <b>Note:</b><br> |
|
277 |
* The options arrive as case-sensitive strings. For options that |
|
278 |
* are not case-sensitive, use toLowerCase() on the option string |
|
279 |
* before comparing it. |
|
280 |
* </blockquote> |
|
281 |
* |
|
282 |
* @return number of arguments + 1 for a option. Zero return means |
|
283 |
* option not known. Negative value means error occurred. |
|
284 |
*/ |
|
285 |
public int optionLength(String option) { |
|
286 |
int result = -1; |
|
287 |
if ((result = super.optionLength(option)) > 0) { |
|
288 |
return result; |
|
289 |
} |
|
290 |
// otherwise look for the options we have added |
|
291 |
option = option.toLowerCase(); |
|
292 |
if (option.equals("-nodeprecatedlist") || |
|
293 |
option.equals("-noindex") || |
|
294 |
option.equals("-notree") || |
|
295 |
option.equals("-nohelp") || |
|
296 |
option.equals("-splitindex") || |
|
297 |
option.equals("-serialwarn") || |
|
298 |
option.equals("-use") || |
|
299 |
option.equals("-nonavbar") || |
|
300 |
option.equals("-nooverview")) { |
|
301 |
return 1; |
|
302 |
} else if (option.equals("-help")) { |
|
303 |
System.out.println(getText("doclet.usage")); |
|
304 |
return 1; |
|
305 |
} else if (option.equals("-footer") || |
|
306 |
option.equals("-header") || |
|
307 |
option.equals("-packagesheader") || |
|
308 |
option.equals("-doctitle") || |
|
309 |
option.equals("-windowtitle") || |
|
310 |
option.equals("-top") || |
|
311 |
option.equals("-bottom") || |
|
312 |
option.equals("-helpfile") || |
|
313 |
option.equals("-stylesheetfile") || |
|
314 |
option.equals("-charset") || |
|
9608 | 315 |
option.equals("-overview") || |
316 |
option.equals("-xdocrootparent")) { |
|
10 | 317 |
return 2; |
318 |
} else { |
|
319 |
return 0; |
|
320 |
} |
|
321 |
} |
|
322 |
||
323 |
/** |
|
324 |
* {@inheritDoc} |
|
325 |
*/ |
|
326 |
public boolean validOptions(String options[][], |
|
327 |
DocErrorReporter reporter) { |
|
328 |
boolean helpfile = false; |
|
329 |
boolean nohelp = false; |
|
330 |
boolean overview = false; |
|
331 |
boolean nooverview = false; |
|
332 |
boolean splitindex = false; |
|
333 |
boolean noindex = false; |
|
334 |
// check shared options |
|
335 |
if (!generalValidOptions(options, reporter)) { |
|
336 |
return false; |
|
337 |
} |
|
338 |
// otherwise look at our options |
|
339 |
for (int oi = 0; oi < options.length; ++oi) { |
|
340 |
String[] os = options[oi]; |
|
341 |
String opt = os[0].toLowerCase(); |
|
342 |
if (opt.equals("-helpfile")) { |
|
343 |
if (nohelp == true) { |
|
344 |
reporter.printError(getText("doclet.Option_conflict", |
|
345 |
"-helpfile", "-nohelp")); |
|
346 |
return false; |
|
347 |
} |
|
348 |
if (helpfile == true) { |
|
349 |
reporter.printError(getText("doclet.Option_reuse", |
|
350 |
"-helpfile")); |
|
351 |
return false; |
|
352 |
} |
|
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14357
diff
changeset
|
353 |
DocFile help = DocFile.createFileForInput(this, os[1]); |
10 | 354 |
if (!help.exists()) { |
355 |
reporter.printError(getText("doclet.File_not_found", os[1])); |
|
356 |
return false; |
|
357 |
} |
|
358 |
helpfile = true; |
|
359 |
} else if (opt.equals("-nohelp")) { |
|
360 |
if (helpfile == true) { |
|
361 |
reporter.printError(getText("doclet.Option_conflict", |
|
362 |
"-nohelp", "-helpfile")); |
|
363 |
return false; |
|
364 |
} |
|
365 |
nohelp = true; |
|
9608 | 366 |
} else if (opt.equals("-xdocrootparent")) { |
367 |
try { |
|
368 |
new URL(os[1]); |
|
369 |
} catch (MalformedURLException e) { |
|
370 |
reporter.printError(getText("doclet.MalformedURL", os[1])); |
|
371 |
return false; |
|
372 |
} |
|
10 | 373 |
} else if (opt.equals("-overview")) { |
374 |
if (nooverview == true) { |
|
375 |
reporter.printError(getText("doclet.Option_conflict", |
|
376 |
"-overview", "-nooverview")); |
|
377 |
return false; |
|
378 |
} |
|
379 |
if (overview == true) { |
|
380 |
reporter.printError(getText("doclet.Option_reuse", |
|
381 |
"-overview")); |
|
382 |
return false; |
|
383 |
} |
|
384 |
overview = true; |
|
385 |
} else if (opt.equals("-nooverview")) { |
|
386 |
if (overview == true) { |
|
387 |
reporter.printError(getText("doclet.Option_conflict", |
|
388 |
"-nooverview", "-overview")); |
|
389 |
return false; |
|
390 |
} |
|
391 |
nooverview = true; |
|
392 |
} else if (opt.equals("-splitindex")) { |
|
393 |
if (noindex == true) { |
|
394 |
reporter.printError(getText("doclet.Option_conflict", |
|
395 |
"-splitindex", "-noindex")); |
|
396 |
return false; |
|
397 |
} |
|
398 |
splitindex = true; |
|
399 |
} else if (opt.equals("-noindex")) { |
|
400 |
if (splitindex == true) { |
|
401 |
reporter.printError(getText("doclet.Option_conflict", |
|
402 |
"-noindex", "-splitindex")); |
|
403 |
return false; |
|
404 |
} |
|
405 |
noindex = true; |
|
406 |
} |
|
407 |
} |
|
408 |
return true; |
|
409 |
} |
|
410 |
||
411 |
/** |
|
412 |
* {@inheritDoc} |
|
413 |
*/ |
|
414 |
public MessageRetriever getDocletSpecificMsg() { |
|
415 |
return standardmessage; |
|
416 |
} |
|
417 |
||
418 |
/** |
|
419 |
* Decide the page which will appear first in the right-hand frame. It will |
|
420 |
* be "overview-summary.html" if "-overview" option is used or no |
|
421 |
* "-overview" but the number of packages is more than one. It will be |
|
422 |
* "package-summary.html" of the respective package if there is only one |
|
423 |
* package to document. It will be a class page(first in the sorted order), |
|
424 |
* if only classes are provided on the command line. |
|
425 |
* |
|
426 |
* @param root Root of the program structure. |
|
427 |
*/ |
|
428 |
protected void setTopFile(RootDoc root) { |
|
429 |
if (!checkForDeprecation(root)) { |
|
430 |
return; |
|
431 |
} |
|
432 |
if (createoverview) { |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14259
diff
changeset
|
433 |
topFile = DocPaths.OVERVIEW_SUMMARY; |
10 | 434 |
} else { |
435 |
if (packages.length == 1 && packages[0].name().equals("")) { |
|
436 |
if (root.classes().length > 0) { |
|
437 |
ClassDoc[] classarr = root.classes(); |
|
438 |
Arrays.sort(classarr); |
|
439 |
ClassDoc cd = getValidClass(classarr); |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14259
diff
changeset
|
440 |
topFile = DocPath.forClass(cd); |
10 | 441 |
} |
442 |
} else { |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14259
diff
changeset
|
443 |
topFile = DocPath.forPackage(packages[0]).resolve(DocPaths.PACKAGE_SUMMARY); |
10 | 444 |
} |
445 |
} |
|
446 |
} |
|
447 |
||
448 |
protected ClassDoc getValidClass(ClassDoc[] classarr) { |
|
449 |
if (!nodeprecated) { |
|
450 |
return classarr[0]; |
|
451 |
} |
|
452 |
for (int i = 0; i < classarr.length; i++) { |
|
453 |
if (classarr[i].tags("deprecated").length == 0) { |
|
454 |
return classarr[i]; |
|
455 |
} |
|
456 |
} |
|
457 |
return null; |
|
458 |
} |
|
459 |
||
460 |
protected boolean checkForDeprecation(RootDoc root) { |
|
461 |
ClassDoc[] classarr = root.classes(); |
|
462 |
for (int i = 0; i < classarr.length; i++) { |
|
463 |
if (isGeneratedDoc(classarr[i])) { |
|
464 |
return true; |
|
465 |
} |
|
466 |
} |
|
467 |
return false; |
|
468 |
} |
|
469 |
||
470 |
/** |
|
471 |
* Generate "overview.html" page if option "-overview" is used or number of |
|
472 |
* packages is more than one. Sets {@link #createoverview} field to true. |
|
473 |
*/ |
|
474 |
protected void setCreateOverview() { |
|
475 |
if ((overview || packages.length > 1) && !nooverview) { |
|
476 |
createoverview = true; |
|
477 |
} |
|
478 |
} |
|
479 |
||
480 |
/** |
|
481 |
* {@inheritDoc} |
|
482 |
*/ |
|
483 |
public WriterFactory getWriterFactory() { |
|
1475 | 484 |
return new WriterFactoryImpl(this); |
10 | 485 |
} |
486 |
||
487 |
/** |
|
488 |
* {@inheritDoc} |
|
489 |
*/ |
|
868 | 490 |
public Comparator<ProgramElementDoc> getMemberComparator() { |
10 | 491 |
return null; |
492 |
} |
|
1863
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
493 |
|
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
494 |
/** |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
495 |
* {@inheritDoc} |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
496 |
*/ |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
497 |
public Locale getLocale() { |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
498 |
if (root instanceof com.sun.tools.javadoc.RootDocImpl) |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
499 |
return ((com.sun.tools.javadoc.RootDocImpl)root).getLocale(); |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
500 |
else |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
501 |
return Locale.getDefault(); |
e5de9abc0eb1
6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
1475
diff
changeset
|
502 |
} |
10 | 503 |
} |