author | yan |
Fri, 21 Feb 2014 15:14:09 +0400 | |
changeset 23123 | fd8ad69ac7fe |
parent 22163 | 3651128c74eb |
child 23794 | 9437acfa99e9 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
15385 | 2 |
* Copyright (c) 1998, 2013, 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 |
||
28 |
import java.io.*; |
|
29 |
import java.text.SimpleDateFormat; |
|
30 |
import java.util.*; |
|
31 |
||
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
32 |
import com.sun.javadoc.*; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
33 |
import com.sun.tools.doclets.formats.html.markup.*; |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
34 |
import com.sun.tools.doclets.internal.toolkit.*; |
14258 | 35 |
import com.sun.tools.doclets.internal.toolkit.taglets.*; |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
36 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
37 |
import com.sun.tools.javac.util.StringUtils; |
10 | 38 |
|
39 |
/** |
|
40 |
* Class for the Html Format Code Generation specific to JavaDoc. |
|
41 |
* This Class contains methods related to the Html Code Generation which |
|
42 |
* are used extensively while generating the entire documentation. |
|
43 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
44 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
45 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
46 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
47 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14259
diff
changeset
|
48 |
* |
10 | 49 |
* @since 1.2 |
50 |
* @author Atul M Dambalkar |
|
51 |
* @author Robert Field |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
52 |
* @author Bhavesh Patel (Modified) |
10 | 53 |
*/ |
54 |
public class HtmlDocletWriter extends HtmlDocWriter { |
|
55 |
||
56 |
/** |
|
57 |
* Relative path from the file getting generated to the destination |
|
58 |
* directory. For example, if the file getting generated is |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
59 |
* "java/lang/Object.html", then the path to the root is "../..". |
10 | 60 |
* This string can be empty if the file getting generated is in |
61 |
* the destination directory. |
|
62 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
63 |
public final DocPath pathToRoot; |
10 | 64 |
|
65 |
/** |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
66 |
* Platform-independent path from the current or the |
10 | 67 |
* destination directory to the file getting generated. |
68 |
* Used when creating the file. |
|
69 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
70 |
public final DocPath path; |
10 | 71 |
|
72 |
/** |
|
73 |
* Name of the file getting generated. If the file getting generated is |
|
74 |
* "java/lang/Object.html", then the filename is "Object.html". |
|
75 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
76 |
public final DocPath filename; |
10 | 77 |
|
78 |
/** |
|
79 |
* The global configuration information for this run. |
|
80 |
*/ |
|
14542 | 81 |
public final ConfigurationImpl configuration; |
10 | 82 |
|
83 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
84 |
* To check whether annotation heading is printed or not. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
85 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
86 |
protected boolean printedAnnotationHeading = false; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
87 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
88 |
/** |
20237
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19920
diff
changeset
|
89 |
* To check whether annotation field heading is printed or not. |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19920
diff
changeset
|
90 |
*/ |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19920
diff
changeset
|
91 |
protected boolean printedAnnotationFieldHeading = false; |
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19920
diff
changeset
|
92 |
|
b6d89903c867
8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
19920
diff
changeset
|
93 |
/** |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
94 |
* To check whether the repeated annotations is documented or not. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
95 |
*/ |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
96 |
private boolean isAnnotationDocumented = false; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
97 |
|
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
98 |
/** |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
99 |
* To check whether the container annotations is documented or not. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
100 |
*/ |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
101 |
private boolean isContainerDocumented = false; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
102 |
|
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
103 |
/** |
10 | 104 |
* Constructor to construct the HtmlStandardWriter object. |
105 |
* |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
106 |
* @param path File to be generated. |
10 | 107 |
*/ |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
108 |
public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path) |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
109 |
throws IOException { |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
110 |
super(configuration, path); |
10 | 111 |
this.configuration = configuration; |
112 |
this.path = path; |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
113 |
this.pathToRoot = path.parent().invert(); |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
114 |
this.filename = path.basename(); |
10 | 115 |
} |
116 |
||
117 |
/** |
|
118 |
* Replace {@docRoot} tag used in options that accept HTML text, such |
|
119 |
* as -header, -footer, -top and -bottom, and when converting a relative |
|
120 |
* HREF where commentTagsToString inserts a {@docRoot} where one was |
|
121 |
* missing. (Also see DocRootTaglet for {@docRoot} tags in doc |
|
122 |
* comments.) |
|
123 |
* <p> |
|
124 |
* Replace {@docRoot} tag in htmlstr with the relative path to the |
|
125 |
* destination directory from the directory where the file is being |
|
126 |
* written, looping to handle all such tags in htmlstr. |
|
127 |
* <p> |
|
128 |
* For example, for "-d docs" and -header containing {@docRoot}, when |
|
129 |
* the HTML page for source file p/C1.java is being generated, the |
|
130 |
* {@docRoot} tag would be inserted into the header as "../", |
|
131 |
* the relative path from docs/p/ to docs/ (the document root). |
|
132 |
* <p> |
|
133 |
* Note: This doc comment was written with '&#064;' representing '@' |
|
134 |
* to prevent the inline tag from being interpreted. |
|
135 |
*/ |
|
136 |
public String replaceDocRootDir(String htmlstr) { |
|
137 |
// Return if no inline tags exist |
|
138 |
int index = htmlstr.indexOf("{@"); |
|
139 |
if (index < 0) { |
|
140 |
return htmlstr; |
|
141 |
} |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
142 |
String lowerHtml = StringUtils.toLowerCase(htmlstr); |
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
143 |
final String docroot = "{@docroot}"; |
10 | 144 |
// Return index of first occurrence of {@docroot} |
145 |
// Note: {@docRoot} is not case sensitive when passed in w/command line option |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
146 |
index = lowerHtml.indexOf(docroot, index); |
10 | 147 |
if (index < 0) { |
148 |
return htmlstr; |
|
149 |
} |
|
8631
664f84942e74
6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents:
7681
diff
changeset
|
150 |
StringBuilder buf = new StringBuilder(); |
10 | 151 |
int previndex = 0; |
152 |
while (true) { |
|
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
153 |
// Search for lowercase version of {@docRoot} |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
154 |
index = lowerHtml.indexOf(docroot, previndex); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
155 |
// If next {@docRoot} tag not found, append rest of htmlstr and exit loop |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
156 |
if (index < 0) { |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
157 |
buf.append(htmlstr.substring(previndex)); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
158 |
break; |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
159 |
} |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
160 |
// If next {@docroot} tag found, append htmlstr up to start of tag |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
161 |
buf.append(htmlstr.substring(previndex, index)); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
162 |
previndex = index + docroot.length(); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
163 |
if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", previndex)) { |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
164 |
// Insert the absolute link if {@docRoot} is followed by "/..". |
9608 | 165 |
buf.append(configuration.docrootparent); |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
166 |
previndex += 3; |
9608 | 167 |
} else { |
168 |
// Insert relative path where {@docRoot} was located |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
169 |
buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath()); |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
170 |
} |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
171 |
// Append slash if next character is not a slash |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
172 |
if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
173 |
buf.append('/'); |
10 | 174 |
} |
175 |
} |
|
176 |
return buf.toString(); |
|
177 |
} |
|
178 |
||
179 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
180 |
* Get the script to show or hide the All classes link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
181 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
182 |
* @param id id of the element to show or hide |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
183 |
* @return a content tree for the script |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
184 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
185 |
public Content getAllClassesLinkScript(String id) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
186 |
HtmlTree script = new HtmlTree(HtmlTag.SCRIPT); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
187 |
script.addAttr(HtmlAttr.TYPE, "text/javascript"); |
7641
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
188 |
String scriptCode = "<!--" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
189 |
" allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
190 |
" if(window==top) {" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
191 |
" allClassesLink.style.display = \"block\";" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
192 |
" }" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
193 |
" else {" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
194 |
" allClassesLink.style.display = \"none\";" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
195 |
" }" + DocletConstants.NL + |
8b552db25f99
7006270: Several javadoc regression tests are failing on windows
bpatel
parents:
7614
diff
changeset
|
196 |
" //-->" + DocletConstants.NL; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
197 |
Content scriptContent = new RawHtml(scriptCode); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
198 |
script.addContent(scriptContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
199 |
Content div = HtmlTree.DIV(script); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
200 |
return div; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
201 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
202 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
203 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
204 |
* Add method information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
205 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
206 |
* @param method the method to be documented |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
207 |
* @param dl the content tree to which the method information will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
208 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
209 |
private void addMethodInfo(MethodDoc method, Content dl) { |
10 | 210 |
ClassDoc[] intfacs = method.containingClass().interfaces(); |
211 |
MethodDoc overriddenMethod = method.overriddenMethod(); |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
212 |
// Check whether there is any implementation or overridden info to be |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
213 |
// printed. If no overridden or implementation info needs to be |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
214 |
// printed, do not print this section. |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
215 |
if ((intfacs.length > 0 && |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
216 |
new ImplementedMethods(method, this.configuration).build().length > 0) || |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
217 |
overriddenMethod != null) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
218 |
MethodWriterImpl.addImplementsInfo(this, method, dl); |
10 | 219 |
if (overriddenMethod != null) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
220 |
MethodWriterImpl.addOverridden(this, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
221 |
method.overriddenType(), overriddenMethod, dl); |
10 | 222 |
} |
223 |
} |
|
224 |
} |
|
225 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
226 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
227 |
* Adds the tags information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
228 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
229 |
* @param doc the doc for which the tags will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
230 |
* @param htmltree the documentation tree to which the tags will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
231 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
232 |
protected void addTagsInfo(Doc doc, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
233 |
if (configuration.nocomment) { |
10 | 234 |
return; |
235 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
236 |
Content dl = new HtmlTree(HtmlTag.DL); |
10 | 237 |
if (doc instanceof MethodDoc) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
238 |
addMethodInfo((MethodDoc) doc, dl); |
10 | 239 |
} |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17573
diff
changeset
|
240 |
Content output = new ContentBuilder(); |
10 | 241 |
TagletWriter.genTagOuput(configuration.tagletManager, doc, |
17573
0e20dec17c87
8012311: Cleanup names and duplicatre code in TagletManager
jjg
parents:
17571
diff
changeset
|
242 |
configuration.tagletManager.getCustomTaglets(doc), |
10 | 243 |
getTagletWriterInstance(false), output); |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17573
diff
changeset
|
244 |
dl.addContent(output); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
245 |
htmltree.addContent(dl); |
10 | 246 |
} |
247 |
||
248 |
/** |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
249 |
* Check whether there are any tags for Serialization Overview |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
250 |
* section to be printed. |
2086
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
251 |
* |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
252 |
* @param field the FieldDoc object to check for tags. |
2086
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
253 |
* @return true if there are tags to be printed else return false. |
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
254 |
*/ |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
255 |
protected boolean hasSerializationOverviewTags(FieldDoc field) { |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17573
diff
changeset
|
256 |
Content output = new ContentBuilder(); |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
257 |
TagletWriter.genTagOuput(configuration.tagletManager, field, |
17573
0e20dec17c87
8012311: Cleanup names and duplicatre code in TagletManager
jjg
parents:
17571
diff
changeset
|
258 |
configuration.tagletManager.getCustomTaglets(field), |
2086
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
259 |
getTagletWriterInstance(false), output); |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17573
diff
changeset
|
260 |
return !output.isEmpty(); |
2086
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
261 |
} |
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
262 |
|
cca2603eab0b
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents:
1789
diff
changeset
|
263 |
/** |
10 | 264 |
* Returns a TagletWriter that knows how to write HTML. |
265 |
* |
|
266 |
* @return a TagletWriter that knows how to write HTML. |
|
267 |
*/ |
|
268 |
public TagletWriter getTagletWriterInstance(boolean isFirstSentence) { |
|
269 |
return new TagletWriterImpl(this, isFirstSentence); |
|
270 |
} |
|
271 |
||
272 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
273 |
* Get Package link, with target frame. |
10 | 274 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
275 |
* @param pd The link will be to the "package-summary.html" page for this package |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
276 |
* @param target name of the target frame |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
277 |
* @param label tag for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
278 |
* @return a content for the target package link |
10 | 279 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
280 |
public Content getTargetPackageLink(PackageDoc pd, String target, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
281 |
Content label) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
282 |
return getHyperLink(pathString(pd, DocPaths.PACKAGE_SUMMARY), label, "", target); |
10 | 283 |
} |
284 |
||
285 |
/** |
|
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
286 |
* Get Profile Package link, with target frame. |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
287 |
* |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
288 |
* @param pd the packageDoc object |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
289 |
* @param target name of the target frame |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
290 |
* @param label tag for the link |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
291 |
* @param profileName the name of the profile being documented |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
292 |
* @return a content for the target profile packages link |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
293 |
*/ |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
294 |
public Content getTargetProfilePackageLink(PackageDoc pd, String target, |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
295 |
Content label, String profileName) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
296 |
return getHyperLink(pathString(pd, DocPaths.profilePackageSummary(profileName)), |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
297 |
label, "", target); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
298 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
299 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
300 |
/** |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
301 |
* Get Profile link, with target frame. |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
302 |
* |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
303 |
* @param target name of the target frame |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
304 |
* @param label tag for the link |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
305 |
* @param profileName the name of the profile being documented |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
306 |
* @return a content for the target profile link |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
307 |
*/ |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
308 |
public Content getTargetProfileLink(String target, Content label, |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
309 |
String profileName) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
310 |
return getHyperLink(pathToRoot.resolve( |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
311 |
DocPaths.profileSummary(profileName)), label, "", target); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
312 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
313 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
314 |
/** |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
315 |
* Get the type name for profile search. |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
316 |
* |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
317 |
* @param cd the classDoc object for which the type name conversion is needed |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
318 |
* @return a type name string for the type |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
319 |
*/ |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
320 |
public String getTypeNameForProfile(ClassDoc cd) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
321 |
StringBuilder typeName = |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
322 |
new StringBuilder((cd.containingPackage()).name().replace(".", "/")); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
323 |
typeName.append("/") |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
324 |
.append(cd.name().replace(".", "$")); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
325 |
return typeName.toString(); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
326 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
327 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
328 |
/** |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
329 |
* Check if a type belongs to a profile. |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
330 |
* |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
331 |
* @param cd the classDoc object that needs to be checked |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
332 |
* @param profileValue the profile in which the type needs to be checked |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
333 |
* @return true if the type is in the profile |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
334 |
*/ |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
335 |
public boolean isTypeInProfile(ClassDoc cd, int profileValue) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
336 |
return (configuration.profiles.getProfile(getTypeNameForProfile(cd)) <= profileValue); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
337 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
338 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
339 |
public void addClassesSummary(ClassDoc[] classes, String label, |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
340 |
String tableSummary, String[] tableHeader, Content summaryContentTree, |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
341 |
int profileValue) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
342 |
if(classes.length > 0) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
343 |
Arrays.sort(classes); |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
344 |
Content caption = getTableCaption(new RawHtml(label)); |
20613
ab4801a53abb
8008164: Invisible table captions in javadoc-generated html
bpatel
parents:
20237
diff
changeset
|
345 |
Content table = HtmlTree.TABLE(HtmlStyle.typeSummary, 0, 3, 0, |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
346 |
tableSummary, caption); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
347 |
table.addContent(getSummaryTableHeader(tableHeader, "col")); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
348 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
349 |
for (int i = 0; i < classes.length; i++) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
350 |
if (!isTypeInProfile(classes[i], profileValue)) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
351 |
continue; |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
352 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
353 |
if (!Util.isCoreClass(classes[i]) || |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
354 |
!configuration.isGeneratedDoc(classes[i])) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
355 |
continue; |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
356 |
} |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
357 |
Content classContent = getLink(new LinkInfoImpl( |
17561 | 358 |
configuration, LinkInfoImpl.Kind.PACKAGE, classes[i])); |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
359 |
Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
360 |
HtmlTree tr = HtmlTree.TR(tdClass); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
361 |
if (i%2 == 0) |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
362 |
tr.addStyle(HtmlStyle.altColor); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
363 |
else |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
364 |
tr.addStyle(HtmlStyle.rowColor); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
365 |
HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
366 |
tdClassDescription.addStyle(HtmlStyle.colLast); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
367 |
if (Util.isDeprecated(classes[i])) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
368 |
tdClassDescription.addContent(deprecatedLabel); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
369 |
if (classes[i].tags("deprecated").length > 0) { |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
370 |
addSummaryDeprecatedComment(classes[i], |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
371 |
classes[i].tags("deprecated")[0], tdClassDescription); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
372 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
373 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
374 |
else |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
375 |
addSummaryComment(classes[i], tdClassDescription); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
376 |
tr.addContent(tdClassDescription); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
377 |
tbody.addContent(tr); |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
378 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
379 |
table.addContent(tbody); |
21494
eb34dbccfb60
8026770: javadoc creates invalid HTML in profile summary pages
bpatel
parents:
21478
diff
changeset
|
380 |
summaryContentTree.addContent(table); |
15723
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
381 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
382 |
} |
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
383 |
|
58a73dac9ee4
8006124: javadoc/doclet should be updated to support profiles
bpatel
parents:
15035
diff
changeset
|
384 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
385 |
* Generates the HTML document tree and prints it out. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
386 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
387 |
* @param metakeywords Array of String keywords for META tag. Each element |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
388 |
* of the array is assigned to a separate META tag. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
389 |
* Pass in null for no array |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
390 |
* @param includeScript true if printing windowtitle script |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
391 |
* false for files that appear in the left-hand frames |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
392 |
* @param body the body htmltree to be included in the document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
393 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
394 |
public void printHtmlDocument(String[] metakeywords, boolean includeScript, |
14265
4e8e488eeae0
8000666: javadoc should write directly to Writer instead of composing strings
jjg
parents:
14263
diff
changeset
|
395 |
Content body) throws IOException { |
14542 | 396 |
Content htmlDocType = DocType.TRANSITIONAL; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
397 |
Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
398 |
Content head = new HtmlTree(HtmlTag.HEAD); |
19920
ead15bfdcfa0
8024288: javadoc generated-by comment should always be present
jjg
parents:
19909
diff
changeset
|
399 |
head.addContent(getGeneratedBy(!configuration.notimestamp)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
400 |
if (configuration.charset.length() > 0) { |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
19254
diff
changeset
|
401 |
Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
402 |
configuration.charset); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
403 |
head.addContent(meta); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
404 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
405 |
head.addContent(getTitle()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
406 |
if (!configuration.notimestamp) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
407 |
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
408 |
Content meta = HtmlTree.META("date", dateFormat.format(new Date())); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
409 |
head.addContent(meta); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
410 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
411 |
if (metakeywords != null) { |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
412 |
for (String metakeyword : metakeywords) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
413 |
Content meta = HtmlTree.META("keywords", metakeyword); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
414 |
head.addContent(meta); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
415 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
416 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
417 |
head.addContent(getStyleSheetProperties()); |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
418 |
head.addContent(getScriptProperties()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
419 |
Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
420 |
head, body); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
421 |
Content htmlDocument = new HtmlDocument(htmlDocType, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
422 |
htmlComment, htmlTree); |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
423 |
write(htmlDocument); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
424 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
425 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
426 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
427 |
* Get the window title. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
428 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
429 |
* @param title the title string to construct the complete window title |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
430 |
* @return the window title string |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
431 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
432 |
public String getWindowTitle(String title) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
433 |
if (configuration.windowtitle.length() > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
434 |
title += " (" + configuration.windowtitle + ")"; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
435 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
436 |
return title; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
437 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
438 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
439 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
440 |
* Get user specified header and the footer. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
441 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
442 |
* @param header if true print the user provided header else print the |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
443 |
* user provided footer. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
444 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
445 |
public Content getUserHeaderFooter(boolean header) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
446 |
String content; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
447 |
if (header) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
448 |
content = replaceDocRootDir(configuration.header); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
449 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
450 |
if (configuration.footer.length() != 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
451 |
content = replaceDocRootDir(configuration.footer); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
452 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
453 |
content = replaceDocRootDir(configuration.header); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
454 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
455 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
456 |
Content rawContent = new RawHtml(content); |
19254
0988183c8164
4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
19253
diff
changeset
|
457 |
return rawContent; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
458 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
459 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
460 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
461 |
* Adds the user specified top. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
462 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
463 |
* @param body the content tree to which user specified top will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
464 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
465 |
public void addTop(Content body) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
466 |
Content top = new RawHtml(replaceDocRootDir(configuration.top)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
467 |
body.addContent(top); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
468 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
469 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
470 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
471 |
* Adds the user specified bottom. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
472 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
473 |
* @param body the content tree to which user specified bottom will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
474 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
475 |
public void addBottom(Content body) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
476 |
Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
477 |
Content small = HtmlTree.SMALL(bottom); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
478 |
Content p = HtmlTree.P(HtmlStyle.legalCopy, small); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
479 |
body.addContent(p); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
480 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
481 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
482 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
483 |
* Adds the navigation bar for the Html page at the top and and the bottom. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
484 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
485 |
* @param header If true print navigation bar at the top of the page else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
486 |
* @param body the HtmlTree to which the nav links will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
487 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
488 |
protected void addNavLinks(boolean header, Content body) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
489 |
if (!configuration.nonavbar) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
490 |
String allClassesId = "allclasses_"; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
491 |
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
492 |
Content skipNavLinks = configuration.getResource("doclet.Skip_navigation_links"); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
493 |
if (header) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
494 |
body.addContent(HtmlConstants.START_OF_TOP_NAVBAR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
495 |
navDiv.addStyle(HtmlStyle.topNav); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
496 |
allClassesId += "navbar_top"; |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
497 |
Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
498 |
//WCAG - Hyperlinks should contain text or an image with alt text - for AT tools |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
499 |
navDiv.addContent(a); |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
500 |
Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
501 |
getDocLink(SectionName.SKIP_NAVBAR_TOP), skipNavLinks, |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
502 |
skipNavLinks.toString(), "")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
503 |
navDiv.addContent(skipLinkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
504 |
} else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
505 |
body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
506 |
navDiv.addStyle(HtmlStyle.bottomNav); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
507 |
allClassesId += "navbar_bottom"; |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
508 |
Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
509 |
navDiv.addContent(a); |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
510 |
Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
511 |
getDocLink(SectionName.SKIP_NAVBAR_BOTTOM), skipNavLinks, |
19909
784c68032a36
7198273: RFE : Javadoc Accessibility : Hyperlinks should contain text or an image with alt text
bpatel
parents:
19663
diff
changeset
|
512 |
skipNavLinks.toString(), "")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
513 |
navDiv.addContent(skipLinkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
514 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
515 |
if (header) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
516 |
navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_TOP_FIRSTROW)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
517 |
} else { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
518 |
navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
519 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
520 |
HtmlTree navList = new HtmlTree(HtmlTag.UL); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
521 |
navList.addStyle(HtmlStyle.navList); |
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
522 |
navList.addAttr(HtmlAttr.TITLE, |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
523 |
configuration.getText("doclet.Navigation")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
524 |
if (configuration.createoverview) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
525 |
navList.addContent(getNavLinkContents()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
526 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
527 |
if (configuration.packages.length == 1) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
528 |
navList.addContent(getNavLinkPackage(configuration.packages[0])); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
529 |
} else if (configuration.packages.length > 1) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
530 |
navList.addContent(getNavLinkPackage()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
531 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
532 |
navList.addContent(getNavLinkClass()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
533 |
if(configuration.classuse) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
534 |
navList.addContent(getNavLinkClassUse()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
535 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
536 |
if(configuration.createtree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
537 |
navList.addContent(getNavLinkTree()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
538 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
539 |
if(!(configuration.nodeprecated || |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
540 |
configuration.nodeprecatedlist)) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
541 |
navList.addContent(getNavLinkDeprecated()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
542 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
543 |
if(configuration.createindex) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
544 |
navList.addContent(getNavLinkIndex()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
545 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
546 |
if (!configuration.nohelp) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
547 |
navList.addContent(getNavLinkHelp()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
548 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
549 |
navDiv.addContent(navList); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
550 |
Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
551 |
navDiv.addContent(aboutDiv); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
552 |
body.addContent(navDiv); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
553 |
Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
554 |
ulNav.addContent(getNavLinkNext()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
555 |
Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
556 |
Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
557 |
ulFrames.addContent(getNavHideLists(filename)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
558 |
subDiv.addContent(ulFrames); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
559 |
HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
560 |
ulAllClasses.addAttr(HtmlAttr.ID, allClassesId.toString()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
561 |
subDiv.addContent(ulAllClasses); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
562 |
subDiv.addContent(getAllClassesLinkScript(allClassesId.toString())); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
563 |
addSummaryDetailLinks(subDiv); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
564 |
if (header) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
565 |
subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
566 |
body.addContent(subDiv); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
567 |
body.addContent(HtmlConstants.END_OF_TOP_NAVBAR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
568 |
} else { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
569 |
subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
570 |
body.addContent(subDiv); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
571 |
body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
572 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
573 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
574 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
575 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
576 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
577 |
* Get the word "NEXT" to indicate that no link is available. Override |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
578 |
* this method to customize next link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
579 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
580 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
581 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
582 |
protected Content getNavLinkNext() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
583 |
return getNavLinkNext(null); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
584 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
585 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
586 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
587 |
* Get the word "PREV" to indicate that no link is available. Override |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
588 |
* this method to customize prev link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
589 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
590 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
591 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
592 |
protected Content getNavLinkPrevious() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
593 |
return getNavLinkPrevious(null); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
594 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
595 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
596 |
/** |
10 | 597 |
* Do nothing. This is the default method. |
598 |
*/ |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
599 |
protected void addSummaryDetailLinks(Content navDiv) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
600 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
601 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
602 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
603 |
* Get link to the "overview-summary.html" page. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
604 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
605 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
606 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
607 |
protected Content getNavLinkContents() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
608 |
Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_SUMMARY), |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
609 |
overviewLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
610 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
611 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
612 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
613 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
614 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
615 |
* Get link to the "package-summary.html" page for the package passed. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
616 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
617 |
* @param pkg Package to which link will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
618 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
619 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
620 |
protected Content getNavLinkPackage(PackageDoc pkg) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
621 |
Content linkContent = getPackageLink(pkg, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
622 |
packageLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
623 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
624 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
625 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
626 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
627 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
628 |
* Get the word "Package" , to indicate that link is not available here. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
629 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
630 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
631 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
632 |
protected Content getNavLinkPackage() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
633 |
Content li = HtmlTree.LI(packageLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
634 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
635 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
636 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
637 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
638 |
* Get the word "Use", to indicate that link is not available. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
639 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
640 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
641 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
642 |
protected Content getNavLinkClassUse() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
643 |
Content li = HtmlTree.LI(useLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
644 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
645 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
646 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
647 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
648 |
* Get link for previous file. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
649 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
650 |
* @param prev File name for the prev link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
651 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
652 |
*/ |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
653 |
public Content getNavLinkPrevious(DocPath prev) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
654 |
Content li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
655 |
if (prev != null) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
656 |
li = HtmlTree.LI(getHyperLink(prev, prevLabel, "", "")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
657 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
658 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
659 |
li = HtmlTree.LI(prevLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
660 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
661 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
662 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
663 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
664 |
* Get link for next file. If next is null, just print the label |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
665 |
* without linking it anywhere. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
666 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
667 |
* @param next File name for the next link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
668 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
669 |
*/ |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
670 |
public Content getNavLinkNext(DocPath next) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
671 |
Content li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
672 |
if (next != null) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
673 |
li = HtmlTree.LI(getHyperLink(next, nextLabel, "", "")); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
674 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
675 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
676 |
li = HtmlTree.LI(nextLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
677 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
678 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
679 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
680 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
681 |
* Get "FRAMES" link, to switch to the frame version of the output. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
682 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
683 |
* @param link File to be linked, "index.html" |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
684 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
685 |
*/ |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
686 |
protected Content getNavShowLists(DocPath link) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
687 |
DocLink dl = new DocLink(link, path.getPath(), null); |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
688 |
Content framesContent = getHyperLink(dl, framesLabel, "", "_top"); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
689 |
Content li = HtmlTree.LI(framesContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
690 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
691 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
692 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
693 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
694 |
* Get "FRAMES" link, to switch to the frame version of the output. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
695 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
696 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
697 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
698 |
protected Content getNavShowLists() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
699 |
return getNavShowLists(pathToRoot.resolve(DocPaths.INDEX)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
700 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
701 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
702 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
703 |
* Get "NO FRAMES" link, to switch to the non-frame version of the output. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
704 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
705 |
* @param link File to be linked |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
706 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
707 |
*/ |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
708 |
protected Content getNavHideLists(DocPath link) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
709 |
Content noFramesContent = getHyperLink(link, noframesLabel, "", "_top"); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
710 |
Content li = HtmlTree.LI(noFramesContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
711 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
712 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
713 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
714 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
715 |
* Get "Tree" link in the navigation bar. If there is only one package |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
716 |
* specified on the command line, then the "Tree" link will be to the |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
717 |
* only "package-tree.html" file otherwise it will be to the |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
718 |
* "overview-tree.html" file. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
719 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
720 |
* @return a content tree for the link |
10 | 721 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
722 |
protected Content getNavLinkTree() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
723 |
Content treeLinkContent; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
724 |
PackageDoc[] packages = configuration.root.specifiedPackages(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
725 |
if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
726 |
treeLinkContent = getHyperLink(pathString(packages[0], |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
727 |
DocPaths.PACKAGE_TREE), treeLabel, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
728 |
"", ""); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
729 |
} else { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
730 |
treeLinkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
731 |
treeLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
732 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
733 |
Content li = HtmlTree.LI(treeLinkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
734 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
735 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
736 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
737 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
738 |
* Get the overview tree link for the main tree. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
739 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
740 |
* @param label the label for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
741 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
742 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
743 |
protected Content getNavLinkMainTree(String label) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
744 |
Content mainTreeContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
745 |
new StringContent(label)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
746 |
Content li = HtmlTree.LI(mainTreeContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
747 |
return li; |
10 | 748 |
} |
749 |
||
750 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
751 |
* Get the word "Class", to indicate that class link is not available. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
752 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
753 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
754 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
755 |
protected Content getNavLinkClass() { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
756 |
Content li = HtmlTree.LI(classLabel); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
757 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
758 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
759 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
760 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
761 |
* Get "Deprecated" API link in the navigation bar. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
762 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
763 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
764 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
765 |
protected Content getNavLinkDeprecated() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
766 |
Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
767 |
deprecatedLabel, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
768 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
769 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
770 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
771 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
772 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
773 |
* Get link for generated index. If the user has used "-splitindex" |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
774 |
* command line option, then link to file "index-files/index-1.html" is |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
775 |
* generated otherwise link to file "index-all.html" is generated. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
776 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
777 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
778 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
779 |
protected Content getNavLinkClassIndex() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
780 |
Content allClassesContent = getHyperLink(pathToRoot.resolve( |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
781 |
DocPaths.ALLCLASSES_NOFRAME), |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
782 |
allclassesLabel, "", ""); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
783 |
Content li = HtmlTree.LI(allClassesContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
784 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
785 |
} |
10 | 786 |
|
787 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
788 |
* Get link for generated class index. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
789 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
790 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
791 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
792 |
protected Content getNavLinkIndex() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
793 |
Content linkContent = getHyperLink(pathToRoot.resolve( |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
794 |
(configuration.splitindex |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
795 |
? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
796 |
: DocPaths.INDEX_ALL)), |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
797 |
indexLabel, "", ""); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
798 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
799 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
800 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
801 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
802 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
803 |
* Get help file link. If user has provided a help file, then generate a |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
804 |
* link to the user given file, which is already copied to current or |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
805 |
* destination directory. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
806 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
807 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
808 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
809 |
protected Content getNavLinkHelp() { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
810 |
String helpfile = configuration.helpfile; |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
811 |
DocPath helpfilenm; |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
812 |
if (helpfile.isEmpty()) { |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
813 |
helpfilenm = DocPaths.HELP_DOC; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
814 |
} else { |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
815 |
DocFile file = DocFile.createFileForInput(configuration, helpfile); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
816 |
helpfilenm = DocPath.create(file.getName()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
817 |
} |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
818 |
Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm), |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
819 |
helpLabel, "", ""); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
820 |
Content li = HtmlTree.LI(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
821 |
return li; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
822 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
823 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
824 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
825 |
* Get summary table header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
826 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
827 |
* @param header the header for the table |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
828 |
* @param scope the scope of the headers |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
829 |
* @return a content tree for the header |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
830 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
831 |
public Content getSummaryTableHeader(String[] header, String scope) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
832 |
Content tr = new HtmlTree(HtmlTag.TR); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
833 |
int size = header.length; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
834 |
Content tableHeader; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
835 |
if (size == 1) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
836 |
tableHeader = new StringContent(header[0]); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
837 |
tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
838 |
return tr; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
839 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
840 |
for (int i = 0; i < size; i++) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
841 |
tableHeader = new StringContent(header[i]); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
842 |
if(i == 0) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
843 |
tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
844 |
else if(i == (size - 1)) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
845 |
tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
846 |
else |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
847 |
tr.addContent(HtmlTree.TH(scope, tableHeader)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
848 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
849 |
return tr; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
850 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
851 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
852 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
853 |
* Get table caption. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
854 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
855 |
* @param rawText the caption for the table which could be raw Html |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
856 |
* @return a content tree for the caption |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
857 |
*/ |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
858 |
public Content getTableCaption(Content title) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
859 |
Content captionSpan = HtmlTree.SPAN(title); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
860 |
Content space = getSpace(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
861 |
Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
862 |
Content caption = HtmlTree.CAPTION(captionSpan); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
863 |
caption.addContent(tabSpan); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
864 |
return caption; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
865 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
866 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
867 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
868 |
* Get the marker anchor which will be added to the documentation tree. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
869 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
870 |
* @param anchorName the anchor name attribute |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
871 |
* @return a content tree for the marker anchor |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
872 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
873 |
public Content getMarkerAnchor(String anchorName) { |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
874 |
return getMarkerAnchor(getName(anchorName), null); |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
875 |
} |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
876 |
|
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
877 |
/** |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
878 |
* Get the marker anchor which will be added to the documentation tree. |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
879 |
* |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
880 |
* @param sectionName the section name anchor attribute for page |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
881 |
* @return a content tree for the marker anchor |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
882 |
*/ |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
883 |
public Content getMarkerAnchor(SectionName sectionName) { |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
884 |
return getMarkerAnchor(sectionName.getName(), null); |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
885 |
} |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
886 |
|
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
887 |
/** |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
888 |
* Get the marker anchor which will be added to the documentation tree. |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
889 |
* |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
890 |
* @param sectionName the section name anchor attribute for page |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
891 |
* @param anchorName the anchor name combined with section name attribute for the page |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
892 |
* @return a content tree for the marker anchor |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
893 |
*/ |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
894 |
public Content getMarkerAnchor(SectionName sectionName, String anchorName) { |
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
895 |
return getMarkerAnchor(sectionName.getName() + getName(anchorName), null); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
896 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
897 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
898 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
899 |
* Get the marker anchor which will be added to the documentation tree. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
900 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
901 |
* @param anchorName the anchor name attribute |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
902 |
* @param anchorContent the content that should be added to the anchor |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
903 |
* @return a content tree for the marker anchor |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
904 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
905 |
public Content getMarkerAnchor(String anchorName, Content anchorContent) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
906 |
if (anchorContent == null) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
907 |
anchorContent = new Comment(" "); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
908 |
Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
909 |
return markerAnchor; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
910 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
911 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
912 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
913 |
* Returns a packagename content. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
914 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
915 |
* @param packageDoc the package to check |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
916 |
* @return package name content |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
917 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
918 |
public Content getPackageName(PackageDoc packageDoc) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
919 |
return packageDoc == null || packageDoc.name().length() == 0 ? |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
920 |
defaultPackageLabel : |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
921 |
getPackageLabel(packageDoc.name()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
922 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
923 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
924 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
925 |
* Returns a package name label. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
926 |
* |
14259 | 927 |
* @param packageName the package name |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
928 |
* @return the package name content |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
929 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
930 |
public Content getPackageLabel(String packageName) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
931 |
return new StringContent(packageName); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
932 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
933 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
934 |
/** |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
935 |
* Add package deprecation information to the documentation tree |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
936 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
937 |
* @param deprPkgs list of deprecated packages |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
938 |
* @param headingKey the caption for the deprecated package table |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
939 |
* @param tableSummary the summary for the deprecated package table |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
940 |
* @param tableHeader table headers for the deprecated package table |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
941 |
* @param contentTree the content tree to which the deprecated package table will be added |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
942 |
*/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
943 |
protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey, |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
944 |
String tableSummary, String[] tableHeader, Content contentTree) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
945 |
if (deprPkgs.size() > 0) { |
20613
ab4801a53abb
8008164: Invisible table captions in javadoc-generated html
bpatel
parents:
20237
diff
changeset
|
946 |
Content table = HtmlTree.TABLE(HtmlStyle.deprecatedSummary, 0, 3, 0, tableSummary, |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
947 |
getTableCaption(configuration.getResource(headingKey))); |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
948 |
table.addContent(getSummaryTableHeader(tableHeader, "col")); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
949 |
Content tbody = new HtmlTree(HtmlTag.TBODY); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
950 |
for (int i = 0; i < deprPkgs.size(); i++) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
951 |
PackageDoc pkg = (PackageDoc) deprPkgs.get(i); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
952 |
HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
953 |
getPackageLink(pkg, getPackageName(pkg))); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
954 |
if (pkg.tags("deprecated").length > 0) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
955 |
addInlineDeprecatedComment(pkg, pkg.tags("deprecated")[0], td); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
956 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
957 |
HtmlTree tr = HtmlTree.TR(td); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
958 |
if (i % 2 == 0) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
959 |
tr.addStyle(HtmlStyle.altColor); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
960 |
} else { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
961 |
tr.addStyle(HtmlStyle.rowColor); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
962 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
963 |
tbody.addContent(tr); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
964 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
965 |
table.addContent(tbody); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
966 |
Content li = HtmlTree.LI(HtmlStyle.blockList, table); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
967 |
Content ul = HtmlTree.UL(HtmlStyle.blockList, li); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
968 |
contentTree.addContent(ul); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
969 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
970 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
971 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
9592
diff
changeset
|
972 |
/** |
14366
af625e568667
8001929: fix doclint errors in langtools doc comments
jjg
parents:
14358
diff
changeset
|
973 |
* Return the path to the class page for a classdoc. |
10 | 974 |
* |
975 |
* @param cd Class to which the path is requested. |
|
976 |
* @param name Name of the file(doesn't include path). |
|
977 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
978 |
protected DocPath pathString(ClassDoc cd, DocPath name) { |
10 | 979 |
return pathString(cd.containingPackage(), name); |
980 |
} |
|
981 |
||
982 |
/** |
|
983 |
* Return path to the given file name in the given package. So if the name |
|
984 |
* passed is "Object.html" and the name of the package is "java.lang", and |
|
985 |
* if the relative path is "../.." then returned string will be |
|
986 |
* "../../java/lang/Object.html" |
|
987 |
* |
|
988 |
* @param pd Package in which the file name is assumed to be. |
|
989 |
* @param name File name, to which path string is. |
|
990 |
*/ |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
991 |
protected DocPath pathString(PackageDoc pd, DocPath name) { |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
992 |
return pathToRoot.resolve(DocPath.forPackage(pd).resolve(name)); |
10 | 993 |
} |
994 |
||
995 |
/** |
|
996 |
* Return the link to the given package. |
|
997 |
* |
|
998 |
* @param pkg the package to link to. |
|
999 |
* @param label the label for the link. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1000 |
* @return a content tree for the package link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1001 |
*/ |
17563
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1002 |
public Content getPackageLink(PackageDoc pkg, String label) { |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1003 |
return getPackageLink(pkg, new StringContent(label)); |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1004 |
} |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1005 |
|
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1006 |
/** |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1007 |
* Return the link to the given package. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1008 |
* |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1009 |
* @param pkg the package to link to. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1010 |
* @param label the label for the link. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1011 |
* @return a content tree for the package link. |
e8ddeb9bd17c
8011668: Allow HTMLWriter.getResource to take Content args
jjg
parents:
17561
diff
changeset
|
1012 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1013 |
public Content getPackageLink(PackageDoc pkg, Content label) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1014 |
boolean included = pkg != null && pkg.isIncluded(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1015 |
if (! included) { |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1016 |
for (PackageDoc p : configuration.packages) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1017 |
if (p.equals(pkg)) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1018 |
included = true; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1019 |
break; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1020 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1021 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1022 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1023 |
if (included || pkg == null) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1024 |
return getHyperLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1025 |
label); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1026 |
} else { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1027 |
DocLink crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1028 |
if (crossPkgLink != null) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1029 |
return getHyperLink(crossPkgLink, label); |
10 | 1030 |
} else { |
1031 |
return label; |
|
1032 |
} |
|
1033 |
} |
|
1034 |
} |
|
1035 |
||
17560 | 1036 |
public Content italicsClassName(ClassDoc cd, boolean qual) { |
1037 |
Content name = new StringContent((qual)? cd.qualifiedName(): cd.name()); |
|
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
1038 |
return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.interfaceName, name): name; |
10 | 1039 |
} |
1040 |
||
1041 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1042 |
* Add the link to the content tree. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1043 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1044 |
* @param doc program element doc for which the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1045 |
* @param label label for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1046 |
* @param htmltree the content tree to which the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1047 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1048 |
public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1049 |
if (doc == null) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1050 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1051 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1052 |
ClassDoc cd = doc.containingClass(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1053 |
if (cd == null) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1054 |
//d must be a class doc since in has no containing class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1055 |
cd = (ClassDoc) doc; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1056 |
} |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1057 |
DocPath href = pathToRoot |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1058 |
.resolve(DocPaths.SOURCE_OUTPUT) |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1059 |
.resolve(DocPath.forClass(cd)); |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1060 |
Content linkContent = getHyperLink(href.fragment(SourceToHTMLConverter.getAnchorName(doc)), label, "", ""); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1061 |
htmltree.addContent(linkContent); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1062 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1063 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1064 |
/** |
10 | 1065 |
* Return the link to the given class. |
1066 |
* |
|
1067 |
* @param linkInfo the information about the link. |
|
1068 |
* |
|
1069 |
* @return the link for the given class. |
|
1070 |
*/ |
|
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1071 |
public Content getLink(LinkInfoImpl linkInfo) { |
10 | 1072 |
LinkFactoryImpl factory = new LinkFactoryImpl(this); |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
17563
diff
changeset
|
1073 |
return factory.getLink(linkInfo); |
10 | 1074 |
} |
1075 |
||
1076 |
/** |
|
1077 |
* Return the type parameters for the given class. |
|
1078 |
* |
|
1079 |
* @param linkInfo the information about the link. |
|
1080 |
* @return the type for the given class. |
|
1081 |
*/ |
|
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1082 |
public Content getTypeParameterLinks(LinkInfoImpl linkInfo) { |
10 | 1083 |
LinkFactoryImpl factory = new LinkFactoryImpl(this); |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1084 |
return factory.getTypeParameterLinks(linkInfo, false); |
10 | 1085 |
} |
1086 |
||
1087 |
/************************************************************* |
|
1088 |
* Return a class cross link to external class documentation. |
|
1089 |
* The name must be fully qualified to determine which package |
|
1090 |
* the class is in. The -link option does not allow users to |
|
1091 |
* link to external classes in the "default" package. |
|
1092 |
* |
|
1093 |
* @param qualifiedClassName the qualified name of the external class. |
|
1094 |
* @param refMemName the name of the member being referenced. This should |
|
1095 |
* be null or empty string if no member is being referenced. |
|
1096 |
* @param label the label for the external link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1097 |
* @param strong true if the link should be strong. |
10 | 1098 |
* @param style the style of the link. |
1099 |
* @param code true if the label should be code font. |
|
1100 |
*/ |
|
17560 | 1101 |
public Content getCrossClassLink(String qualifiedClassName, String refMemName, |
1102 |
Content label, boolean strong, String style, |
|
10 | 1103 |
boolean code) { |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1104 |
String className = ""; |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1105 |
String packageName = qualifiedClassName == null ? "" : qualifiedClassName; |
10 | 1106 |
int periodIndex; |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1107 |
while ((periodIndex = packageName.lastIndexOf('.')) != -1) { |
10 | 1108 |
className = packageName.substring(periodIndex + 1, packageName.length()) + |
1109 |
(className.length() > 0 ? "." + className : ""); |
|
17560 | 1110 |
Content defaultLabel = new StringContent(className); |
1111 |
if (code) |
|
1112 |
defaultLabel = HtmlTree.CODE(defaultLabel); |
|
10 | 1113 |
packageName = packageName.substring(0, periodIndex); |
1114 |
if (getCrossPackageLink(packageName) != null) { |
|
1115 |
//The package exists in external documentation, so link to the external |
|
1116 |
//class (assuming that it exists). This is definitely a limitation of |
|
1117 |
//the -link option. There are ways to determine if an external package |
|
1118 |
//exists, but no way to determine if the external class exists. We just |
|
1119 |
//have to assume that it does. |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1120 |
DocLink link = configuration.extern.getExternalLink(packageName, pathToRoot, |
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1121 |
className + ".html", refMemName); |
17560 | 1122 |
return getHyperLink(link, |
1123 |
(label == null) || label.isEmpty() ? defaultLabel : label, |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1124 |
strong, style, |
10 | 1125 |
configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName), |
1126 |
""); |
|
1127 |
} |
|
1128 |
} |
|
1129 |
return null; |
|
1130 |
} |
|
1131 |
||
1132 |
public boolean isClassLinkable(ClassDoc cd) { |
|
1133 |
if (cd.isIncluded()) { |
|
1134 |
return configuration.isGeneratedDoc(cd); |
|
1135 |
} |
|
1136 |
return configuration.extern.isExternal(cd); |
|
1137 |
} |
|
1138 |
||
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1139 |
public DocLink getCrossPackageLink(String pkgName) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1140 |
return configuration.extern.getExternalLink(pkgName, pathToRoot, |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1141 |
DocPaths.PACKAGE_SUMMARY.getPath()); |
10 | 1142 |
} |
1143 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1144 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1145 |
* Get the class link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1146 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1147 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1148 |
* @param cd the class doc to link to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1149 |
* @return a content tree for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1150 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1151 |
public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) { |
17561 | 1152 |
return getLink(new LinkInfoImpl(configuration, context, cd) |
1153 |
.label(configuration.getClassName(cd))); |
|
10 | 1154 |
} |
1155 |
||
1156 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1157 |
* Add the class link. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1158 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1159 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1160 |
* @param cd the class doc to link to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1161 |
* @param contentTree the content tree to which the link will be added |
10 | 1162 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1163 |
public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1164 |
addPreQualifiedClassLink(context, cd, false, contentTree); |
10 | 1165 |
} |
1166 |
||
1167 |
/** |
|
1168 |
* Retrieve the class link with the package portion of the label in |
|
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1169 |
* plain text. If the qualifier is excluded, it will not be included in the |
10 | 1170 |
* link label. |
1171 |
* |
|
1172 |
* @param cd the class to link to. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1173 |
* @param isStrong true if the link should be strong. |
10 | 1174 |
* @return the link with the package portion of the label in plain text. |
1175 |
*/ |
|
17560 | 1176 |
public Content getPreQualifiedClassLink(LinkInfoImpl.Kind context, |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1177 |
ClassDoc cd, boolean isStrong) { |
17560 | 1178 |
ContentBuilder classlink = new ContentBuilder(); |
10 | 1179 |
PackageDoc pd = cd.containingPackage(); |
17560 | 1180 |
if (pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { |
1181 |
classlink.addContent(getPkgName(cd)); |
|
10 | 1182 |
} |
17560 | 1183 |
classlink.addContent(getLink(new LinkInfoImpl(configuration, |
17561 | 1184 |
context, cd).label(cd.name()).strong(isStrong))); |
10 | 1185 |
return classlink; |
1186 |
} |
|
1187 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1188 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1189 |
* Add the class link with the package portion of the label in |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1190 |
* plain text. If the qualifier is excluded, it will not be included in the |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1191 |
* link label. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1192 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1193 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1194 |
* @param cd the class to link to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1195 |
* @param isStrong true if the link should be strong |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1196 |
* @param contentTree the content tree to which the link with be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1197 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1198 |
public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1199 |
ClassDoc cd, boolean isStrong, Content contentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1200 |
PackageDoc pd = cd.containingPackage(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1201 |
if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1202 |
contentTree.addContent(getPkgName(cd)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1203 |
} |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1204 |
contentTree.addContent(getLink(new LinkInfoImpl(configuration, |
17561 | 1205 |
context, cd).label(cd.name()).strong(isStrong))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1206 |
} |
10 | 1207 |
|
1208 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1209 |
* Add the class link, with only class name as the strong link and prefixing |
10 | 1210 |
* plain package name. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1211 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1212 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1213 |
* @param cd the class to link to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1214 |
* @param contentTree the content tree to which the link with be added |
10 | 1215 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1216 |
public void addPreQualifiedStrongClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1217 |
addPreQualifiedClassLink(context, cd, true, contentTree); |
10 | 1218 |
} |
1219 |
||
1220 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1221 |
* Get the link for the given member. |
10 | 1222 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1223 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1224 |
* @param doc the member being linked to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1225 |
* @param label the label for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1226 |
* @return a content tree for the doc link |
10 | 1227 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1228 |
public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label) { |
17560 | 1229 |
return getDocLink(context, doc.containingClass(), doc, |
1230 |
new StringContent(label)); |
|
10 | 1231 |
} |
1232 |
||
1233 |
/** |
|
1234 |
* Return the link for the given member. |
|
1235 |
* |
|
1236 |
* @param context the id of the context where the link will be printed. |
|
1237 |
* @param doc the member being linked to. |
|
1238 |
* @param label the label for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1239 |
* @param strong true if the link should be strong. |
10 | 1240 |
* @return the link for the given member. |
1241 |
*/ |
|
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1242 |
public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label, |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1243 |
boolean strong) { |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1244 |
return getDocLink(context, doc.containingClass(), doc, label, strong); |
10 | 1245 |
} |
1246 |
||
1247 |
/** |
|
1248 |
* Return the link for the given member. |
|
1249 |
* |
|
1250 |
* @param context the id of the context where the link will be printed. |
|
1251 |
* @param classDoc the classDoc that we should link to. This is not |
|
1252 |
* necessarily equal to doc.containingClass(). We may be |
|
1253 |
* inheriting comments. |
|
1254 |
* @param doc the member being linked to. |
|
1255 |
* @param label the label for the link. |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
1264
diff
changeset
|
1256 |
* @param strong true if the link should be strong. |
10 | 1257 |
* @return the link for the given member. |
1258 |
*/ |
|
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1259 |
public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, |
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1260 |
String label, boolean strong) { |
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1261 |
return getDocLink(context, classDoc, doc, label, strong, false); |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1262 |
} |
17569 | 1263 |
public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, |
1264 |
Content label, boolean strong) { |
|
1265 |
return getDocLink(context, classDoc, doc, label, strong, false); |
|
1266 |
} |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1267 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1268 |
/** |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1269 |
* Return the link for the given member. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1270 |
* |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1271 |
* @param context the id of the context where the link will be printed. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1272 |
* @param classDoc the classDoc that we should link to. This is not |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1273 |
* necessarily equal to doc.containingClass(). We may be |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1274 |
* inheriting comments. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1275 |
* @param doc the member being linked to. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1276 |
* @param label the label for the link. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1277 |
* @param strong true if the link should be strong. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1278 |
* @param isProperty true if the doc parameter is a JavaFX property. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1279 |
* @return the link for the given member. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1280 |
*/ |
17559
87c28ee29329
8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents:
17558
diff
changeset
|
1281 |
public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, |
17560 | 1282 |
String label, boolean strong, boolean isProperty) { |
17569 | 1283 |
return getDocLink(context, classDoc, doc, new StringContent(check(label)), strong, isProperty); |
1284 |
} |
|
1285 |
||
1286 |
String check(String s) { |
|
1287 |
if (s.matches(".*[&<>].*"))throw new IllegalArgumentException(s); |
|
1288 |
return s; |
|
17560 | 1289 |
} |
1290 |
||
1291 |
public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, |
|
1292 |
Content label, boolean strong, boolean isProperty) { |
|
10 | 1293 |
if (! (doc.isIncluded() || |
14542 | 1294 |
Util.isLinkable(classDoc, configuration))) { |
17560 | 1295 |
return label; |
10 | 1296 |
} else if (doc instanceof ExecutableMemberDoc) { |
1297 |
ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; |
|
17561 | 1298 |
return getLink(new LinkInfoImpl(configuration, context, classDoc) |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
1299 |
.label(label).where(getName(getAnchor(emd, isProperty))).strong(strong)); |
10 | 1300 |
} else if (doc instanceof MemberDoc) { |
17561 | 1301 |
return getLink(new LinkInfoImpl(configuration, context, classDoc) |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
1302 |
.label(label).where(getName(doc.name())).strong(strong)); |
10 | 1303 |
} else { |
17560 | 1304 |
return label; |
10 | 1305 |
} |
1306 |
} |
|
1307 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1308 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1309 |
* Return the link for the given member. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1310 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1311 |
* @param context the id of the context where the link will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1312 |
* @param classDoc the classDoc that we should link to. This is not |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1313 |
* necessarily equal to doc.containingClass(). We may be |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1314 |
* inheriting comments |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1315 |
* @param doc the member being linked to |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1316 |
* @param label the label for the link |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1317 |
* @return the link for the given member |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1318 |
*/ |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1319 |
public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, |
17560 | 1320 |
Content label) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1321 |
if (! (doc.isIncluded() || |
14542 | 1322 |
Util.isLinkable(classDoc, configuration))) { |
17560 | 1323 |
return label; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1324 |
} else if (doc instanceof ExecutableMemberDoc) { |
17561 | 1325 |
ExecutableMemberDoc emd = (ExecutableMemberDoc) doc; |
1326 |
return getLink(new LinkInfoImpl(configuration, context, classDoc) |
|
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
1327 |
.label(label).where(getName(getAnchor(emd)))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1328 |
} else if (doc instanceof MemberDoc) { |
17561 | 1329 |
return getLink(new LinkInfoImpl(configuration, context, classDoc) |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
20613
diff
changeset
|
1330 |
.label(label).where(getName(doc.name()))); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1331 |
} else { |
17560 | 1332 |
return label; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1333 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1334 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1335 |
|
10 | 1336 |
public String getAnchor(ExecutableMemberDoc emd) { |
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1337 |
return getAnchor(emd, false); |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1338 |
} |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1339 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1340 |
public String getAnchor(ExecutableMemberDoc emd, boolean isProperty) { |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1341 |
if (isProperty) { |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1342 |
return emd.name(); |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
15725
diff
changeset
|
1343 |
} |
10 | 1344 |
StringBuilder signature = new StringBuilder(emd.signature()); |
1345 |
StringBuilder signatureParsed = new StringBuilder(); |
|
1346 |
int counter = 0; |
|
1347 |
for (int i = 0; i < signature.length(); i++) { |
|
1348 |
char c = signature.charAt(i); |
|
1349 |
if (c == '<') { |
|
1350 |
counter++; |
|
1351 |
} else if (c == '>') { |
|
1352 |
counter--; |
|
1353 |
} else if (counter == 0) { |
|
1354 |
signatureParsed.append(c); |
|
1355 |
} |
|
1356 |
} |
|
1357 |
return emd.name() + signatureParsed.toString(); |
|
1358 |
} |
|
1359 |
||
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1360 |
public Content seeTagToContent(SeeTag see) { |
10 | 1361 |
String tagName = see.name(); |
1362 |
if (! (tagName.startsWith("@link") || tagName.equals("@see"))) { |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1363 |
return new ContentBuilder(); |
10 | 1364 |
} |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1365 |
|
22160
fe9f4b305bcf
8029504: Regression: TestDocRootLink test fails on Windows
ksrini
parents:
22159
diff
changeset
|
1366 |
String seetext = replaceDocRootDir(Util.normalizeNewlines(see.text())); |
10 | 1367 |
|
1368 |
//Check if @see is an href or "string" |
|
1369 |
if (seetext.startsWith("<") || seetext.startsWith("\"")) { |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1370 |
return new RawHtml(seetext); |
10 | 1371 |
} |
1372 |
||
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1373 |
boolean plain = tagName.equalsIgnoreCase("@linkplain"); |
17560 | 1374 |
Content label = plainOrCode(plain, new RawHtml(see.label())); |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1375 |
|
10 | 1376 |
//The text from the @see tag. We will output this text when a label is not specified. |
17560 | 1377 |
Content text = plainOrCode(plain, new RawHtml(seetext)); |
10 | 1378 |
|
1379 |
ClassDoc refClass = see.referencedClass(); |
|
1380 |
String refClassName = see.referencedClassName(); |
|
1381 |
MemberDoc refMem = see.referencedMember(); |
|
1382 |
String refMemName = see.referencedMemberName(); |
|
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1383 |
|
10 | 1384 |
if (refClass == null) { |
1385 |
//@see is not referencing an included class |
|
1386 |
PackageDoc refPackage = see.referencedPackage(); |
|
1387 |
if (refPackage != null && refPackage.isIncluded()) { |
|
1388 |
//@see is referencing an included package |
|
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1389 |
if (label.isEmpty()) |
17560 | 1390 |
label = plainOrCode(plain, new StringContent(refPackage.name())); |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1391 |
return getPackageLink(refPackage, label); |
10 | 1392 |
} else { |
1393 |
//@see is not referencing an included class or package. Check for cross links. |
|
17560 | 1394 |
Content classCrossLink; |
14358
9eda9239cba0
8000416: refactor javadoc to provide and use an abstraction for relative URIs
jjg
parents:
14357
diff
changeset
|
1395 |
DocLink packageCrossLink = getCrossPackageLink(refClassName); |
10 | 1396 |
if (packageCrossLink != null) { |
1397 |
//Package cross link found |
|
17560 | 1398 |
return getHyperLink(packageCrossLink, |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1399 |
(label.isEmpty() ? text : label)); |
10 | 1400 |
} else if ((classCrossLink = getCrossClassLink(refClassName, |
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1401 |
refMemName, label, false, "", !plain)) != null) { |
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1402 |
//Class cross link found (possibly to a member in the class) |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1403 |
return classCrossLink; |
10 | 1404 |
} else { |
1405 |
//No cross link found so print warning |
|
1406 |
configuration.getDocletSpecificMsg().warning(see.position(), "doclet.see.class_or_package_not_found", |
|
1407 |
tagName, seetext); |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1408 |
return (label.isEmpty() ? text: label); |
10 | 1409 |
} |
1410 |
} |
|
1411 |
} else if (refMemName == null) { |
|
1412 |
// Must be a class reference since refClass is not null and refMemName is null. |
|
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1413 |
if (label.isEmpty()) { |
17560 | 1414 |
label = plainOrCode(plain, new StringContent(refClass.name())); |
10 | 1415 |
} |
17561 | 1416 |
return getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, refClass) |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1417 |
.label(label)); |
10 | 1418 |
} else if (refMem == null) { |
1419 |
// Must be a member reference since refClass is not null and refMemName is not null. |
|
1420 |
// However, refMem is null, so this referenced member does not exist. |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1421 |
return (label.isEmpty() ? text: label); |
10 | 1422 |
} else { |
1423 |
// Must be a member reference since refClass is not null and refMemName is not null. |
|
1424 |
// refMem is not null, so this @see tag must be referencing a valid member. |
|
1425 |
ClassDoc containing = refMem.containingClass(); |
|
1426 |
if (see.text().trim().startsWith("#") && |
|
1427 |
! (containing.isPublic() || |
|
14542 | 1428 |
Util.isLinkable(containing, configuration))) { |
10 | 1429 |
// Since the link is relative and the holder is not even being |
1430 |
// documented, this must be an inherited link. Redirect it. |
|
1431 |
// The current class either overrides the referenced member or |
|
1432 |
// inherits it automatically. |
|
3891
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1433 |
if (this instanceof ClassWriterImpl) { |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1434 |
containing = ((ClassWriterImpl) this).getClassDoc(); |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1435 |
} else if (!containing.isPublic()){ |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1436 |
configuration.getDocletSpecificMsg().warning( |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1437 |
see.position(), "doclet.see.class_or_package_not_accessible", |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1438 |
tagName, containing.qualifiedName()); |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1439 |
} else { |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1440 |
configuration.getDocletSpecificMsg().warning( |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1441 |
see.position(), "doclet.see.class_or_package_not_found", |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1442 |
tagName, seetext); |
69ac41cb327b
5093723: REGRESSION: ClassCastException in SingleIndexWriter
jjg
parents:
2321
diff
changeset
|
1443 |
} |
10 | 1444 |
} |
1445 |
if (configuration.currentcd != containing) { |
|
1446 |
refMemName = containing.name() + "." + refMemName; |
|
1447 |
} |
|
1448 |
if (refMem instanceof ExecutableMemberDoc) { |
|
1449 |
if (refMemName.indexOf('(') < 0) { |
|
1450 |
refMemName += ((ExecutableMemberDoc)refMem).signature(); |
|
1451 |
} |
|
1452 |
} |
|
14266
69453558960d
8000673: remove dead code from HtmlWriter and subtypes
jjg
parents:
14265
diff
changeset
|
1453 |
|
17560 | 1454 |
text = plainOrCode(plain, new StringContent(refMemName)); |
10 | 1455 |
|
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
1456 |
return getDocLink(LinkInfoImpl.Kind.SEE_TAG, containing, |
17569 | 1457 |
refMem, (label.isEmpty() ? text: label), false); |
10 | 1458 |
} |
1459 |
} |
|
1460 |
||
17560 | 1461 |
private Content plainOrCode(boolean plain, Content body) { |
1462 |
return (plain || body.isEmpty()) ? body : HtmlTree.CODE(body); |
|
1463 |
} |
|
1464 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1465 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1466 |
* Add the inline comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1467 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1468 |
* @param doc the doc for which the inline comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1469 |
* @param tag the inline tag to be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1470 |
* @param htmltree the content tree to which the comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1471 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1472 |
public void addInlineComment(Doc doc, Tag tag, Content htmltree) { |
17547
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1473 |
addCommentTags(doc, tag, tag.inlineTags(), false, false, htmltree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1474 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1475 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1476 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1477 |
* Add the inline deprecated comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1478 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1479 |
* @param doc the doc for which the inline deprecated comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1480 |
* @param tag the inline tag to be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1481 |
* @param htmltree the content tree to which the comment will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1482 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1483 |
public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1484 |
addCommentTags(doc, tag.inlineTags(), true, false, htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1485 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1486 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1487 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1488 |
* Adds the summary content. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1489 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1490 |
* @param doc the doc for which the summary will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1491 |
* @param htmltree the documentation tree to which the summary will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1492 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1493 |
public void addSummaryComment(Doc doc, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1494 |
addSummaryComment(doc, doc.firstSentenceTags(), htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1495 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1496 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1497 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1498 |
* Adds the summary content. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1499 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1500 |
* @param doc the doc for which the summary will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1501 |
* @param firstSentenceTags the first sentence tags for the doc |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1502 |
* @param htmltree the documentation tree to which the summary will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1503 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1504 |
public void addSummaryComment(Doc doc, Tag[] firstSentenceTags, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1505 |
addCommentTags(doc, firstSentenceTags, false, true, htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1506 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1507 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1508 |
public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1509 |
addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1510 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1511 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1512 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1513 |
* Adds the inline comment. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1514 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1515 |
* @param doc the doc for which the inline comments will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1516 |
* @param htmltree the documentation tree to which the inline comments will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1517 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1518 |
public void addInlineComment(Doc doc, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1519 |
addCommentTags(doc, doc.inlineTags(), false, false, htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1520 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1521 |
|
10 | 1522 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1523 |
* Adds the comment tags. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1524 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1525 |
* @param doc the doc for which the comment tags will be generated |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1526 |
* @param tags the first sentence tags for the doc |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1527 |
* @param depr true if it is deprecated |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1528 |
* @param first true if the first sentence tags should be added |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1529 |
* @param htmltree the documentation tree to which the comment tags will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1530 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1531 |
private void addCommentTags(Doc doc, Tag[] tags, boolean depr, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1532 |
boolean first, Content htmltree) { |
17547
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1533 |
addCommentTags(doc, null, tags, depr, first, htmltree); |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1534 |
} |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1535 |
|
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1536 |
/** |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1537 |
* Adds the comment tags. |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1538 |
* |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1539 |
* @param doc the doc for which the comment tags will be generated |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1540 |
* @param holderTag the block tag context for the inline tags |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1541 |
* @param tags the first sentence tags for the doc |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1542 |
* @param depr true if it is deprecated |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1543 |
* @param first true if the first sentence tags should be added |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1544 |
* @param htmltree the documentation tree to which the comment tags will be added |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1545 |
*/ |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1546 |
private void addCommentTags(Doc doc, Tag holderTag, Tag[] tags, boolean depr, |
40f2f9a5a445
8008768: Using {@inheritDoc} in simple tag defined via -tag fails
jjg
parents:
16964
diff
changeset
|
1547 |
boolean first, Content htmltree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1548 |
if(configuration.nocomment){ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1549 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1550 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1551 |
Content div; |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1552 |
Content result = commentTagsToContent(null, doc, tags, first); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1553 |
if (depr) { |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
1554 |
Content italic = HtmlTree.SPAN(HtmlStyle.deprecationComment, result); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1555 |
div = HtmlTree.DIV(HtmlStyle.block, italic); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1556 |
htmltree.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1557 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1558 |
else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1559 |
div = HtmlTree.DIV(HtmlStyle.block, result); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1560 |
htmltree.addContent(div); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1561 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1562 |
if (tags.length == 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1563 |
htmltree.addContent(getSpace()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1564 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1565 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1566 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1567 |
/** |
10 | 1568 |
* Converts inline tags and text to text strings, expanding the |
1569 |
* inline tags along the way. Called wherever text can contain |
|
1570 |
* an inline tag, such as in comments or in free-form text arguments |
|
1571 |
* to non-inline tags. |
|
1572 |
* |
|
1573 |
* @param holderTag specific tag where comment resides |
|
1574 |
* @param doc specific doc where comment resides |
|
1575 |
* @param tags array of text tags and inline tags (often alternating) |
|
1576 |
* present in the text of interest for this doc |
|
1577 |
* @param isFirstSentence true if text is first sentence |
|
1578 |
*/ |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1579 |
public Content commentTagsToContent(Tag holderTag, Doc doc, Tag[] tags, |
10 | 1580 |
boolean isFirstSentence) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1581 |
Content result = new ContentBuilder(); |
9608 | 1582 |
boolean textTagChange = false; |
10 | 1583 |
// Array of all possible inline tags for this javadoc run |
1584 |
configuration.tagletManager.checkTags(doc, tags, true); |
|
1585 |
for (int i = 0; i < tags.length; i++) { |
|
1586 |
Tag tagelem = tags[i]; |
|
1587 |
String tagName = tagelem.name(); |
|
1588 |
if (tagelem instanceof SeeTag) { |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1589 |
result.addContent(seeTagToContent((SeeTag) tagelem)); |
10 | 1590 |
} else if (! tagName.equals("Text")) { |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1591 |
boolean wasEmpty = result.isEmpty(); |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1592 |
Content output; |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1593 |
if (configuration.docrootparent.length() > 0 |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1594 |
&& tagelem.name().equals("@docRoot") |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1595 |
&& ((tags[i + 1]).text()).startsWith("/..")) { |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1596 |
// If Xdocrootparent switch ON, set the flag to remove the /.. occurrence after |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1597 |
// {@docRoot} tag in the very next Text tag. |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1598 |
textTagChange = true; |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1599 |
// Replace the occurrence of {@docRoot}/.. with the absolute link. |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1600 |
output = new StringContent(configuration.docrootparent); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1601 |
} else { |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1602 |
output = TagletWriter.getInlineTagOuput( |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1603 |
configuration.tagletManager, holderTag, |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1604 |
tagelem, getTagletWriterInstance(isFirstSentence)); |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1605 |
} |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1606 |
if (output != null) |
17574
044c7e1e4d53
8012308: Remove TagletOutput in favor of direct use of Content
jjg
parents:
17573
diff
changeset
|
1607 |
result.addContent(output); |
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1608 |
if (wasEmpty && isFirstSentence && tagelem.name().equals("@inheritDoc") && !result.isEmpty()) { |
10 | 1609 |
break; |
1610 |
} else { |
|
9608 | 1611 |
continue; |
10 | 1612 |
} |
1613 |
} else { |
|
9608 | 1614 |
String text = tagelem.text(); |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
21494
diff
changeset
|
1615 |
//If Xdocrootparent switch ON, remove the /.. occurrence after {@docRoot} tag. |
9608 | 1616 |
if (textTagChange) { |
1617 |
text = text.replaceFirst("/..", ""); |
|
1618 |
textTagChange = false; |
|
1619 |
} |
|
10 | 1620 |
//This is just a regular text tag. The text may contain html links (<a>) |
1621 |
//or inline tag {@docRoot}, which will be handled as special cases. |
|
9608 | 1622 |
text = redirectRelativeLinks(tagelem.holder(), text); |
10 | 1623 |
|
1624 |
// Replace @docRoot only if not represented by an instance of DocRootTaglet, |
|
1625 |
// that is, only if it was not present in a source file doc comment. |
|
1626 |
// This happens when inserted by the doclet (a few lines |
|
1627 |
// above in this method). [It might also happen when passed in on the command |
|
1628 |
// line as a text argument to an option (like -header).] |
|
1629 |
text = replaceDocRootDir(text); |
|
1630 |
if (isFirstSentence) { |
|
1631 |
text = removeNonInlineHtmlTags(text); |
|
1632 |
} |
|
17571 | 1633 |
text = Util.replaceTabs(configuration, text); |
19119 | 1634 |
text = Util.normalizeNewlines(text); |
17571 | 1635 |
result.addContent(new RawHtml(text)); |
10 | 1636 |
} |
1637 |
} |
|
17568
d9691936f5f9
8012177: HTMLDocletWriter methods should generate Content, not Strings
jjg
parents:
17567
diff
changeset
|
1638 |
return result; |
10 | 1639 |
} |
1640 |
||
1641 |
/** |
|
1642 |
* Return true if relative links should not be redirected. |
|
1643 |
* |
|
1644 |
* @return Return true if a relative link should not be redirected. |
|
1645 |
*/ |
|
1646 |
private boolean shouldNotRedirectRelativeLinks() { |
|
1647 |
return this instanceof AnnotationTypeWriter || |
|
1648 |
this instanceof ClassWriter || |
|
1649 |
this instanceof PackageSummaryWriter; |
|
1650 |
} |
|
1651 |
||
1652 |
/** |
|
1653 |
* Suppose a piece of documentation has a relative link. When you copy |
|
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1654 |
* that documentation to another place such as the index or class-use page, |
10 | 1655 |
* that relative link will no longer work. We should redirect those links |
1656 |
* so that they will work again. |
|
1657 |
* <p> |
|
1658 |
* Here is the algorithm used to fix the link: |
|
1659 |
* <p> |
|
13844 | 1660 |
* {@literal <relative link> => docRoot + <relative path to file> + <relative link> } |
10 | 1661 |
* <p> |
1662 |
* For example, suppose com.sun.javadoc.RootDoc has this link: |
|
13844 | 1663 |
* {@literal <a href="package-summary.html">The package Page</a> } |
10 | 1664 |
* <p> |
1665 |
* If this link appeared in the index, we would redirect |
|
1666 |
* the link like this: |
|
1667 |
* |
|
13844 | 1668 |
* {@literal <a href="./com/sun/javadoc/package-summary.html">The package Page</a>} |
10 | 1669 |
* |
1670 |
* @param doc the Doc object whose documentation is being written. |
|
1671 |
* @param text the text being written. |
|
1672 |
* |
|
1673 |
* @return the text, with all the relative links redirected to work. |
|
1674 |
*/ |
|
1675 |
private String redirectRelativeLinks(Doc doc, String text) { |
|
1676 |
if (doc == null || shouldNotRedirectRelativeLinks()) { |
|
1677 |
return text; |
|
1678 |
} |
|
1679 |
||
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1680 |
DocPath redirectPathFromRoot; |
10 | 1681 |
if (doc instanceof ClassDoc) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1682 |
redirectPathFromRoot = DocPath.forPackage(((ClassDoc) doc).containingPackage()); |
10 | 1683 |
} else if (doc instanceof MemberDoc) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1684 |
redirectPathFromRoot = DocPath.forPackage(((MemberDoc) doc).containingPackage()); |
10 | 1685 |
} else if (doc instanceof PackageDoc) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1686 |
redirectPathFromRoot = DocPath.forPackage((PackageDoc) doc); |
10 | 1687 |
} else { |
1688 |
return text; |
|
1689 |
} |
|
1690 |
||
1691 |
//Redirect all relative links. |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1692 |
int end, begin = StringUtils.toLowerCase(text).indexOf("<a"); |
10 | 1693 |
if(begin >= 0){ |
14263 | 1694 |
StringBuilder textBuff = new StringBuilder(text); |
10 | 1695 |
|
1696 |
while(begin >=0){ |
|
1697 |
if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) { |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1698 |
begin = StringUtils.toLowerCase(textBuff.toString()).indexOf("<a", begin + 1); |
10 | 1699 |
continue; |
1700 |
} |
|
1701 |
||
1702 |
begin = textBuff.indexOf("=", begin) + 1; |
|
1703 |
end = textBuff.indexOf(">", begin +1); |
|
1704 |
if(begin == 0){ |
|
1705 |
//Link has no equal symbol. |
|
1706 |
configuration.root.printWarning( |
|
1707 |
doc.position(), |
|
1708 |
configuration.getText("doclet.malformed_html_link_tag", text)); |
|
1709 |
break; |
|
1710 |
} |
|
1711 |
if (end == -1) { |
|
1712 |
//Break without warning. This <a> tag is not necessarily malformed. The text |
|
1713 |
//might be missing '>' character because the href has an inline tag. |
|
1714 |
break; |
|
1715 |
} |
|
23123
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1716 |
|
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1717 |
String quote = textBuff.substring(begin, end); |
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1718 |
quote = quote.contains("\"") ? "\"" : |
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1719 |
quote.contains("\'") ? "\'" : null; |
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1720 |
if (quote != null) { |
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1721 |
begin = textBuff.indexOf(quote, begin) + 1; |
fd8ad69ac7fe
6457406: javadoc doesn't handle <a href='http://...'> properly in producing index pages
yan
parents:
22163
diff
changeset
|
1722 |
end = textBuff.indexOf(quote, begin +1); |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1723 |
if (begin == 0 || end == -1){ |
10 | 1724 |
//Link is missing a quote. |
1725 |
break; |
|
1726 |
} |
|
1727 |
} |
|
1728 |
String relativeLink = textBuff.substring(begin, end); |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1729 |
String relativeLinkLowerCase = StringUtils.toLowerCase(relativeLink); |
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1730 |
if (!(relativeLinkLowerCase.startsWith("mailto:") || |
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1731 |
relativeLinkLowerCase.startsWith("http:") || |
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1732 |
relativeLinkLowerCase.startsWith("https:") || |
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1733 |
relativeLinkLowerCase.startsWith("file:"))) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1734 |
relativeLink = "{@"+(new DocRootTaglet()).getName() + "}/" |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1735 |
+ redirectPathFromRoot.resolve(relativeLink).getPath(); |
10 | 1736 |
textBuff.replace(begin, end, relativeLink); |
1737 |
} |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1738 |
begin = StringUtils.toLowerCase(textBuff.toString()).indexOf("<a", begin + 1); |
10 | 1739 |
} |
1740 |
return textBuff.toString(); |
|
1741 |
} |
|
1742 |
return text; |
|
1743 |
} |
|
1744 |
||
22163 | 1745 |
static final Set<String> blockTags = new HashSet<>(); |
17571 | 1746 |
static { |
1747 |
for (HtmlTag t: HtmlTag.values()) { |
|
1748 |
if (t.blockType == HtmlTag.BlockType.BLOCK) |
|
1749 |
blockTags.add(t.value); |
|
1750 |
} |
|
1751 |
} |
|
1752 |
||
1753 |
public static String removeNonInlineHtmlTags(String text) { |
|
1754 |
final int len = text.length(); |
|
1755 |
||
1756 |
int startPos = 0; // start of text to copy |
|
1757 |
int lessThanPos = text.indexOf('<'); // position of latest '<' |
|
1758 |
if (lessThanPos < 0) { |
|
10 | 1759 |
return text; |
1760 |
} |
|
17571 | 1761 |
|
1762 |
StringBuilder result = new StringBuilder(); |
|
1763 |
main: while (lessThanPos != -1) { |
|
1764 |
int currPos = lessThanPos + 1; |
|
1765 |
if (currPos == len) |
|
1766 |
break; |
|
1767 |
char ch = text.charAt(currPos); |
|
1768 |
if (ch == '/') { |
|
1769 |
if (++currPos == len) |
|
1770 |
break; |
|
1771 |
ch = text.charAt(currPos); |
|
1772 |
} |
|
1773 |
int tagPos = currPos; |
|
1774 |
while (isHtmlTagLetterOrDigit(ch)) { |
|
1775 |
if (++currPos == len) |
|
1776 |
break main; |
|
1777 |
ch = text.charAt(currPos); |
|
1778 |
} |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
22005
diff
changeset
|
1779 |
if (ch == '>' && blockTags.contains(StringUtils.toLowerCase(text.substring(tagPos, currPos)))) { |
17571 | 1780 |
result.append(text, startPos, lessThanPos); |
1781 |
startPos = currPos + 1; |
|
1782 |
} |
|
1783 |
lessThanPos = text.indexOf('<', currPos); |
|
10 | 1784 |
} |
17571 | 1785 |
result.append(text.substring(startPos)); |
1786 |
||
1787 |
return result.toString(); |
|
10 | 1788 |
} |
1789 |
||
17578 | 1790 |
private static boolean isHtmlTagLetterOrDigit(char ch) { |
17571 | 1791 |
return ('a' <= ch && ch <= 'z') || |
1792 |
('A' <= ch && ch <= 'Z') || |
|
1793 |
('1' <= ch && ch <= '6'); |
|
10 | 1794 |
} |
1795 |
||
1796 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1797 |
* Returns a link to the stylesheet file. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1798 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1799 |
* @return an HtmlTree for the lINK tag which provides the stylesheet location |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1800 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1801 |
public HtmlTree getStyleSheetProperties() { |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
1802 |
String stylesheetfile = configuration.stylesheetfile; |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1803 |
DocPath stylesheet; |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
1804 |
if (stylesheetfile.isEmpty()) { |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
1805 |
stylesheet = DocPaths.STYLESHEET; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1806 |
} else { |
14368
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
1807 |
DocFile file = DocFile.createFileForInput(configuration, stylesheetfile); |
6f4c62de6985
8001664: refactor javadoc to use abstraction to handle files
jjg
parents:
14366
diff
changeset
|
1808 |
stylesheet = DocPath.create(file.getName()); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1809 |
} |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1810 |
HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1811 |
pathToRoot.resolve(stylesheet).getPath(), |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14266
diff
changeset
|
1812 |
"Style"); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1813 |
return link; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1814 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1815 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1816 |
/** |
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1817 |
* Returns a link to the JavaScript file. |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1818 |
* |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1819 |
* @return an HtmlTree for the Script tag which provides the JavaScript location |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1820 |
*/ |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1821 |
public HtmlTree getScriptProperties() { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1822 |
HtmlTree script = HtmlTree.SCRIPT("text/javascript", |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1823 |
pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath()); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1824 |
return script; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1825 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1826 |
|
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
14542
diff
changeset
|
1827 |
/** |
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
8631
diff
changeset
|
1828 |
* According to |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
8631
diff
changeset
|
1829 |
* <cite>The Java™ Language Specification</cite>, |
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
8631
diff
changeset
|
1830 |
* all the outer classes and static nested classes are core classes. |
10 | 1831 |
*/ |
1832 |
public boolean isCoreClass(ClassDoc cd) { |
|
1833 |
return cd.containingClass() == null || cd.isStatic(); |
|
1834 |
} |
|
1835 |
||
1836 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1837 |
* Adds the annotatation types for the given packageDoc. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1838 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1839 |
* @param packageDoc the package to write annotations for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1840 |
* @param htmltree the documentation tree to which the annotation info will be |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1841 |
* added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1842 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1843 |
public void addAnnotationInfo(PackageDoc packageDoc, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1844 |
addAnnotationInfo(packageDoc, packageDoc.annotations(), htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1845 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1846 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1847 |
/** |
15385 | 1848 |
* Add the annotation types of the executable receiver. |
1849 |
* |
|
1850 |
* @param method the executable to write the receiver annotations for. |
|
16964
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1851 |
* @param descList list of annotation description. |
15385 | 1852 |
* @param htmltree the documentation tree to which the annotation info will be |
1853 |
* added |
|
1854 |
*/ |
|
16964
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1855 |
public void addReceiverAnnotationInfo(ExecutableMemberDoc method, AnnotationDesc[] descList, |
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1856 |
Content htmltree) { |
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1857 |
addAnnotationInfo(0, method, descList, false, htmltree); |
15385 | 1858 |
} |
1859 |
||
1860 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1861 |
* Adds the annotatation types for the given doc. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1862 |
* |
14259 | 1863 |
* @param doc the package to write annotations for |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1864 |
* @param htmltree the content tree to which the annotation types will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1865 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1866 |
public void addAnnotationInfo(ProgramElementDoc doc, Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1867 |
addAnnotationInfo(doc, doc.annotations(), htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1868 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1869 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1870 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1871 |
* Add the annotatation types for the given doc and parameter. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1872 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1873 |
* @param indent the number of spaces to indent the parameters. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1874 |
* @param doc the doc to write annotations for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1875 |
* @param param the parameter to write annotations for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1876 |
* @param tree the content tree to which the annotation types will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1877 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1878 |
public boolean addAnnotationInfo(int indent, Doc doc, Parameter param, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1879 |
Content tree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1880 |
return addAnnotationInfo(indent, doc, param.annotations(), false, tree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1881 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1882 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1883 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1884 |
* Adds the annotatation types for the given doc. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1885 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1886 |
* @param doc the doc to write annotations for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1887 |
* @param descList the array of {@link AnnotationDesc}. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1888 |
* @param htmltree the documentation tree to which the annotation info will be |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1889 |
* added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1890 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1891 |
private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1892 |
Content htmltree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1893 |
addAnnotationInfo(0, doc, descList, true, htmltree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1894 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1895 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1896 |
/** |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1897 |
* Adds the annotation types for the given doc. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1898 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1899 |
* @param indent the number of extra spaces to indent the annotations. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1900 |
* @param doc the doc to write annotations for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1901 |
* @param descList the array of {@link AnnotationDesc}. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1902 |
* @param htmltree the documentation tree to which the annotation info will be |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1903 |
* added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1904 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1905 |
private boolean addAnnotationInfo(int indent, Doc doc, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1906 |
AnnotationDesc[] descList, boolean lineBreak, Content htmltree) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1907 |
List<Content> annotations = getAnnotations(indent, descList, lineBreak); |
16964
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1908 |
String sep =""; |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1909 |
if (annotations.isEmpty()) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1910 |
return false; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1911 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1912 |
for (Content annotation: annotations) { |
16964
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1913 |
htmltree.addContent(sep); |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1914 |
htmltree.addContent(annotation); |
16964
096de5815398
8005091: javadoc should be able to return the receiver type
bpatel
parents:
16319
diff
changeset
|
1915 |
sep = " "; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1916 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1917 |
return true; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1918 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1919 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
1920 |
/** |
10 | 1921 |
* Return the string representations of the annotation types for |
1922 |
* the given doc. |
|
1923 |
* |
|
1924 |
* @param indent the number of extra spaces to indent the annotations. |
|
1925 |
* @param descList the array of {@link AnnotationDesc}. |
|
1926 |
* @param linkBreak if true, add new line between each member value. |
|
1927 |
* @return an array of strings representing the annotations being |
|
1928 |
* documented. |
|
1929 |
*/ |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1930 |
private List<Content> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) { |
15385 | 1931 |
return getAnnotations(indent, descList, linkBreak, true); |
1932 |
} |
|
1933 |
||
1934 |
/** |
|
1935 |
* Return the string representations of the annotation types for |
|
1936 |
* the given doc. |
|
1937 |
* |
|
1938 |
* A {@code null} {@code elementType} indicates that all the |
|
1939 |
* annotations should be returned without any filtering. |
|
1940 |
* |
|
1941 |
* @param indent the number of extra spaces to indent the annotations. |
|
1942 |
* @param descList the array of {@link AnnotationDesc}. |
|
1943 |
* @param linkBreak if true, add new line between each member value. |
|
1944 |
* @param elementType the type of targeted element (used for filtering |
|
1945 |
* type annotations from declaration annotations) |
|
1946 |
* @return an array of strings representing the annotations being |
|
1947 |
* documented. |
|
1948 |
*/ |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1949 |
public List<Content> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak, |
15385 | 1950 |
boolean isJava5DeclarationLocation) { |
22163 | 1951 |
List<Content> results = new ArrayList<>(); |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1952 |
ContentBuilder annotation; |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1953 |
for (AnnotationDesc aDesc : descList) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1954 |
AnnotationTypeDoc annotationDoc = aDesc.annotationType(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1955 |
// If an annotation is not documented, do not add it to the list. If |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1956 |
// the annotation is of a repeatable type, and if it is not documented |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1957 |
// and also if its container annotation is not documented, do not add it |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1958 |
// to the list. If an annotation of a repeatable type is not documented |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1959 |
// but its container is documented, it will be added to the list. |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1960 |
if (!Util.isDocumentedAnnotation(annotationDoc) && |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1961 |
(!isAnnotationDocumented && !isContainerDocumented)) { |
10 | 1962 |
continue; |
1963 |
} |
|
15385 | 1964 |
/* TODO: check logic here to correctly handle declaration |
1965 |
* and type annotations. |
|
1966 |
if (Util.isDeclarationAnnotation(annotationDoc, isJava5DeclarationLocation)) { |
|
1967 |
continue; |
|
1968 |
}*/ |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1969 |
annotation = new ContentBuilder(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1970 |
isAnnotationDocumented = false; |
14542 | 1971 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1972 |
LinkInfoImpl.Kind.ANNOTATION, annotationDoc); |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1973 |
AnnotationDesc.ElementValuePair[] pairs = aDesc.elementValues(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1974 |
// If the annotation is synthesized, do not print the container. |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1975 |
if (aDesc.isSynthesized()) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1976 |
for (AnnotationDesc.ElementValuePair pair : pairs) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
1977 |
AnnotationValue annotationValue = pair.value(); |
22163 | 1978 |
List<AnnotationValue> annotationTypeValues = new ArrayList<>(); |
10 | 1979 |
if (annotationValue.value() instanceof AnnotationValue[]) { |
1980 |
AnnotationValue[] annotationArray = |
|
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1981 |
(AnnotationValue[]) annotationValue.value(); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1982 |
annotationTypeValues.addAll(Arrays.asList(annotationArray)); |
10 | 1983 |
} else { |
1984 |
annotationTypeValues.add(annotationValue); |
|
1985 |
} |
|
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1986 |
String sep = ""; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1987 |
for (AnnotationValue av : annotationTypeValues) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1988 |
annotation.addContent(sep); |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
1989 |
annotation.addContent(annotationValueToContent(av)); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1990 |
sep = " "; |
10 | 1991 |
} |
1992 |
} |
|
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1993 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1994 |
else if (isAnnotationArray(pairs)) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1995 |
// If the container has 1 or more value defined and if the |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1996 |
// repeatable type annotation is not documented, do not print |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1997 |
// the container. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1998 |
if (pairs.length == 1 && isAnnotationDocumented) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
1999 |
AnnotationValue[] annotationArray = |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2000 |
(AnnotationValue[]) (pairs[0].value()).value(); |
22163 | 2001 |
List<AnnotationValue> annotationTypeValues = new ArrayList<>(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2002 |
annotationTypeValues.addAll(Arrays.asList(annotationArray)); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2003 |
String sep = ""; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2004 |
for (AnnotationValue av : annotationTypeValues) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2005 |
annotation.addContent(sep); |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2006 |
annotation.addContent(annotationValueToContent(av)); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2007 |
sep = " "; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2008 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2009 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2010 |
// If the container has 1 or more value defined and if the |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2011 |
// repeatable type annotation is not documented, print the container. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2012 |
else { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2013 |
addAnnotations(annotationDoc, linkInfo, annotation, pairs, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
2014 |
indent, false); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2015 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2016 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2017 |
else { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2018 |
addAnnotations(annotationDoc, linkInfo, annotation, pairs, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
2019 |
indent, linkBreak); |
10 | 2020 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2021 |
annotation.addContent(linkBreak ? DocletConstants.NL : ""); |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2022 |
results.add(annotation); |
10 | 2023 |
} |
2024 |
return results; |
|
2025 |
} |
|
2026 |
||
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2027 |
/** |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2028 |
* Add annotation to the annotation string. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2029 |
* |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2030 |
* @param annotationDoc the annotation being documented |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2031 |
* @param linkInfo the information about the link |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2032 |
* @param annotation the annotation string to which the annotation will be added |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2033 |
* @param pairs annotation type element and value pairs |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2034 |
* @param indent the number of extra spaces to indent the annotations. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2035 |
* @param linkBreak if true, add new line between each member value |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2036 |
*/ |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2037 |
private void addAnnotations(AnnotationTypeDoc annotationDoc, LinkInfoImpl linkInfo, |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2038 |
ContentBuilder annotation, AnnotationDesc.ElementValuePair[] pairs, |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2039 |
int indent, boolean linkBreak) { |
17560 | 2040 |
linkInfo.label = new StringContent("@" + annotationDoc.name()); |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2041 |
annotation.addContent(getLink(linkInfo)); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2042 |
if (pairs.length > 0) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2043 |
annotation.addContent("("); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2044 |
for (int j = 0; j < pairs.length; j++) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2045 |
if (j > 0) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2046 |
annotation.addContent(","); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2047 |
if (linkBreak) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2048 |
annotation.addContent(DocletConstants.NL); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2049 |
int spaces = annotationDoc.name().length() + 2; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2050 |
for (int k = 0; k < (spaces + indent); k++) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2051 |
annotation.addContent(" "); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2052 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2053 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2054 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2055 |
annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2056 |
pairs[j].element(), pairs[j].element().name(), false)); |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2057 |
annotation.addContent("="); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2058 |
AnnotationValue annotationValue = pairs[j].value(); |
22163 | 2059 |
List<AnnotationValue> annotationTypeValues = new ArrayList<>(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2060 |
if (annotationValue.value() instanceof AnnotationValue[]) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2061 |
AnnotationValue[] annotationArray = |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2062 |
(AnnotationValue[]) annotationValue.value(); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2063 |
annotationTypeValues.addAll(Arrays.asList(annotationArray)); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2064 |
} else { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2065 |
annotationTypeValues.add(annotationValue); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2066 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2067 |
annotation.addContent(annotationTypeValues.size() == 1 ? "" : "{"); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2068 |
String sep = ""; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2069 |
for (AnnotationValue av : annotationTypeValues) { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2070 |
annotation.addContent(sep); |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2071 |
annotation.addContent(annotationValueToContent(av)); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2072 |
sep = ","; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2073 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2074 |
annotation.addContent(annotationTypeValues.size() == 1 ? "" : "}"); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2075 |
isContainerDocumented = false; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2076 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2077 |
annotation.addContent(")"); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2078 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2079 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2080 |
|
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2081 |
/** |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2082 |
* Check if the annotation contains an array of annotation as a value. This |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2083 |
* check is to verify if a repeatable type annotation is present or not. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2084 |
* |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2085 |
* @param pairs annotation type element and value pairs |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2086 |
* |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2087 |
* @return true if the annotation contains an array of annotation as a value. |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2088 |
*/ |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2089 |
private boolean isAnnotationArray(AnnotationDesc.ElementValuePair[] pairs) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2090 |
AnnotationValue annotationValue; |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
2091 |
for (AnnotationDesc.ElementValuePair pair : pairs) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
2092 |
annotationValue = pair.value(); |
15035
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2093 |
if (annotationValue.value() instanceof AnnotationValue[]) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2094 |
AnnotationValue[] annotationArray = |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2095 |
(AnnotationValue[]) annotationValue.value(); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2096 |
if (annotationArray.length > 1) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2097 |
if (annotationArray[0].value() instanceof AnnotationDesc) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2098 |
AnnotationTypeDoc annotationDoc = |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2099 |
((AnnotationDesc) annotationArray[0].value()).annotationType(); |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2100 |
isContainerDocumented = true; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2101 |
if (Util.isDocumentedAnnotation(annotationDoc)) { |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2102 |
isAnnotationDocumented = true; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2103 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2104 |
return true; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2105 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2106 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2107 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2108 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2109 |
return false; |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2110 |
} |
d03c311f44e6
8005092: javadoc should check for synthesized bit on an annotation
bpatel
parents:
14549
diff
changeset
|
2111 |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2112 |
private Content annotationValueToContent(AnnotationValue annotationValue) { |
10 | 2113 |
if (annotationValue.value() instanceof Type) { |
2114 |
Type type = (Type) annotationValue.value(); |
|
2115 |
if (type.asClassDoc() != null) { |
|
14542 | 2116 |
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
2117 |
LinkInfoImpl.Kind.ANNOTATION, type); |
17560 | 2118 |
linkInfo.label = new StringContent((type.asClassDoc().isIncluded() ? |
2119 |
type.typeName() : |
|
2120 |
type.qualifiedTypeName()) + type.dimension() + ".class"); |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2121 |
return getLink(linkInfo); |
10 | 2122 |
} else { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2123 |
return new StringContent(type.typeName() + type.dimension() + ".class"); |
10 | 2124 |
} |
2125 |
} else if (annotationValue.value() instanceof AnnotationDesc) { |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2126 |
List<Content> list = getAnnotations(0, |
10 | 2127 |
new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()}, |
2128 |
false); |
|
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2129 |
ContentBuilder buf = new ContentBuilder(); |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2130 |
for (Content c: list) { |
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2131 |
buf.addContent(c); |
10 | 2132 |
} |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2133 |
return buf; |
10 | 2134 |
} else if (annotationValue.value() instanceof MemberDoc) { |
17558
eee4ccf66cfd
8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents:
17547
diff
changeset
|
2135 |
return getDocLink(LinkInfoImpl.Kind.ANNOTATION, |
10 | 2136 |
(MemberDoc) annotationValue.value(), |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2137 |
((MemberDoc) annotationValue.value()).name(), false); |
10 | 2138 |
} else { |
17570
78512b2899db
8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents:
17569
diff
changeset
|
2139 |
return new StringContent(annotationValue.toString()); |
10 | 2140 |
} |
2141 |
} |
|
2142 |
||
2143 |
/** |
|
2144 |
* Return the configuation for this doclet. |
|
2145 |
* |
|
2146 |
* @return the configuration for this doclet. |
|
2147 |
*/ |
|
2148 |
public Configuration configuration() { |
|
2149 |
return configuration; |
|
2150 |
} |
|
2151 |
} |