author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 45599 | langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java@8bc3a019f948 |
child 47272 | e0d686cdf608 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
45599 | 2 |
* Copyright (c) 2003, 2017, 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 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
31 |
import jdk.javadoc.internal.doclets.toolkit.ClassWriter; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
32 |
import jdk.javadoc.internal.doclets.toolkit.Content; |
40587 | 33 |
import jdk.javadoc.internal.doclets.toolkit.DocletException; |
34 |
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
35 |
import jdk.javadoc.internal.doclets.toolkit.util.Utils; |
10 | 36 |
|
37 |
/** |
|
38 |
* Builds the summary for a given class. |
|
39 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
40 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
41 |
* 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
|
42 |
* 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
|
43 |
* deletion without notice.</b> |
10 | 44 |
* |
45 |
* @author Jamie Ho |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
46 |
* @author Bhavesh Patel (Modified) |
10 | 47 |
*/ |
48 |
public class ClassBuilder extends AbstractBuilder { |
|
49 |
||
50 |
/** |
|
51 |
* The class being documented. |
|
52 |
*/ |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
53 |
private final TypeElement typeElement; |
10 | 54 |
|
55 |
/** |
|
56 |
* The doclet specific writer. |
|
57 |
*/ |
|
14542 | 58 |
private final ClassWriter writer; |
10 | 59 |
|
60 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
61 |
* Keep track of whether or not this typeElement is an interface. |
10 | 62 |
*/ |
14542 | 63 |
private final boolean isInterface; |
10 | 64 |
|
65 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
66 |
* Keep track of whether or not this typeElement is an enum. |
10 | 67 |
*/ |
14542 | 68 |
private final boolean isEnum; |
10 | 69 |
|
70 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
71 |
* The content tree for the class documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
72 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
73 |
private Content contentTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
74 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
75 |
private final Utils utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
76 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
77 |
/** |
10 | 78 |
* Construct a new ClassBuilder. |
79 |
* |
|
14542 | 80 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
81 |
* @param typeElement the class being documented. |
14542 | 82 |
* @param writer the doclet specific writer. |
10 | 83 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
84 |
private ClassBuilder(Context context, TypeElement typeElement, ClassWriter writer) { |
14542 | 85 |
super(context); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
this.typeElement = typeElement; |
14542 | 87 |
this.writer = writer; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
88 |
this.utils = configuration.utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
89 |
if (utils.isInterface(typeElement)) { |
14542 | 90 |
isInterface = true; |
91 |
isEnum = false; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
92 |
} else if (utils.isEnum(typeElement)) { |
14542 | 93 |
isInterface = false; |
94 |
isEnum = true; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
95 |
utils.setEnumDocumentation(typeElement); |
14542 | 96 |
} else { |
97 |
isInterface = false; |
|
98 |
isEnum = false; |
|
99 |
} |
|
10 | 100 |
} |
101 |
||
102 |
/** |
|
40587 | 103 |
* Constructs a new ClassBuilder. |
10 | 104 |
* |
14542 | 105 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
106 |
* @param typeElement the class being documented. |
10 | 107 |
* @param writer the doclet specific writer. |
40587 | 108 |
* @return the new ClassBuilder |
10 | 109 |
*/ |
45599 | 110 |
public static ClassBuilder getInstance(Context context, TypeElement typeElement, ClassWriter writer) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
111 |
return new ClassBuilder(context, typeElement, writer); |
10 | 112 |
} |
113 |
||
114 |
/** |
|
115 |
* {@inheritDoc} |
|
116 |
*/ |
|
40587 | 117 |
@Override |
118 |
public void build() throws DocletException { |
|
45599 | 119 |
buildClassDoc(contentTree); |
10 | 120 |
} |
121 |
||
122 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
123 |
* Handles the {@literal <TypeElement>} tag. |
10 | 124 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
125 |
* @param contentTree the content tree to which the documentation will be added |
45599 | 126 |
* @throws DocletException if there is a problem while building the documentation |
10 | 127 |
*/ |
45599 | 128 |
protected void buildClassDoc(Content contentTree) throws DocletException { |
129 |
String key; |
|
130 |
if (isInterface) { |
|
131 |
key = "doclet.Interface"; |
|
132 |
} else if (isEnum) { |
|
133 |
key = "doclet.Enum"; |
|
134 |
} else { |
|
135 |
key = "doclet.Class"; |
|
136 |
} |
|
137 |
contentTree = writer.getHeader(configuration.getText(key) + " " |
|
138 |
+ utils.getSimpleName(typeElement)); |
|
139 |
Content classContentTree = writer.getClassContentHeader(); |
|
140 |
||
141 |
buildClassTree(classContentTree); |
|
142 |
buildClassInfo(classContentTree); |
|
143 |
buildMemberSummary(classContentTree); |
|
144 |
buildMemberDetails(classContentTree); |
|
145 |
||
146 |
writer.addClassContentTree(contentTree, classContentTree); |
|
147 |
writer.addFooter(contentTree); |
|
148 |
writer.printDocument(contentTree); |
|
149 |
copyDocFiles(); |
|
150 |
} |
|
10 | 151 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
152 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
153 |
* Build the class tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
154 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
155 |
* @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
|
156 |
*/ |
45599 | 157 |
protected void buildClassTree(Content classContentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
158 |
writer.addClassTree(classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
159 |
} |
10 | 160 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
161 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
162 |
* Build the class information tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
163 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
164 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 165 |
* @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
|
166 |
*/ |
45599 | 167 |
protected void buildClassInfo(Content classContentTree) throws DocletException { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
168 |
Content classInfoTree = writer.getClassInfoTreeHeader(); |
45599 | 169 |
|
170 |
buildTypeParamInfo(classInfoTree); |
|
171 |
buildSuperInterfacesInfo(classInfoTree); |
|
172 |
buildImplementedInterfacesInfo(classInfoTree); |
|
173 |
buildSubClassInfo(classInfoTree); |
|
174 |
buildSubInterfacesInfo(classInfoTree); |
|
175 |
buildInterfaceUsageInfo(classInfoTree); |
|
176 |
buildNestedClassInfo(classInfoTree); |
|
177 |
buildFunctionalInterfaceInfo(classInfoTree); |
|
178 |
buildDeprecationInfo(classInfoTree); |
|
179 |
buildClassSignature(classInfoTree); |
|
180 |
buildClassDescription(classInfoTree); |
|
181 |
buildClassTagInfo(classInfoTree); |
|
182 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
183 |
classContentTree.addContent(writer.getClassInfo(classInfoTree)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
184 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
185 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
186 |
/** |
40587 | 187 |
* 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
|
188 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
189 |
* @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
|
190 |
*/ |
45599 | 191 |
protected void buildTypeParamInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
192 |
writer.addTypeParamInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
193 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
194 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
195 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
196 |
* 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
|
197 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
198 |
* @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
|
199 |
*/ |
45599 | 200 |
protected void buildSuperInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
201 |
writer.addSuperInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
202 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
203 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
204 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
205 |
* 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
|
206 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
207 |
* @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
|
208 |
*/ |
45599 | 209 |
protected void buildImplementedInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
210 |
writer.addImplementedInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
211 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
212 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
213 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
214 |
* 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
|
215 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
216 |
* @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
|
217 |
*/ |
45599 | 218 |
protected void buildSubClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
219 |
writer.addSubClassInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
220 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
221 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
222 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
223 |
* 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
|
224 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
225 |
* @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
|
226 |
*/ |
45599 | 227 |
protected void buildSubInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
228 |
writer.addSubInterfacesInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
229 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
230 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
231 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
232 |
* 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
|
233 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
234 |
* @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
|
235 |
*/ |
45599 | 236 |
protected void buildInterfaceUsageInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
237 |
writer.addInterfaceUsageInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
238 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
239 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
240 |
/** |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
241 |
* 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
|
242 |
* |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
243 |
* @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
|
244 |
*/ |
45599 | 245 |
protected void buildFunctionalInterfaceInfo(Content classInfoTree) { |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
246 |
writer.addFunctionalInterfaceInfo(classInfoTree); |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
247 |
} |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
248 |
|
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
249 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
250 |
* 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
|
251 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
252 |
* @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
|
253 |
*/ |
45599 | 254 |
protected void buildDeprecationInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
255 |
writer.addClassDeprecationInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
256 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
257 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
258 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
259 |
* 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
|
260 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
261 |
* @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
|
262 |
*/ |
45599 | 263 |
protected void buildNestedClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
264 |
writer.addNestedClassInfo(classInfoTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
265 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
266 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
267 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
268 |
* Copy the doc files. |
40587 | 269 |
* |
270 |
* @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
|
271 |
*/ |
40587 | 272 |
private void copyDocFiles() throws DocFileIOException { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
273 |
PackageElement containingPackage = utils.containingPackage(typeElement); |
45599 | 274 |
if ((configuration.packages == null || |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
275 |
!configuration.packages.contains(containingPackage)) && |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
276 |
!containingPackagesSeen.contains(containingPackage)) { |
10 | 277 |
//Only copy doc files dir if the containing package is not |
278 |
//documented AND if we have not documented a class from the same |
|
279 |
//package already. Otherwise, we are making duplicate copies. |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
280 |
utils.copyDocFiles(containingPackage); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
281 |
containingPackagesSeen.add(containingPackage); |
10 | 282 |
} |
283 |
} |
|
284 |
||
285 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
286 |
* 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
|
287 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
288 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 289 |
*/ |
45599 | 290 |
protected void buildClassSignature(Content classInfoTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
291 |
writer.addClassSignature(utils.modifiersToString(typeElement, true), classInfoTree); |
10 | 292 |
} |
293 |
||
294 |
/** |
|
295 |
* Build the class description. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
296 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
297 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 298 |
*/ |
45599 | 299 |
protected void buildClassDescription(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
300 |
writer.addClassDescription(classInfoTree); |
10 | 301 |
} |
302 |
||
303 |
/** |
|
304 |
* 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
|
305 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
306 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 307 |
*/ |
45599 | 308 |
protected void buildClassTagInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
309 |
writer.addClassTagInfo(classInfoTree); |
10 | 310 |
} |
311 |
||
312 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
313 |
* Build the member summary contents of the page. |
10 | 314 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
315 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 316 |
* @throws DocletException if there is a problem while building the documentation |
10 | 317 |
*/ |
45599 | 318 |
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
|
319 |
Content memberSummaryTree = writer.getMemberTreeHeader(); |
45599 | 320 |
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
321 |
classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); |
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 |
|
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 |
* 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
|
326 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
327 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 328 |
* @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
|
329 |
*/ |
45599 | 330 |
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
|
331 |
Content memberDetailsTree = writer.getMemberTreeHeader(); |
45599 | 332 |
|
333 |
buildEnumConstantsDetails(memberDetailsTree); |
|
334 |
buildPropertyDetails(memberDetailsTree); |
|
335 |
buildFieldDetails(memberDetailsTree); |
|
336 |
buildConstructorDetails(memberDetailsTree); |
|
337 |
buildMethodDetails(memberDetailsTree); |
|
338 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
339 |
classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); |
10 | 340 |
} |
341 |
||
342 |
/** |
|
343 |
* Build the enum constants documentation. |
|
344 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
345 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 346 |
* @throws DocletException if there is a problem while building the documentation |
10 | 347 |
*/ |
45599 | 348 |
protected void buildEnumConstantsDetails(Content memberDetailsTree) throws DocletException { |
349 |
builderFactory.getEnumConstantsBuilder(writer).build(memberDetailsTree); |
|
10 | 350 |
} |
351 |
||
352 |
/** |
|
353 |
* Build the field documentation. |
|
354 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
355 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 356 |
* @throws DocletException if there is a problem while building the documentation |
10 | 357 |
*/ |
45599 | 358 |
protected void buildFieldDetails(Content memberDetailsTree) throws DocletException { |
359 |
builderFactory.getFieldBuilder(writer).build(memberDetailsTree); |
|
10 | 360 |
} |
361 |
||
362 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
363 |
* Build the property documentation. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
364 |
* |
40587 | 365 |
* @param memberDetailsTree the content tree to which the documentation will be added |
366 |
* @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
|
367 |
*/ |
45599 | 368 |
public void buildPropertyDetails( Content memberDetailsTree) throws DocletException { |
369 |
builderFactory.getPropertyBuilder(writer).build(memberDetailsTree); |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
370 |
} |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
371 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
372 |
/** |
10 | 373 |
* Build the constructor documentation. |
374 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
375 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 376 |
* @throws DocletException if there is a problem while building the documentation |
10 | 377 |
*/ |
45599 | 378 |
protected void buildConstructorDetails(Content memberDetailsTree) throws DocletException { |
379 |
builderFactory.getConstructorBuilder(writer).build(memberDetailsTree); |
|
10 | 380 |
} |
381 |
||
382 |
/** |
|
383 |
* Build the method documentation. |
|
384 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
385 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 386 |
* @throws DocletException if there is a problem while building the documentation |
10 | 387 |
*/ |
45599 | 388 |
protected void buildMethodDetails(Content memberDetailsTree) throws DocletException { |
389 |
builderFactory.getMethodBuilder(writer).build(memberDetailsTree); |
|
10 | 390 |
} |
391 |
} |