author | jjg |
Fri, 27 May 2016 13:06:58 -0700 | |
changeset 38617 | d93a7f64e231 |
parent 29957 | 7740f9657f56 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
2 |
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.tools.doclets.internal.toolkit.builders; |
|
27 |
||
28 |
import java.io.*; |
|
29 |
import java.util.*; |
|
14258 | 30 |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
31 |
import com.sun.javadoc.*; |
14258 | 32 |
import com.sun.tools.doclets.internal.toolkit.*; |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
33 |
import com.sun.tools.doclets.internal.toolkit.util.*; |
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
19667
diff
changeset
|
34 |
import com.sun.tools.javac.util.StringUtils; |
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
35 |
|
10 | 36 |
/** |
37 |
* Builds the serialized form. |
|
38 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
39 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
40 |
* 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
|
41 |
* 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
|
42 |
* deletion without notice.</b> |
10 | 43 |
* |
44 |
* @author Jamie Ho |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
2086
diff
changeset
|
45 |
* @author Bhavesh Patel (Modified) |
10 | 46 |
* @since 1.5 |
47 |
*/ |
|
38617 | 48 |
@Deprecated |
10 | 49 |
public class SerializedFormBuilder extends AbstractBuilder { |
50 |
||
51 |
/** |
|
52 |
* The root element of the serialized form XML is {@value}. |
|
53 |
*/ |
|
54 |
public static final String NAME = "SerializedForm"; |
|
55 |
||
56 |
/** |
|
57 |
* The writer for this builder. |
|
58 |
*/ |
|
59 |
private SerializedFormWriter writer; |
|
60 |
||
61 |
/** |
|
62 |
* The writer for serializable fields. |
|
63 |
*/ |
|
64 |
private SerializedFormWriter.SerialFieldWriter fieldWriter; |
|
65 |
||
66 |
/** |
|
67 |
* The writer for serializable method documentation. |
|
68 |
*/ |
|
69 |
private SerializedFormWriter.SerialMethodWriter methodWriter; |
|
70 |
||
71 |
/** |
|
72 |
* The header for the serial version UID. Save the string |
|
73 |
* here instead of the properties file because we do not want |
|
74 |
* this string to be localized. |
|
75 |
*/ |
|
76 |
private static final String SERIAL_VERSION_UID_HEADER = "serialVersionUID:"; |
|
77 |
||
78 |
/** |
|
79 |
* The current package being documented. |
|
80 |
*/ |
|
81 |
private PackageDoc currentPackage; |
|
82 |
||
83 |
/** |
|
84 |
* The current class being documented. |
|
85 |
*/ |
|
86 |
private ClassDoc currentClass; |
|
87 |
||
88 |
/** |
|
89 |
* The current member being documented. |
|
90 |
*/ |
|
91 |
protected MemberDoc currentMember; |
|
92 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
93 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
94 |
* The content that will be added to the serialized form documentation tree. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
95 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
96 |
private Content contentTree; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
97 |
|
14542 | 98 |
|
99 |
/** |
|
100 |
* Construct a new SerializedFormBuilder. |
|
101 |
* @param context the build context. |
|
102 |
*/ |
|
103 |
private SerializedFormBuilder(Context context) { |
|
104 |
super(context); |
|
10 | 105 |
} |
106 |
||
107 |
/** |
|
108 |
* Construct a new SerializedFormBuilder. |
|
14542 | 109 |
* @param context the build context. |
10 | 110 |
*/ |
14542 | 111 |
public static SerializedFormBuilder getInstance(Context context) { |
112 |
return new SerializedFormBuilder(context); |
|
10 | 113 |
} |
114 |
||
115 |
/** |
|
116 |
* Build the serialized form. |
|
117 |
*/ |
|
118 |
public void build() throws IOException { |
|
119 |
if (! serialClassFoundToDocument(configuration.root.classes())) { |
|
120 |
//Nothing to document. |
|
121 |
return; |
|
122 |
} |
|
123 |
try { |
|
124 |
writer = configuration.getWriterFactory().getSerializedFormWriter(); |
|
125 |
if (writer == null) { |
|
126 |
//Doclet does not support this output. |
|
127 |
return; |
|
128 |
} |
|
129 |
} catch (Exception e) { |
|
19667
fdfce85627a9
8001669: javadoc internal DocletAbortException should set cause when appropriate
jjg
parents:
14542
diff
changeset
|
130 |
throw new DocletAbortException(e); |
10 | 131 |
} |
14542 | 132 |
build(layoutParser.parseXML(NAME), contentTree); |
10 | 133 |
writer.close(); |
134 |
} |
|
135 |
||
136 |
/** |
|
137 |
* {@inheritDoc} |
|
138 |
*/ |
|
139 |
public String getName() { |
|
140 |
return NAME; |
|
141 |
} |
|
142 |
||
143 |
/** |
|
144 |
* Build the serialized form. |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
145 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
146 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
147 |
* @param serializedTree content tree to which the documentation will be added |
10 | 148 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
149 |
public void buildSerializedForm(XMLNode node, Content serializedTree) throws Exception { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
150 |
serializedTree = writer.getHeader(configuration.getText( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
151 |
"doclet.Serialized_Form")); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
152 |
buildChildren(node, serializedTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
153 |
writer.addFooter(serializedTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
154 |
writer.printDocument(serializedTree); |
10 | 155 |
writer.close(); |
156 |
} |
|
157 |
||
158 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
159 |
* Build the serialized form summaries. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
160 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
161 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
162 |
* @param serializedTree content tree to which the documentation will be added |
10 | 163 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
164 |
public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
165 |
Content serializedSummariesTree = writer.getSerializedSummariesHeader(); |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
166 |
for (PackageDoc pkg : configuration.packages) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
167 |
currentPackage = pkg; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
168 |
buildChildren(node, serializedSummariesTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
169 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
170 |
serializedTree.addContent(writer.getSerializedContent( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
171 |
serializedSummariesTree)); |
10 | 172 |
} |
173 |
||
174 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
175 |
* Build the package serialized form for the current package being processed. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
176 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
177 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
178 |
* @param serializedSummariesTree content tree to which the documentation will be added |
10 | 179 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
180 |
public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
181 |
Content packageSerializedTree = writer.getPackageSerializedHeader(); |
10 | 182 |
String foo = currentPackage.name(); |
183 |
ClassDoc[] classes = currentPackage.allClasses(false); |
|
184 |
if (classes == null || classes.length == 0) { |
|
185 |
return; |
|
186 |
} |
|
187 |
if (!serialInclude(currentPackage)) { |
|
188 |
return; |
|
189 |
} |
|
190 |
if (!serialClassFoundToDocument(classes)) { |
|
191 |
return; |
|
192 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
193 |
buildChildren(node, packageSerializedTree); |
29957
7740f9657f56
8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents:
25874
diff
changeset
|
194 |
writer.addPackageSerializedTree(serializedSummariesTree, packageSerializedTree); |
10 | 195 |
} |
196 |
||
7614
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 |
* Build the package header. |
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 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
201 |
* @param packageSerializedTree 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
|
202 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
203 |
public void buildPackageHeader(XMLNode node, Content packageSerializedTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
204 |
packageSerializedTree.addContent(writer.getPackageHeader( |
25454
376a52c9540c
8039028: [javadoc] refactor the usage of Util.java
ksrini
parents:
22159
diff
changeset
|
205 |
utils.getPackageName(currentPackage))); |
10 | 206 |
} |
207 |
||
7614
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 |
* Build the class serialized form. |
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 node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
212 |
* @param packageSerializedTree 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
|
213 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
214 |
public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
215 |
Content classSerializedTree = writer.getClassSerializedHeader(); |
10 | 216 |
ClassDoc[] classes = currentPackage.allClasses(false); |
217 |
Arrays.sort(classes); |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
218 |
for (ClassDoc classDoc : classes) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
219 |
currentClass = classDoc; |
10 | 220 |
fieldWriter = writer.getSerialFieldWriter(currentClass); |
221 |
methodWriter = writer.getSerialMethodWriter(currentClass); |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
222 |
if (currentClass.isClass() && currentClass.isSerializable()) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
223 |
if (!serialClassInclude(currentClass)) { |
10 | 224 |
continue; |
225 |
} |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
226 |
Content classTree = writer.getClassHeader(currentClass); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
227 |
buildChildren(node, classTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
228 |
classSerializedTree.addContent(classTree); |
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 |
packageSerializedTree.addContent(classSerializedTree); |
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 |
|
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 |
* Build the serial UID information for the given class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
236 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
237 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
238 |
* @param classTree content tree to which the serial UID information will be added |
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 |
public void buildSerialUIDInfo(XMLNode node, Content classTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
241 |
Content serialUidTree = writer.getSerialUIDInfoHeader(); |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
242 |
for (FieldDoc field : currentClass.fields(false)) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
243 |
if (field.name().equals("serialVersionUID") && |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
244 |
field.constantValueExpression() != null) { |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
245 |
writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER, |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
246 |
field.constantValueExpression(), serialUidTree); |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
247 |
break; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
248 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
249 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
250 |
classTree.addContent(serialUidTree); |
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 |
* Build the summaries for the methods and fields. |
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 node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
257 |
* @param classTree 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
|
258 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
259 |
public void buildClassContent(XMLNode node, Content classTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
260 |
Content classContentTree = writer.getClassContentHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
261 |
buildChildren(node, classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
262 |
classTree.addContent(classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
263 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
264 |
|
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 |
* Build the summaries for the methods that belong to the given |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
267 |
* class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
268 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
269 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
270 |
* @param classContentTree 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
|
271 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
272 |
public void buildSerializableMethods(XMLNode node, Content classContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
273 |
Content serializableMethodTree = methodWriter.getSerializableMethodsHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
274 |
MemberDoc[] members = currentClass.serializationMethods(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
275 |
int membersLength = members.length; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
276 |
if (membersLength > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
277 |
for (int i = 0; i < membersLength; i++) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
278 |
currentMember = members[i]; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
279 |
Content methodsContentTree = methodWriter.getMethodsContentHeader( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
280 |
(i == membersLength - 1)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
281 |
buildChildren(node, methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
282 |
serializableMethodTree.addContent(methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
283 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
284 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
285 |
if (currentClass.serializationMethods().length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
286 |
classContentTree.addContent(methodWriter.getSerializableMethods( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
287 |
configuration.getText("doclet.Serialized_Form_methods"), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
288 |
serializableMethodTree)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
289 |
if (currentClass.isSerializable() && !currentClass.isExternalizable()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
290 |
if (currentClass.serializationMethods().length == 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
291 |
Content noCustomizationMsg = methodWriter.getNoCustomizationMsg( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
292 |
configuration.getText( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
293 |
"doclet.Serializable_no_customization")); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
294 |
classContentTree.addContent(methodWriter.getSerializableMethods( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
295 |
configuration.getText("doclet.Serialized_Form_methods"), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
296 |
noCustomizationMsg)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
297 |
} |
10 | 298 |
} |
299 |
} |
|
300 |
} |
|
301 |
||
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
302 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
303 |
* Build the method sub header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
304 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
305 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
306 |
* @param methodsContentTree 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
|
307 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
308 |
public void buildMethodSubHeader(XMLNode node, Content methodsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
309 |
methodWriter.addMemberHeader((MethodDoc)currentMember, methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
310 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
311 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
312 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
313 |
* Build the deprecated method description. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
314 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
315 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
316 |
* @param methodsContentTree 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
|
317 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
318 |
public void buildDeprecatedMethodInfo(XMLNode node, Content methodsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
319 |
methodWriter.addDeprecatedMemberInfo((MethodDoc) currentMember, methodsContentTree); |
10 | 320 |
} |
321 |
||
322 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
323 |
* Build the information for the method. |
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 node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
326 |
* @param methodsContentTree 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
|
327 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
328 |
public void buildMethodInfo(XMLNode node, Content methodsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
329 |
if(configuration.nocomment){ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
330 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
331 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
332 |
buildChildren(node, methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
333 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
334 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
335 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
336 |
* Build method description. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
337 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
338 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
339 |
* @param methodsContentTree content tree to which the documentation will be added |
10 | 340 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
341 |
public void buildMethodDescription(XMLNode node, Content methodsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
342 |
methodWriter.addMemberDescription((MethodDoc) currentMember, methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
343 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
344 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
345 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
346 |
* Build the method tags. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
347 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
348 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
349 |
* @param methodsContentTree 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
|
350 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
351 |
public void buildMethodTags(XMLNode node, Content methodsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
352 |
methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
353 |
MethodDoc method = (MethodDoc)currentMember; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
354 |
if (method.name().compareTo("writeExternal") == 0 |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
355 |
&& method.tags("serialData").length == 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
356 |
if (configuration.serialwarn) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
357 |
configuration.getDocletSpecificMsg().warning( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
358 |
currentMember.position(), "doclet.MissingSerialDataTag", |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
359 |
method.containingClass().qualifiedName(), method.name()); |
10 | 360 |
} |
361 |
} |
|
362 |
} |
|
363 |
||
364 |
/** |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
365 |
* Build the field header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
366 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
367 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
368 |
* @param classContentTree 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
|
369 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
370 |
public void buildFieldHeader(XMLNode node, Content classContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
371 |
if (currentClass.serializableFields().length > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
372 |
buildFieldSerializationOverview(currentClass, classContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
373 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
374 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
375 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
376 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
377 |
* Build the serialization overview for the given class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
378 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
379 |
* @param classDoc the class to print the overview for. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
380 |
* @param classContentTree 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
|
381 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
382 |
public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
383 |
if (classDoc.definesSerializableFields()) { |
8631
664f84942e74
6866185: Util.getPackageSourcePath should use lastIndexOf not indexOf and related cleanup
jjg
parents:
7681
diff
changeset
|
384 |
FieldDoc serialPersistentField = classDoc.serializableFields()[0]; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
385 |
// Check to see if there are inline comments, tags or deprecation |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
386 |
// information to be printed. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
387 |
if (fieldWriter.shouldPrintOverview(serialPersistentField)) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
388 |
Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
389 |
Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
390 |
fieldWriter.addMemberDeprecatedInfo(serialPersistentField, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
391 |
fieldsOverviewContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
392 |
if (!configuration.nocomment) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
393 |
fieldWriter.addMemberDescription(serialPersistentField, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
394 |
fieldsOverviewContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
395 |
fieldWriter.addMemberTags(serialPersistentField, |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
396 |
fieldsOverviewContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
397 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
398 |
serializableFieldsTree.addContent(fieldsOverviewContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
399 |
classContentTree.addContent(fieldWriter.getSerializableFields( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
400 |
configuration.getText("doclet.Serialized_Form_class"), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
401 |
serializableFieldsTree)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
402 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
403 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
404 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
405 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
406 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
407 |
* Build the summaries for the fields that belong to the given class. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
408 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
409 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
410 |
* @param classContentTree content tree to which the documentation will be added |
10 | 411 |
*/ |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
412 |
public void buildSerializableFields(XMLNode node, Content classContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
413 |
MemberDoc[] members = currentClass.serializableFields(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
414 |
int membersLength = members.length; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
415 |
if (membersLength > 0) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
416 |
Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
417 |
for (int i = 0; i < membersLength; i++) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
418 |
currentMember = members[i]; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
419 |
if (!currentClass.definesSerializableFields()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
420 |
Content fieldsContentTree = fieldWriter.getFieldsContentHeader( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
421 |
(i == membersLength - 1)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
422 |
buildChildren(node, fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
423 |
serializableFieldsTree.addContent(fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
424 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
425 |
else { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
426 |
buildSerialFieldTagsInfo(serializableFieldsTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
427 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
428 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
429 |
classContentTree.addContent(fieldWriter.getSerializableFields( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
430 |
configuration.getText("doclet.Serialized_Form_fields"), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
431 |
serializableFieldsTree)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
432 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
433 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
434 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
435 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
436 |
* Build the field sub header. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
437 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
438 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
439 |
* @param fieldsContentTree 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
|
440 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
441 |
public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
442 |
if (!currentClass.definesSerializableFields()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
443 |
FieldDoc field = (FieldDoc) currentMember; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
444 |
fieldWriter.addMemberHeader(field.type().asClassDoc(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
445 |
field.type().typeName(), field.type().dimension(), field.name(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
446 |
fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
447 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
448 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
449 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
450 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
451 |
* Build the field deprecation information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
452 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
453 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
454 |
* @param fieldsContentTree 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
|
455 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
456 |
public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
457 |
if (!currentClass.definesSerializableFields()) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
458 |
FieldDoc field = (FieldDoc)currentMember; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
459 |
fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
460 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
461 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
462 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
463 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
464 |
* Build the serial field tags information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
465 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
466 |
* @param serializableFieldsTree 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
|
467 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
468 |
public void buildSerialFieldTagsInfo(Content serializableFieldsTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
469 |
if(configuration.nocomment){ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
470 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
471 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
472 |
FieldDoc field = (FieldDoc)currentMember; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
473 |
// Process Serializable Fields specified as array of |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
474 |
// ObjectStreamFields. Print a member for each serialField tag. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
475 |
// (There should be one serialField tag per ObjectStreamField |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
476 |
// element.) |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
477 |
SerialFieldTag[] tags = field.serialFieldTags(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
478 |
Arrays.sort(tags); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
479 |
int tagsLength = tags.length; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
480 |
for (int i = 0; i < tagsLength; i++) { |
14357
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
481 |
if (tags[i].fieldName() == null || tags[i].fieldType() == null) // ignore malformed @serialField tags |
faf9cde2817b
8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents:
14260
diff
changeset
|
482 |
continue; |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
483 |
Content fieldsContentTree = fieldWriter.getFieldsContentHeader( |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
484 |
(i == tagsLength - 1)); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
485 |
fieldWriter.addMemberHeader(tags[i].fieldTypeDoc(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
486 |
tags[i].fieldType(), "", tags[i].fieldName(), fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
487 |
fieldWriter.addMemberDescription(tags[i], fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
488 |
serializableFieldsTree.addContent(fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
489 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
490 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
491 |
|
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
492 |
/** |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
493 |
* Build the field information. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
494 |
* |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
495 |
* @param node the XML element that specifies which components to document |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
496 |
* @param fieldsContentTree 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
|
497 |
*/ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
498 |
public void buildFieldInfo(XMLNode node, Content fieldsContentTree) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
499 |
if(configuration.nocomment){ |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
500 |
return; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
501 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
502 |
FieldDoc field = (FieldDoc)currentMember; |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
503 |
ClassDoc cd = field.containingClass(); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
504 |
// Process default Serializable field. |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
505 |
if ((field.tags("serial").length == 0) && ! field.isSynthetic() |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
506 |
&& configuration.serialwarn) { |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
507 |
configuration.message.warning(field.position(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
508 |
"doclet.MissingSerialTag", cd.qualifiedName(), |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
509 |
field.name()); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
510 |
} |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
511 |
fieldWriter.addMemberDescription(field, fieldsContentTree); |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5855
diff
changeset
|
512 |
fieldWriter.addMemberTags(field, fieldsContentTree); |
10 | 513 |
} |
514 |
||
515 |
/** |
|
516 |
* Return true if the given Doc should be included |
|
517 |
* in the serialized form. |
|
518 |
* |
|
519 |
* @param doc the Doc object to check for serializability. |
|
520 |
*/ |
|
521 |
public static boolean serialInclude(Doc doc) { |
|
522 |
if (doc == null) { |
|
523 |
return false; |
|
524 |
} |
|
525 |
return doc.isClass() ? |
|
526 |
serialClassInclude((ClassDoc)doc) : |
|
527 |
serialDocInclude(doc); |
|
528 |
} |
|
529 |
||
530 |
/** |
|
531 |
* Return true if the given ClassDoc should be included |
|
532 |
* in the serialized form. |
|
533 |
* |
|
534 |
* @param cd the ClassDoc object to check for serializability. |
|
535 |
*/ |
|
536 |
private static boolean serialClassInclude(ClassDoc cd) { |
|
537 |
if (cd.isEnum()) { |
|
538 |
return false; |
|
539 |
} |
|
540 |
try { |
|
541 |
cd.superclassType(); |
|
542 |
} catch (NullPointerException e) { |
|
543 |
//Workaround for null pointer bug in ClassDoc.superclassType(). |
|
544 |
return false; |
|
545 |
} |
|
546 |
if (cd.isSerializable()) { |
|
547 |
if (cd.tags("serial").length > 0) { |
|
548 |
return serialDocInclude(cd); |
|
549 |
} else if (cd.isPublic() || cd.isProtected()) { |
|
550 |
return true; |
|
551 |
} else { |
|
552 |
return false; |
|
553 |
} |
|
554 |
} |
|
555 |
return false; |
|
556 |
} |
|
557 |
||
558 |
/** |
|
559 |
* Return true if the given Doc should be included |
|
560 |
* in the serialized form. |
|
561 |
* |
|
562 |
* @param doc the Doc object to check for serializability. |
|
563 |
*/ |
|
564 |
private static boolean serialDocInclude(Doc doc) { |
|
565 |
if (doc.isEnum()) { |
|
566 |
return false; |
|
567 |
} |
|
568 |
Tag[] serial = doc.tags("serial"); |
|
569 |
if (serial.length > 0) { |
|
22153
f9f06fcca59d
8029800: Flags.java uses String.toLowerCase without specifying Locale
jlahoda
parents:
19667
diff
changeset
|
570 |
String serialtext = StringUtils.toLowerCase(serial[0].text()); |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
571 |
if (serialtext.contains("exclude")) { |
10 | 572 |
return false; |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
573 |
} else if (serialtext.contains("include")) { |
10 | 574 |
return true; |
575 |
} |
|
576 |
} |
|
577 |
return true; |
|
578 |
} |
|
579 |
||
580 |
/** |
|
581 |
* Return true if any of the given classes have a @serialinclude tag. |
|
582 |
* |
|
583 |
* @param classes the classes to check. |
|
584 |
* @return true if any of the given classes have a @serialinclude tag. |
|
585 |
*/ |
|
586 |
private boolean serialClassFoundToDocument(ClassDoc[] classes) { |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
587 |
for (ClassDoc aClass : classes) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
22153
diff
changeset
|
588 |
if (serialClassInclude(aClass)) { |
10 | 589 |
return true; |
590 |
} |
|
591 |
} |
|
592 |
return false; |
|
593 |
} |
|
594 |
} |