langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java
author ohair
Tue, 25 May 2010 15:54:51 -0700
changeset 5520 86e4b9a9da40
parent 2223 95e3c21b2919
child 7614 cfadc977ca75
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
     2
 * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2223
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.internal.toolkit;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    28
import java.io.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
    29
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * The interface for writing serialized form output.
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * This code is not part of an API.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * It is implementation that is subject to change.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Do not use it as an API
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @since 1.5
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
public interface SerializedFormWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
     * Write the given header.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     * @param header the header to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    public void writeHeader(String header);
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * Write the given package header.
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     * @param packageName the package header to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    public void writePackageHeader(String packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * Write the heading for the serializable class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * @param classDoc the class being processed.
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    public void writeClassHeader(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     * Write the serial UID info.
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * @param header the header that will show up before the UID.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param serialUID the serial UID to print.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    public void writeSerialUIDInfo(String header, String serialUID);
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     * Return an instance of a SerialFieldWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * @return an instance of a SerialFieldWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
    public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * Return an instance of a SerialMethodWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     * @return an instance of a SerialMethodWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    public abstract void close() throws IOException;
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     * Write the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    public void writeFooter();
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     * Write the serialized form for a given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
    public interface SerialFieldWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
         * Write the given heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
         * @param heading the heading to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
        public void writeHeader(String heading);
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
         * Write the deprecated information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        public void writeMemberDeprecatedInfo(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
         * Write the description text for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
        public void writeMemberDescription(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
         * Write the description text for this member represented by the tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
         * @param serialFieldTag the field to document (represented by tag).
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
        public void writeMemberDescription(SerialFieldTag serialFieldTag);
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
         * Write the tag information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
        public void writeMemberTags(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
         * Write the member header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
         * @param fieldType the type of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
         * @param fieldTypeStr the type of the field in string format.  We will
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
         * print this out if we can't link to the type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
         * @param fieldDimensions the dimensions of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
         * @param fieldName the name of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
        public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr,
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
            String fieldDimensions, String fieldName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
        /**
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   151
         * Write the member footer.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
         */
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   153
        public void writeMemberFooter();
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   154
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   155
        /**
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   156
         * Check to see if overview details should be printed. If
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   157
         * nocomment option set or if there is no text to be printed
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   158
         * for deprecation info, inline comment or tags,
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   159
         * do not print overview details.
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   160
         *
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   161
         * @param field the field to check overview details for.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   162
         * @return true if overview details need to be printed
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   163
         */
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   164
        public boolean shouldPrintOverview(FieldDoc field);
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   165
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   166
        /**
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   167
         * Write the footer.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   168
         *
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   169
         * @param heading the heading that was written.
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   170
         */
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   171
        public void writeFooter (String heading);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     * Write the serialized form for a given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    public interface SerialMethodWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
         * Write the given heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
         * @param heading the heading to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
        public void writeHeader(String heading);
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
         * Write a warning that no serializable methods exist.
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
         * @param msg the warning to print.
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
        public void writeNoCustomizationMsg(String msg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
         * Write the header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
         * @param member the member to write the header for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        public void writeMemberHeader(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
         * Write the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
         */
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 2086
diff changeset
   203
        public void writeMemberFooter();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
         * Write the deprecated information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
        public void writeDeprecatedMemberInfo(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
         * Write the description for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
        public void writeMemberDescription(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
         * Write the tag information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        public void writeMemberTags(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
}