author | hannesw |
Wed, 27 Nov 2019 13:08:16 +0100 | |
changeset 59294 | 48b88b9c11eb |
parent 54596 | 86c1da00dd6a |
permissions | -rw-r--r-- |
10 | 1 |
/* |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
2 |
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
26 |
package jdk.javadoc.internal.doclets.toolkit.builders; |
10 | 27 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
28 |
import javax.lang.model.element.PackageElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
29 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
30 |
|
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
31 |
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import jdk.javadoc.internal.doclets.toolkit.ClassWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
33 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
34 |
import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler; |
40587 | 35 |
import jdk.javadoc.internal.doclets.toolkit.DocletException; |
36 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
37 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
10 | 38 |
|
39 |
/** |
|
40 |
* Builds the summary for a given class. |
|
41 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
42 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
43 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
44 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
45 |
* deletion without notice.</b> |
10 | 46 |
* |
47 |
* @author Jamie Ho |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
48 |
* @author Bhavesh Patel (Modified) |
10 | 49 |
*/ |
50 |
public class ClassBuilder extends AbstractBuilder { |
|
51 |
||
52 |
/** |
|
53 |
* The class being documented. |
|
54 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
55 |
private final TypeElement typeElement; |
10 | 56 |
|
57 |
/** |
|
58 |
* The doclet specific writer. |
|
59 |
*/ |
|
14542 | 60 |
private final ClassWriter writer; |
10 | 61 |
|
62 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
63 |
* Keep track of whether or not this typeElement is an interface. |
10 | 64 |
*/ |
14542 | 65 |
private final boolean isInterface; |
10 | 66 |
|
67 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
68 |
* Keep track of whether or not this typeElement is an enum. |
10 | 69 |
*/ |
14542 | 70 |
private final boolean isEnum; |
10 | 71 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
72 |
private final Utils utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
73 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
74 |
/** |
10 | 75 |
* Construct a new ClassBuilder. |
76 |
* |
|
14542 | 77 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
* @param typeElement the class being documented. |
14542 | 79 |
* @param writer the doclet specific writer. |
10 | 80 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
81 |
private ClassBuilder(Context context, TypeElement typeElement, ClassWriter writer) { |
14542 | 82 |
super(context); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
this.typeElement = typeElement; |
14542 | 84 |
this.writer = writer; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
85 |
this.utils = configuration.utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
if (utils.isInterface(typeElement)) { |
14542 | 87 |
isInterface = true; |
88 |
isEnum = false; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
89 |
} else if (utils.isEnum(typeElement)) { |
14542 | 90 |
isInterface = false; |
91 |
isEnum = true; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
92 |
utils.setEnumDocumentation(typeElement); |
14542 | 93 |
} else { |
94 |
isInterface = false; |
|
95 |
isEnum = false; |
|
96 |
} |
|
10 | 97 |
} |
98 |
||
99 |
/** |
|
40587 | 100 |
* Constructs a new ClassBuilder. |
10 | 101 |
* |
14542 | 102 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
103 |
* @param typeElement the class being documented. |
10 | 104 |
* @param writer the doclet specific writer. |
40587 | 105 |
* @return the new ClassBuilder |
10 | 106 |
*/ |
45599 | 107 |
public static ClassBuilder getInstance(Context context, TypeElement typeElement, ClassWriter writer) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
108 |
return new ClassBuilder(context, typeElement, writer); |
10 | 109 |
} |
110 |
||
111 |
/** |
|
112 |
* {@inheritDoc} |
|
113 |
*/ |
|
40587 | 114 |
@Override |
115 |
public void build() throws DocletException { |
|
59294
48b88b9c11eb
8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents:
54596
diff
changeset
|
116 |
buildClassDoc(); |
10 | 117 |
} |
118 |
||
119 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
120 |
* Handles the {@literal <TypeElement>} tag. |
10 | 121 |
* |
45599 | 122 |
* @throws DocletException if there is a problem while building the documentation |
10 | 123 |
*/ |
59294
48b88b9c11eb
8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents:
54596
diff
changeset
|
124 |
protected void buildClassDoc() throws DocletException { |
45599 | 125 |
String key; |
126 |
if (isInterface) { |
|
127 |
key = "doclet.Interface"; |
|
128 |
} else if (isEnum) { |
|
129 |
key = "doclet.Enum"; |
|
130 |
} else { |
|
131 |
key = "doclet.Class"; |
|
132 |
} |
|
59294
48b88b9c11eb
8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents:
54596
diff
changeset
|
133 |
Content contentTree = writer.getHeader(resources.getText(key) + " " |
45599 | 134 |
+ utils.getSimpleName(typeElement)); |
135 |
Content classContentTree = writer.getClassContentHeader(); |
|
136 |
||
137 |
buildClassTree(classContentTree); |
|
138 |
buildClassInfo(classContentTree); |
|
139 |
buildMemberSummary(classContentTree); |
|
140 |
buildMemberDetails(classContentTree); |
|
141 |
||
59294
48b88b9c11eb
8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents:
54596
diff
changeset
|
142 |
writer.addClassContentTree(classContentTree); |
48b88b9c11eb
8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents:
54596
diff
changeset
|
143 |
writer.addFooter(); |
45599 | 144 |
writer.printDocument(contentTree); |
145 |
copyDocFiles(); |
|
146 |
} |
|
10 | 147 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
148 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
149 |
* Build the class tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
150 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
151 |
* @param classContentTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
152 |
*/ |
45599 | 153 |
protected void buildClassTree(Content classContentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
154 |
writer.addClassTree(classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
155 |
} |
10 | 156 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
157 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
158 |
* Build the class information tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
159 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
160 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 161 |
* @throws DocletException if there is a problem while building the documentation |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
162 |
*/ |
45599 | 163 |
protected void buildClassInfo(Content classContentTree) throws DocletException { |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
164 |
Content classInfoTree = new ContentBuilder(); |
45599 | 165 |
buildTypeParamInfo(classInfoTree); |
166 |
buildSuperInterfacesInfo(classInfoTree); |
|
167 |
buildImplementedInterfacesInfo(classInfoTree); |
|
168 |
buildSubClassInfo(classInfoTree); |
|
169 |
buildSubInterfacesInfo(classInfoTree); |
|
170 |
buildInterfaceUsageInfo(classInfoTree); |
|
171 |
buildNestedClassInfo(classInfoTree); |
|
172 |
buildFunctionalInterfaceInfo(classInfoTree); |
|
47272 | 173 |
buildClassSignature(classInfoTree); |
45599 | 174 |
buildDeprecationInfo(classInfoTree); |
175 |
buildClassDescription(classInfoTree); |
|
176 |
buildClassTagInfo(classInfoTree); |
|
177 |
||
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
178 |
classContentTree.add(writer.getClassInfo(classInfoTree)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
179 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
180 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
181 |
/** |
40587 | 182 |
* Build the type parameters of this class. |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
183 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
184 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
185 |
*/ |
45599 | 186 |
protected void buildTypeParamInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
187 |
writer.addTypeParamInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
188 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
189 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
190 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
191 |
* If this is an interface, list all super interfaces. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
192 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
193 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
194 |
*/ |
45599 | 195 |
protected void buildSuperInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
196 |
writer.addSuperInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
197 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
198 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
199 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
200 |
* If this is a class, list all interfaces implemented by this class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
201 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
202 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
203 |
*/ |
45599 | 204 |
protected void buildImplementedInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
205 |
writer.addImplementedInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
206 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
207 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
208 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
209 |
* List all the classes extend this one. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
210 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
211 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
212 |
*/ |
45599 | 213 |
protected void buildSubClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
214 |
writer.addSubClassInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
215 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
216 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
217 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
218 |
* List all the interfaces that extend this one. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
219 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
220 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
221 |
*/ |
45599 | 222 |
protected void buildSubInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
223 |
writer.addSubInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
224 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
225 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
226 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
227 |
* If this is an interface, list all classes that implement this interface. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
228 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
229 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
230 |
*/ |
45599 | 231 |
protected void buildInterfaceUsageInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
232 |
writer.addInterfaceUsageInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
233 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
234 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
235 |
/** |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
236 |
* If this is an functional interface, display appropriate message. |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
237 |
* |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
238 |
* @param classInfoTree the content tree to which the documentation will be added |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
239 |
*/ |
45599 | 240 |
protected void buildFunctionalInterfaceInfo(Content classInfoTree) { |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
241 |
writer.addFunctionalInterfaceInfo(classInfoTree); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
242 |
} |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
243 |
|
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
244 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
245 |
* If this class is deprecated, build the appropriate information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
246 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
247 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
248 |
*/ |
45599 | 249 |
protected void buildDeprecationInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
250 |
writer.addClassDeprecationInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
251 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
252 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
253 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
254 |
* If this is an inner class or interface, list the enclosing class or interface. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
255 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
256 |
* @param classInfoTree the content tree to which the documentation will be added |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
257 |
*/ |
45599 | 258 |
protected void buildNestedClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
259 |
writer.addNestedClassInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
260 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
261 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
262 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
263 |
* Copy the doc files. |
40587 | 264 |
* |
265 |
* @throws DocFileIOException if there is a problem while copying the files |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
266 |
*/ |
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
267 |
private void copyDocFiles() throws DocletException { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
268 |
PackageElement containingPackage = utils.containingPackage(typeElement); |
45599 | 269 |
if ((configuration.packages == null || |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
270 |
!configuration.packages.contains(containingPackage)) && |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
271 |
!containingPackagesSeen.contains(containingPackage)) { |
10 | 272 |
//Only copy doc files dir if the containing package is not |
273 |
//documented AND if we have not documented a class from the same |
|
274 |
//package already. Otherwise, we are making duplicate copies. |
|
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
275 |
DocFilesHandler docFilesHandler = configuration |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
276 |
.getWriterFactory() |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
277 |
.getDocFilesHandler(containingPackage); |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
278 |
docFilesHandler.copyDocFiles(); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
279 |
containingPackagesSeen.add(containingPackage); |
10 | 280 |
} |
281 |
} |
|
282 |
||
283 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
284 |
* Build the signature of the current class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
285 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
286 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 287 |
*/ |
45599 | 288 |
protected void buildClassSignature(Content classInfoTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
289 |
writer.addClassSignature(utils.modifiersToString(typeElement, true), classInfoTree); |
10 | 290 |
} |
291 |
||
292 |
/** |
|
293 |
* Build the class description. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
294 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
295 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 296 |
*/ |
45599 | 297 |
protected void buildClassDescription(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
298 |
writer.addClassDescription(classInfoTree); |
10 | 299 |
} |
300 |
||
301 |
/** |
|
302 |
* Build the tag information for the current class. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
303 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
304 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 305 |
*/ |
45599 | 306 |
protected void buildClassTagInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
307 |
writer.addClassTagInfo(classInfoTree); |
10 | 308 |
} |
309 |
||
310 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
311 |
* Build the member summary contents of the page. |
10 | 312 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
313 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 314 |
* @throws DocletException if there is a problem while building the documentation |
10 | 315 |
*/ |
45599 | 316 |
protected void buildMemberSummary(Content classContentTree) throws DocletException { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
317 |
Content memberSummaryTree = writer.getMemberTreeHeader(); |
45599 | 318 |
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
319 |
classContentTree.add(writer.getMemberSummaryTree(memberSummaryTree)); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
320 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
321 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
322 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
323 |
* Build the member details contents of the page. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
324 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
325 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 326 |
* @throws DocletException if there is a problem while building the documentation |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
327 |
*/ |
45599 | 328 |
protected void buildMemberDetails(Content classContentTree) throws DocletException { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
329 |
Content memberDetailsTree = writer.getMemberTreeHeader(); |
45599 | 330 |
|
331 |
buildEnumConstantsDetails(memberDetailsTree); |
|
332 |
buildPropertyDetails(memberDetailsTree); |
|
333 |
buildFieldDetails(memberDetailsTree); |
|
334 |
buildConstructorDetails(memberDetailsTree); |
|
335 |
buildMethodDetails(memberDetailsTree); |
|
336 |
||
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
337 |
classContentTree.add(writer.getMemberDetailsTree(memberDetailsTree)); |
10 | 338 |
} |
339 |
||
340 |
/** |
|
341 |
* Build the enum constants documentation. |
|
342 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
343 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 344 |
* @throws DocletException if there is a problem while building the documentation |
10 | 345 |
*/ |
45599 | 346 |
protected void buildEnumConstantsDetails(Content memberDetailsTree) throws DocletException { |
347 |
builderFactory.getEnumConstantsBuilder(writer).build(memberDetailsTree); |
|
10 | 348 |
} |
349 |
||
350 |
/** |
|
351 |
* Build the field documentation. |
|
352 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
353 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 354 |
* @throws DocletException if there is a problem while building the documentation |
10 | 355 |
*/ |
45599 | 356 |
protected void buildFieldDetails(Content memberDetailsTree) throws DocletException { |
357 |
builderFactory.getFieldBuilder(writer).build(memberDetailsTree); |
|
10 | 358 |
} |
359 |
||
360 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
361 |
* Build the property documentation. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
362 |
* |
40587 | 363 |
* @param memberDetailsTree the content tree to which the documentation will be added |
364 |
* @throws DocletException if there is a problem while building the documentation |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
365 |
*/ |
45599 | 366 |
public void buildPropertyDetails( Content memberDetailsTree) throws DocletException { |
367 |
builderFactory.getPropertyBuilder(writer).build(memberDetailsTree); |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
368 |
} |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
369 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
370 |
/** |
10 | 371 |
* Build the constructor documentation. |
372 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
373 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 374 |
* @throws DocletException if there is a problem while building the documentation |
10 | 375 |
*/ |
45599 | 376 |
protected void buildConstructorDetails(Content memberDetailsTree) throws DocletException { |
377 |
builderFactory.getConstructorBuilder(writer).build(memberDetailsTree); |
|
10 | 378 |
} |
379 |
||
380 |
/** |
|
381 |
* Build the method documentation. |
|
382 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
383 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 384 |
* @throws DocletException if there is a problem while building the documentation |
10 | 385 |
*/ |
45599 | 386 |
protected void buildMethodDetails(Content memberDetailsTree) throws DocletException { |
387 |
builderFactory.getMethodBuilder(writer).build(memberDetailsTree); |
|
10 | 388 |
} |
389 |
} |