67 writer.printLink(new LinkInfoImpl( |
66 writer.printLink(new LinkInfoImpl( |
68 LinkInfoImpl.CONTEXT_SERIAL_MEMBER, type)); |
67 LinkInfoImpl.CONTEXT_SERIAL_MEMBER, type)); |
69 } |
68 } |
70 } |
69 } |
71 |
70 |
72 public void writeHeader(String heading) { |
71 /** |
73 if (! printedOverallAnchor) { |
72 * Return the header for serializable fields section. |
74 writer.anchor("serializedForm"); |
73 * |
75 printedOverallAnchor = true; |
74 * @return a content tree for the header |
76 writer.printTableHeadingBackground(heading); |
75 */ |
77 writer.println(); |
76 public Content getSerializableFieldsHeader() { |
78 if (heading.equals( |
77 HtmlTree ul = new HtmlTree(HtmlTag.UL); |
79 configuration().getText("doclet.Serialized_Form_class"))) { |
78 ul.addStyle(HtmlStyle.blockList); |
80 assert !writer.getMemberDetailsListPrinted(); |
79 return ul; |
|
80 } |
|
81 |
|
82 /** |
|
83 * Return the header for serializable fields content section. |
|
84 * |
|
85 * @param isLastContent true if the cotent being documented is the last content. |
|
86 * @return a content tree for the header |
|
87 */ |
|
88 public Content getFieldsContentHeader(boolean isLastContent) { |
|
89 HtmlTree li = new HtmlTree(HtmlTag.LI); |
|
90 if (isLastContent) |
|
91 li.addStyle(HtmlStyle.blockListLast); |
|
92 else |
|
93 li.addStyle(HtmlStyle.blockList); |
|
94 return li; |
|
95 } |
|
96 |
|
97 /** |
|
98 * Add serializable fields. |
|
99 * |
|
100 * @param heading the heading for the section |
|
101 * @param serializableFieldsTree the tree to be added to the serializable fileds |
|
102 * content tree |
|
103 * @return a content tree for the serializable fields content |
|
104 */ |
|
105 public Content getSerializableFields(String heading, Content serializableFieldsTree) { |
|
106 HtmlTree li = new HtmlTree(HtmlTag.LI); |
|
107 li.addStyle(HtmlStyle.blockList); |
|
108 if (serializableFieldsTree.isValid()) { |
|
109 if (!printedOverallAnchor) { |
|
110 li.addContent(writer.getMarkerAnchor("serializedForm")); |
|
111 printedOverallAnchor = true; |
81 } |
112 } |
|
113 Content headingContent = new StringContent(heading); |
|
114 Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, |
|
115 headingContent); |
|
116 li.addContent(serialHeading); |
|
117 li.addContent(serializableFieldsTree); |
|
118 } |
|
119 return li; |
|
120 } |
|
121 |
|
122 /** |
|
123 * Add the member header. |
|
124 * |
|
125 * @param fieldsType the class document to be listed |
|
126 * @param fieldTypeStr the string for the filed type to be documented |
|
127 * @param fieldDimensions the dimensions of the field string to be added |
|
128 * @param firldName name of the field to be added |
|
129 * @param contentTree the content tree to which the member header will be added |
|
130 */ |
|
131 public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr, |
|
132 String fieldDimensions, String fieldName, Content contentTree) { |
|
133 Content nameContent = new RawHtml(fieldName); |
|
134 Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent); |
|
135 contentTree.addContent(heading); |
|
136 Content pre = new HtmlTree(HtmlTag.PRE); |
|
137 if (fieldType == null) { |
|
138 pre.addContent(fieldTypeStr); |
82 } else { |
139 } else { |
83 writer.printTableHeadingBackground(heading); |
140 Content fieldContent = new RawHtml(writer.getLink(new LinkInfoImpl( |
84 writer.println(); |
141 LinkInfoImpl.CONTEXT_SERIAL_MEMBER, fieldType))); |
85 } |
142 pre.addContent(fieldContent); |
86 } |
143 } |
87 |
144 pre.addContent(fieldDimensions + " "); |
88 public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr, |
145 pre.addContent(fieldName); |
89 String fieldDimensions, String fieldName) { |
146 contentTree.addContent(pre); |
90 if (printedFirstMember) { |
147 } |
91 writer.printMemberHeader(); |
148 |
92 } |
149 /** |
93 printedFirstMember = true; |
150 * Add the deprecated information for this member. |
94 writer.h3(); |
|
95 writer.print(fieldName); |
|
96 writer.h3End(); |
|
97 writer.pre(); |
|
98 if (fieldType == null) { |
|
99 writer.print(fieldTypeStr); |
|
100 } else { |
|
101 writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIAL_MEMBER, |
|
102 fieldType)); |
|
103 } |
|
104 print(fieldDimensions + ' '); |
|
105 strong(fieldName); |
|
106 writer.preEnd(); |
|
107 assert !writer.getMemberDetailsListPrinted(); |
|
108 } |
|
109 |
|
110 /** |
|
111 * Write the deprecated information for this member. |
|
112 * |
151 * |
113 * @param field the field to document. |
152 * @param field the field to document. |
114 */ |
153 * @param contentTree the tree to which the deprecated info will be added |
115 public void writeMemberDeprecatedInfo(FieldDoc field) { |
154 */ |
116 printDeprecated(field); |
155 public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree) { |
117 } |
156 addDeprecatedInfo(field, contentTree); |
118 |
157 } |
119 /** |
158 |
120 * Write the description text for this member. |
159 /** |
|
160 * Add the description text for this member. |
121 * |
161 * |
122 * @param field the field to document. |
162 * @param field the field to document. |
123 */ |
163 * @param contentTree the tree to which the deprecated info will be added |
124 public void writeMemberDescription(FieldDoc field) { |
164 */ |
|
165 public void addMemberDescription(FieldDoc field, Content contentTree) { |
125 if (field.inlineTags().length > 0) { |
166 if (field.inlineTags().length > 0) { |
126 writer.printMemberDetailsListStartTag(); |
167 writer.addInlineComment(field, contentTree); |
127 writer.dd(); |
|
128 writer.printInlineComment(field); |
|
129 writer.ddEnd(); |
|
130 } |
168 } |
131 Tag[] tags = field.tags("serial"); |
169 Tag[] tags = field.tags("serial"); |
132 if (tags.length > 0) { |
170 if (tags.length > 0) { |
133 writer.printMemberDetailsListStartTag(); |
171 writer.addInlineComment(field, tags[0], contentTree); |
134 writer.dd(); |
172 } |
135 writer.printInlineComment(field, tags[0]); |
173 } |
136 writer.ddEnd(); |
174 |
137 } |
175 /** |
138 } |
176 * Add the description text for this member represented by the tag. |
139 |
177 * |
140 /** |
178 * @param serialFieldTag the field to document (represented by tag) |
141 * Write the description text for this member represented by the tag. |
179 * @param contentTree the tree to which the deprecated info will be added |
142 * |
180 */ |
143 * @param serialFieldTag the field to document (represented by tag). |
181 public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) { |
144 */ |
|
145 public void writeMemberDescription(SerialFieldTag serialFieldTag) { |
|
146 String serialFieldTagDesc = serialFieldTag.description().trim(); |
182 String serialFieldTagDesc = serialFieldTag.description().trim(); |
147 if (!serialFieldTagDesc.isEmpty()) { |
183 if (!serialFieldTagDesc.isEmpty()) { |
148 writer.dl(); |
184 Content serialFieldContent = new RawHtml(serialFieldTagDesc); |
149 writer.dd(); |
185 Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); |
150 writer.print(serialFieldTagDesc); |
186 contentTree.addContent(div); |
151 writer.ddEnd(); |
187 } |
152 writer.dlEnd(); |
188 } |
153 } |
189 |
154 } |
190 /** |
155 |
191 * Add the tag information for this member. |
156 /** |
|
157 * Write the tag information for this member. |
|
158 * |
192 * |
159 * @param field the field to document. |
193 * @param field the field to document. |
160 */ |
194 * @param contentTree the tree to which the member tags info will be added |
161 public void writeMemberTags(FieldDoc field) { |
195 */ |
|
196 public void addMemberTags(FieldDoc field, Content contentTree) { |
162 TagletOutputImpl output = new TagletOutputImpl(""); |
197 TagletOutputImpl output = new TagletOutputImpl(""); |
163 TagletWriter.genTagOuput(configuration().tagletManager, field, |
198 TagletWriter.genTagOuput(configuration().tagletManager, field, |
164 configuration().tagletManager.getCustomTags(field), |
199 configuration().tagletManager.getCustomTags(field), |
165 writer.getTagletWriterInstance(false), output); |
200 writer.getTagletWriterInstance(false), output); |
166 String outputString = output.toString().trim(); |
201 String outputString = output.toString().trim(); |
|
202 Content dlTags = new HtmlTree(HtmlTag.DL); |
167 if (!outputString.isEmpty()) { |
203 if (!outputString.isEmpty()) { |
168 writer.printMemberDetailsListStartTag(); |
204 Content tagContent = new RawHtml(outputString); |
169 writer.dd(); |
205 dlTags.addContent(tagContent); |
170 writer.dl(); |
206 } |
171 print(outputString); |
207 contentTree.addContent(dlTags); |
172 writer.dlEnd(); |
|
173 writer.ddEnd(); |
|
174 } |
|
175 } |
208 } |
176 |
209 |
177 /** |
210 /** |
178 * Check to see if overview details should be printed. If |
211 * Check to see if overview details should be printed. If |
179 * nocomment option set or if there is no text to be printed |
212 * nocomment option set or if there is no text to be printed |