src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java

Sat, 07 Nov 2020 10:30:02 +0800

author
aoqi
date
Sat, 07 Nov 2020 10:30:02 +0800
changeset 3938
93012e2a5d1d
parent 2525
2eb010b6cb22
permissions
-rw-r--r--

Added tag mips-jdk8u275-b01 for changeset eb6ee6a5f2fe

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation. Oracle designates this
aoqi@0 8 * particular file as subject to the "Classpath" exception as provided
aoqi@0 9 * by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 *
aoqi@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 * accompanied this code).
aoqi@0 16 *
aoqi@0 17 * You should have received a copy of the GNU General Public License version
aoqi@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 *
aoqi@0 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 * or visit www.oracle.com if you need additional information or have any
aoqi@0 23 * questions.
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 package com.sun.tools.doclets.internal.toolkit;
aoqi@0 27
aoqi@0 28 import java.io.*;
aoqi@0 29
aoqi@0 30 import com.sun.javadoc.*;
aoqi@0 31
aoqi@0 32 /**
aoqi@0 33 * The interface for writing serialized form output.
aoqi@0 34 *
aoqi@0 35 * <p><b>This is NOT part of any supported API.
aoqi@0 36 * If you write code that depends on this, you do so at your own risk.
aoqi@0 37 * This code and its internal interfaces are subject to change or
aoqi@0 38 * deletion without notice.</b>
aoqi@0 39 *
aoqi@0 40 * @author Jamie Ho
aoqi@0 41 * @since 1.5
aoqi@0 42 */
aoqi@0 43
aoqi@0 44 public interface SerializedFormWriter {
aoqi@0 45
aoqi@0 46 /**
aoqi@0 47 * Get the header.
aoqi@0 48 *
aoqi@0 49 * @param header the header to write.
aoqi@0 50 * @return the header content tree
aoqi@0 51 */
aoqi@0 52 public Content getHeader(String header);
aoqi@0 53
aoqi@0 54 /**
aoqi@0 55 * Get the serialized form summaries header.
aoqi@0 56 *
aoqi@0 57 * @return the serialized form summary header tree
aoqi@0 58 */
aoqi@0 59 public Content getSerializedSummariesHeader();
aoqi@0 60
aoqi@0 61 /**
aoqi@0 62 * Get the package serialized form header.
aoqi@0 63 *
aoqi@0 64 * @return the package serialized form header tree
aoqi@0 65 */
aoqi@0 66 public Content getPackageSerializedHeader();
aoqi@0 67
aoqi@0 68 /**
aoqi@0 69 * Get the given package header.
aoqi@0 70 *
aoqi@0 71 * @param packageName the package header to write
aoqi@0 72 * @return a content tree for the package header
aoqi@0 73 */
aoqi@0 74 public Content getPackageHeader(String packageName);
aoqi@0 75
aoqi@0 76 /**
aoqi@0 77 * Get the serialized class header.
aoqi@0 78 *
aoqi@0 79 * @return a content tree for the serialized class header
aoqi@0 80 */
aoqi@0 81 public Content getClassSerializedHeader();
aoqi@0 82
aoqi@0 83 /**
aoqi@0 84 * Get the heading for the serializable class.
aoqi@0 85 *
aoqi@0 86 * @param classDoc the class being processed
aoqi@0 87 * @return a content tree for the class heading
aoqi@0 88 */
aoqi@0 89 public Content getClassHeader(ClassDoc classDoc);
aoqi@0 90
aoqi@0 91 /**
aoqi@0 92 * Get the serial UID info header.
aoqi@0 93 *
aoqi@0 94 * @return a content tree for the serial uid info header
aoqi@0 95 */
aoqi@0 96 public Content getSerialUIDInfoHeader();
aoqi@0 97
aoqi@0 98 /**
aoqi@0 99 * Adds the serial UID info.
aoqi@0 100 *
aoqi@0 101 * @param header the header that will show up before the UID.
aoqi@0 102 * @param serialUID the serial UID to print.
aoqi@0 103 * @param serialUidTree the serial UID tree to which the content will be added.
aoqi@0 104 */
aoqi@0 105 public void addSerialUIDInfo(String header, String serialUID,
aoqi@0 106 Content serialUidTree);
aoqi@0 107
aoqi@0 108 /**
aoqi@0 109 * Get the class serialize content header.
aoqi@0 110 *
aoqi@0 111 * @return a content tree for the class serialize content header
aoqi@0 112 */
aoqi@0 113 public Content getClassContentHeader();
aoqi@0 114
aoqi@0 115 /**
aoqi@0 116 * Return an instance of a SerialFieldWriter.
aoqi@0 117 *
aoqi@0 118 * @return an instance of a SerialFieldWriter.
aoqi@0 119 */
aoqi@0 120 public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc);
aoqi@0 121
aoqi@0 122 /**
aoqi@0 123 * Return an instance of a SerialMethodWriter.
aoqi@0 124 *
aoqi@0 125 * @return an instance of a SerialMethodWriter.
aoqi@0 126 */
aoqi@0 127 public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc);
aoqi@0 128
aoqi@0 129 /**
aoqi@0 130 * Close the writer.
aoqi@0 131 */
aoqi@0 132 public abstract void close() throws IOException;
aoqi@0 133
aoqi@0 134 /**
aoqi@0 135 * Get the serialized content.
aoqi@0 136 *
aoqi@0 137 * @param serializedTreeContent content for serialized data
aoqi@0 138 * @return a content tree for serialized information
aoqi@0 139 */
aoqi@0 140 public Content getSerializedContent(Content serializedTreeContent);
aoqi@0 141
aoqi@0 142 /**
aoqi@0 143 * Add the footer.
aoqi@0 144 *
aoqi@0 145 * @param serializedTree the serialized tree to be added
aoqi@0 146 */
aoqi@0 147 public void addFooter(Content serializedTree);
aoqi@0 148
aoqi@0 149 /**
aoqi@0 150 * Print the serialized form document.
aoqi@0 151 *
aoqi@0 152 * @param serializedTree the content tree that will be printed
aoqi@0 153 */
aoqi@0 154 public abstract void printDocument(Content serializedTree) throws IOException;
aoqi@0 155
aoqi@0 156 /**
aoqi@0 157 * Write the serialized form for a given field.
aoqi@0 158 */
aoqi@0 159 public interface SerialFieldWriter {
aoqi@0 160
aoqi@0 161 /**
aoqi@0 162 * Get the serializable field header.
aoqi@0 163 *
aoqi@0 164 * @return serialized fields header content tree
aoqi@0 165 */
aoqi@0 166 public Content getSerializableFieldsHeader();
aoqi@0 167
aoqi@0 168 /**
aoqi@0 169 * Get the field content header.
aoqi@0 170 *
aoqi@0 171 * @param isLastContent true if this is the last content to be documented
aoqi@0 172 * @return fields header content tree
aoqi@0 173 */
aoqi@0 174 public Content getFieldsContentHeader(boolean isLastContent);
aoqi@0 175
aoqi@0 176 /**
aoqi@0 177 * Get the fields content.
aoqi@0 178 *
aoqi@0 179 * @param heading the heading to write.
aoqi@0 180 * @param contentTree content tree to which the heading will be added
aoqi@0 181 * @return serializable fields content tree
aoqi@0 182 */
aoqi@0 183 public Content getSerializableFields(String heading, Content contentTree);
aoqi@0 184
aoqi@0 185 /**
aoqi@0 186 * Adds the deprecated information for this member.
aoqi@0 187 *
aoqi@0 188 * @param field the field to document.
aoqi@0 189 * @param contentTree content tree to which the deprecated information will be added
aoqi@0 190 */
aoqi@0 191 public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree);
aoqi@0 192
aoqi@0 193 /**
aoqi@0 194 * Adds the description text for this member.
aoqi@0 195 *
aoqi@0 196 * @param field the field to document.
aoqi@0 197 * @param contentTree content tree to which the member description will be added
aoqi@0 198 */
aoqi@0 199 public void addMemberDescription(FieldDoc field, Content contentTree);
aoqi@0 200
aoqi@0 201 /**
aoqi@0 202 * Adds the description text for this member represented by the tag.
aoqi@0 203 *
aoqi@0 204 * @param serialFieldTag the field to document (represented by tag).
aoqi@0 205 * @param contentTree content tree to which the member description will be added
aoqi@0 206 */
aoqi@0 207 public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree);
aoqi@0 208
aoqi@0 209 /**
aoqi@0 210 * Adds the tag information for this member.
aoqi@0 211 *
aoqi@0 212 * @param field the field to document.
aoqi@0 213 * @param contentTree content tree to which the member tags will be added
aoqi@0 214 */
aoqi@0 215 public void addMemberTags(FieldDoc field, Content contentTree);
aoqi@0 216
aoqi@0 217 /**
aoqi@0 218 * Adds the member header.
aoqi@0 219 *
aoqi@0 220 * @param fieldType the type of the field.
aoqi@0 221 * @param fieldTypeStr the type of the field in string format. We will
aoqi@0 222 * print this out if we can't link to the type.
aoqi@0 223 * @param fieldDimensions the dimensions of the field.
aoqi@0 224 * @param fieldName the name of the field.
aoqi@0 225 * @param contentTree content tree to which the member header will be added
aoqi@0 226 */
aoqi@0 227 public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr,
aoqi@0 228 String fieldDimensions, String fieldName, Content contentTree);
aoqi@0 229
aoqi@0 230 /**
aoqi@0 231 * Check to see if overview details should be printed. If
aoqi@0 232 * nocomment option set or if there is no text to be printed
aoqi@0 233 * for deprecation info, inline comment or tags,
aoqi@0 234 * do not print overview details.
aoqi@0 235 *
aoqi@0 236 * @param field the field to check overview details for.
aoqi@0 237 * @return true if overview details need to be printed
aoqi@0 238 */
aoqi@0 239 public boolean shouldPrintOverview(FieldDoc field);
aoqi@0 240 }
aoqi@0 241
aoqi@0 242 /**
aoqi@0 243 * Write the serialized form for a given field.
aoqi@0 244 */
aoqi@0 245 public interface SerialMethodWriter {
aoqi@0 246
aoqi@0 247 /**
aoqi@0 248 * Get the serializable method header.
aoqi@0 249 *
aoqi@0 250 * @return serializable methods content tree
aoqi@0 251 */
aoqi@0 252 public Content getSerializableMethodsHeader();
aoqi@0 253
aoqi@0 254 /**
aoqi@0 255 * Get the method content header.
aoqi@0 256 *
aoqi@0 257 * @param isLastContent true if this is the last content to be documented
aoqi@0 258 * @return methods content tree
aoqi@0 259 */
aoqi@0 260 public Content getMethodsContentHeader(boolean isLastContent);
aoqi@0 261
aoqi@0 262 /**
aoqi@0 263 * Write the given heading.
aoqi@0 264 *
aoqi@0 265 * @param heading the heading to write
aoqi@0 266 * @param serializableMethodTree content tree which will be added
aoqi@0 267 * @return serializable methods content tree
aoqi@0 268 */
aoqi@0 269 public Content getSerializableMethods(String heading, Content serializableMethodTree);
aoqi@0 270
aoqi@0 271 /**
aoqi@0 272 * Write a warning that no serializable methods exist.
aoqi@0 273 *
aoqi@0 274 * @param msg the warning to print
aoqi@0 275 * @return no customization message tree
aoqi@0 276 */
aoqi@0 277 public Content getNoCustomizationMsg(String msg);
aoqi@0 278
aoqi@0 279 /**
aoqi@0 280 * Adds the header.
aoqi@0 281 *
aoqi@0 282 * @param member the member to write the header for
aoqi@0 283 * @param methodsContentTree content tree to which the header will be added
aoqi@0 284 */
aoqi@0 285 public void addMemberHeader(MethodDoc member, Content methodsContentTree);
aoqi@0 286
aoqi@0 287 /**
aoqi@0 288 * Adds the deprecated information for this member.
aoqi@0 289 *
aoqi@0 290 * @param member the member to write the deprecated information for
aoqi@0 291 * @param methodsContentTree content tree to which the deprecated
aoqi@0 292 * information will be added
aoqi@0 293 */
aoqi@0 294 public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree);
aoqi@0 295
aoqi@0 296 /**
aoqi@0 297 * Adds the description for this member.
aoqi@0 298 *
aoqi@0 299 * @param member the member to write the information for
aoqi@0 300 * @param methodsContentTree content tree to which the member
aoqi@0 301 * information will be added
aoqi@0 302 */
aoqi@0 303 public void addMemberDescription(MethodDoc member, Content methodsContentTree);
aoqi@0 304
aoqi@0 305 /**
aoqi@0 306 * Adds the tag information for this member.
aoqi@0 307 *
aoqi@0 308 * @param member the member to write the tags information for
aoqi@0 309 * @param methodsContentTree content tree to which the tags
aoqi@0 310 * information will be added
aoqi@0 311 */
aoqi@0 312 public void addMemberTags(MethodDoc member, Content methodsContentTree);
aoqi@0 313 }
aoqi@0 314 }

mercurial