author | pmuthuswamy |
Tue, 23 Apr 2019 18:28:48 +0530 | |
changeset 54596 | 86c1da00dd6a |
parent 54060 | 53a95878619f |
child 59294 | 48b88b9c11eb |
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 |
|
72 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
73 |
* 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
|
74 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
75 |
private Content contentTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
76 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
77 |
private final Utils utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
78 |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
79 |
/** |
10 | 80 |
* Construct a new ClassBuilder. |
81 |
* |
|
14542 | 82 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
83 |
* @param typeElement the class being documented. |
14542 | 84 |
* @param writer the doclet specific writer. |
10 | 85 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
86 |
private ClassBuilder(Context context, TypeElement typeElement, ClassWriter writer) { |
14542 | 87 |
super(context); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
88 |
this.typeElement = typeElement; |
14542 | 89 |
this.writer = writer; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
90 |
this.utils = configuration.utils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
91 |
if (utils.isInterface(typeElement)) { |
14542 | 92 |
isInterface = true; |
93 |
isEnum = false; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
94 |
} else if (utils.isEnum(typeElement)) { |
14542 | 95 |
isInterface = false; |
96 |
isEnum = true; |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
97 |
utils.setEnumDocumentation(typeElement); |
14542 | 98 |
} else { |
99 |
isInterface = false; |
|
100 |
isEnum = false; |
|
101 |
} |
|
10 | 102 |
} |
103 |
||
104 |
/** |
|
40587 | 105 |
* Constructs a new ClassBuilder. |
10 | 106 |
* |
14542 | 107 |
* @param context the build context |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
108 |
* @param typeElement the class being documented. |
10 | 109 |
* @param writer the doclet specific writer. |
40587 | 110 |
* @return the new ClassBuilder |
10 | 111 |
*/ |
45599 | 112 |
public static ClassBuilder getInstance(Context context, TypeElement typeElement, ClassWriter writer) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
113 |
return new ClassBuilder(context, typeElement, writer); |
10 | 114 |
} |
115 |
||
116 |
/** |
|
117 |
* {@inheritDoc} |
|
118 |
*/ |
|
40587 | 119 |
@Override |
120 |
public void build() throws DocletException { |
|
45599 | 121 |
buildClassDoc(contentTree); |
10 | 122 |
} |
123 |
||
124 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
125 |
* Handles the {@literal <TypeElement>} tag. |
10 | 126 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
127 |
* @param contentTree the content tree to which the documentation will be added |
45599 | 128 |
* @throws DocletException if there is a problem while building the documentation |
10 | 129 |
*/ |
45599 | 130 |
protected void buildClassDoc(Content contentTree) throws DocletException { |
131 |
String key; |
|
132 |
if (isInterface) { |
|
133 |
key = "doclet.Interface"; |
|
134 |
} else if (isEnum) { |
|
135 |
key = "doclet.Enum"; |
|
136 |
} else { |
|
137 |
key = "doclet.Class"; |
|
138 |
} |
|
52644
43efb4ca6d6c
8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents:
48029
diff
changeset
|
139 |
contentTree = writer.getHeader(resources.getText(key) + " " |
45599 | 140 |
+ utils.getSimpleName(typeElement)); |
141 |
Content classContentTree = writer.getClassContentHeader(); |
|
142 |
||
143 |
buildClassTree(classContentTree); |
|
144 |
buildClassInfo(classContentTree); |
|
145 |
buildMemberSummary(classContentTree); |
|
146 |
buildMemberDetails(classContentTree); |
|
147 |
||
148 |
writer.addClassContentTree(contentTree, classContentTree); |
|
149 |
writer.addFooter(contentTree); |
|
150 |
writer.printDocument(contentTree); |
|
151 |
copyDocFiles(); |
|
152 |
} |
|
10 | 153 |
|
7614
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 |
* Build the class tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
156 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
157 |
* @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
|
158 |
*/ |
45599 | 159 |
protected void buildClassTree(Content classContentTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
160 |
writer.addClassTree(classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
161 |
} |
10 | 162 |
|
7614
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 |
* Build the class information tree documentation. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
165 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
166 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 167 |
* @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
|
168 |
*/ |
45599 | 169 |
protected void buildClassInfo(Content classContentTree) throws DocletException { |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
54060
diff
changeset
|
170 |
Content classInfoTree = new ContentBuilder(); |
45599 | 171 |
buildTypeParamInfo(classInfoTree); |
172 |
buildSuperInterfacesInfo(classInfoTree); |
|
173 |
buildImplementedInterfacesInfo(classInfoTree); |
|
174 |
buildSubClassInfo(classInfoTree); |
|
175 |
buildSubInterfacesInfo(classInfoTree); |
|
176 |
buildInterfaceUsageInfo(classInfoTree); |
|
177 |
buildNestedClassInfo(classInfoTree); |
|
178 |
buildFunctionalInterfaceInfo(classInfoTree); |
|
47272 | 179 |
buildClassSignature(classInfoTree); |
45599 | 180 |
buildDeprecationInfo(classInfoTree); |
181 |
buildClassDescription(classInfoTree); |
|
182 |
buildClassTagInfo(classInfoTree); |
|
183 |
||
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
184 |
classContentTree.add(writer.getClassInfo(classInfoTree)); |
7614
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
187 |
/** |
40587 | 188 |
* 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
|
189 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
190 |
* @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
|
191 |
*/ |
45599 | 192 |
protected void buildTypeParamInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
193 |
writer.addTypeParamInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
197 |
* 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
|
198 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
199 |
* @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
|
200 |
*/ |
45599 | 201 |
protected void buildSuperInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
202 |
writer.addSuperInterfacesInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
206 |
* 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
|
207 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
208 |
* @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
|
209 |
*/ |
45599 | 210 |
protected void buildImplementedInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
211 |
writer.addImplementedInterfacesInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
215 |
* 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
|
216 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
217 |
* @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
|
218 |
*/ |
45599 | 219 |
protected void buildSubClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
220 |
writer.addSubClassInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
224 |
* 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
|
225 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
226 |
* @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
|
227 |
*/ |
45599 | 228 |
protected void buildSubInterfacesInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
229 |
writer.addSubInterfacesInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
233 |
* 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
|
234 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
235 |
* @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
|
236 |
*/ |
45599 | 237 |
protected void buildInterfaceUsageInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
238 |
writer.addInterfaceUsageInfo(classInfoTree); |
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
241 |
/** |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
242 |
* 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
|
243 |
* |
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
244 |
* @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
|
245 |
*/ |
45599 | 246 |
protected void buildFunctionalInterfaceInfo(Content classInfoTree) { |
14965
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
247 |
writer.addFunctionalInterfaceInfo(classInfoTree); |
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 |
|
bb1eb01b8c41
8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
14542
diff
changeset
|
250 |
/** |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
251 |
* 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
|
252 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
253 |
* @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
|
254 |
*/ |
45599 | 255 |
protected void buildDeprecationInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
256 |
writer.addClassDeprecationInfo(classInfoTree); |
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 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
260 |
* 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
|
261 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
262 |
* @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
|
263 |
*/ |
45599 | 264 |
protected void buildNestedClassInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
265 |
writer.addNestedClassInfo(classInfoTree); |
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
268 |
/** |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
269 |
* Copy the doc files. |
40587 | 270 |
* |
271 |
* @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
|
272 |
*/ |
48029
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
273 |
private void copyDocFiles() throws DocletException { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
274 |
PackageElement containingPackage = utils.containingPackage(typeElement); |
45599 | 275 |
if ((configuration.packages == null || |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
276 |
!configuration.packages.contains(containingPackage)) && |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
277 |
!containingPackagesSeen.contains(containingPackage)) { |
10 | 278 |
//Only copy doc files dir if the containing package is not |
279 |
//documented AND if we have not documented a class from the same |
|
280 |
//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
|
281 |
DocFilesHandler docFilesHandler = configuration |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
282 |
.getWriterFactory() |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
283 |
.getDocFilesHandler(containingPackage); |
e9dab2492924
8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents:
47272
diff
changeset
|
284 |
docFilesHandler.copyDocFiles(); |
24221
2376793dd33b
8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents:
18651
diff
changeset
|
285 |
containingPackagesSeen.add(containingPackage); |
10 | 286 |
} |
287 |
} |
|
288 |
||
289 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
290 |
* 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
|
291 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
292 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 293 |
*/ |
45599 | 294 |
protected void buildClassSignature(Content classInfoTree) { |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
29957
diff
changeset
|
295 |
writer.addClassSignature(utils.modifiersToString(typeElement, true), classInfoTree); |
10 | 296 |
} |
297 |
||
298 |
/** |
|
299 |
* Build the class description. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
300 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
301 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 302 |
*/ |
45599 | 303 |
protected void buildClassDescription(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
304 |
writer.addClassDescription(classInfoTree); |
10 | 305 |
} |
306 |
||
307 |
/** |
|
308 |
* 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
|
309 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
310 |
* @param classInfoTree the content tree to which the documentation will be added |
10 | 311 |
*/ |
45599 | 312 |
protected void buildClassTagInfo(Content classInfoTree) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
313 |
writer.addClassTagInfo(classInfoTree); |
10 | 314 |
} |
315 |
||
316 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
317 |
* Build the member summary contents of the page. |
10 | 318 |
* |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
319 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 320 |
* @throws DocletException if there is a problem while building the documentation |
10 | 321 |
*/ |
45599 | 322 |
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
|
323 |
Content memberSummaryTree = writer.getMemberTreeHeader(); |
45599 | 324 |
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree); |
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
325 |
classContentTree.add(writer.getMemberSummaryTree(memberSummaryTree)); |
7614
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 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
328 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
329 |
* 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
|
330 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
331 |
* @param classContentTree the content tree to which the documentation will be added |
40587 | 332 |
* @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
|
333 |
*/ |
45599 | 334 |
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
|
335 |
Content memberDetailsTree = writer.getMemberTreeHeader(); |
45599 | 336 |
|
337 |
buildEnumConstantsDetails(memberDetailsTree); |
|
338 |
buildPropertyDetails(memberDetailsTree); |
|
339 |
buildFieldDetails(memberDetailsTree); |
|
340 |
buildConstructorDetails(memberDetailsTree); |
|
341 |
buildMethodDetails(memberDetailsTree); |
|
342 |
||
54060
53a95878619f
8220202: Simplify/standardize method naming for HtmlTree
jjg
parents:
52644
diff
changeset
|
343 |
classContentTree.add(writer.getMemberDetailsTree(memberDetailsTree)); |
10 | 344 |
} |
345 |
||
346 |
/** |
|
347 |
* Build the enum constants documentation. |
|
348 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
349 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 350 |
* @throws DocletException if there is a problem while building the documentation |
10 | 351 |
*/ |
45599 | 352 |
protected void buildEnumConstantsDetails(Content memberDetailsTree) throws DocletException { |
353 |
builderFactory.getEnumConstantsBuilder(writer).build(memberDetailsTree); |
|
10 | 354 |
} |
355 |
||
356 |
/** |
|
357 |
* Build the field documentation. |
|
358 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
359 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 360 |
* @throws DocletException if there is a problem while building the documentation |
10 | 361 |
*/ |
45599 | 362 |
protected void buildFieldDetails(Content memberDetailsTree) throws DocletException { |
363 |
builderFactory.getFieldBuilder(writer).build(memberDetailsTree); |
|
10 | 364 |
} |
365 |
||
366 |
/** |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
367 |
* Build the property documentation. |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
368 |
* |
40587 | 369 |
* @param memberDetailsTree the content tree to which the documentation will be added |
370 |
* @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
|
371 |
*/ |
45599 | 372 |
public void buildPropertyDetails( Content memberDetailsTree) throws DocletException { |
373 |
builderFactory.getPropertyBuilder(writer).build(memberDetailsTree); |
|
16319
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
374 |
} |
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
375 |
|
e586bfeb39c5
7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
14965
diff
changeset
|
376 |
/** |
10 | 377 |
* Build the constructor documentation. |
378 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
379 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 380 |
* @throws DocletException if there is a problem while building the documentation |
10 | 381 |
*/ |
45599 | 382 |
protected void buildConstructorDetails(Content memberDetailsTree) throws DocletException { |
383 |
builderFactory.getConstructorBuilder(writer).build(memberDetailsTree); |
|
10 | 384 |
} |
385 |
||
386 |
/** |
|
387 |
* Build the method documentation. |
|
388 |
* |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
389 |
* @param memberDetailsTree the content tree to which the documentation will be added |
40587 | 390 |
* @throws DocletException if there is a problem while building the documentation |
10 | 391 |
*/ |
45599 | 392 |
protected void buildMethodDetails(Content memberDetailsTree) throws DocletException { |
393 |
builderFactory.getMethodBuilder(writer).build(memberDetailsTree); |
|
10 | 394 |
} |
395 |
} |