langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java
author bpatel
Wed, 18 Feb 2009 13:47:27 -0800
changeset 2086 cca2603eab0b
parent 10 06bc494ca11e
child 2216 b124d5c924eb
child 2212 1d3dc0e0ba0c
permissions -rw-r--r--
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import java.io.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * The interface for writing serialized form output.
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * This code is not part of an API.
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * It is implementation that is subject to change.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * Do not use it as an API
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * @since 1.5
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
public interface SerializedFormWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
     * Write the given header.
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     * @param header the header to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
    public void writeHeader(String header);
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * Write the given package header.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * @param packageName the package header to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    public void writePackageHeader(String packageName);
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * Write the heading for the serializable class.
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     * @param classDoc the class being processed.
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    public void writeClassHeader(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * Write the serial UID info.
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * @param header the header that will show up before the UID.
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * @param serialUID the serial UID to print.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    public void writeSerialUIDInfo(String header, String serialUID);
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
     * Return an instance of a SerialFieldWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * @return an instance of a SerialFieldWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * Return an instance of a SerialMethodWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     * @return an instance of a SerialMethodWriter.
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc);
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    public abstract void close() throws IOException;
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     * Write the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    public void writeFooter();
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * Write the serialized form for a given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public interface SerialFieldWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
         * Write the given heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
         * @param heading the heading to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
        public void writeHeader(String heading);
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
         * Write the deprecated information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        public void writeMemberDeprecatedInfo(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
         * Write the description text for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
        public void writeMemberDescription(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
         * Write the description text for this member represented by the tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
         * @param serialFieldTag the field to document (represented by tag).
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
        public void writeMemberDescription(SerialFieldTag serialFieldTag);
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
         * Write the tag information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
         * @param field the field to document.
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
        public void writeMemberTags(FieldDoc field);
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
         * Write the member header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
         * @param fieldType the type of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
         * @param fieldTypeStr the type of the field in string format.  We will
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
         * print this out if we can't link to the type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
         * @param fieldDimensions the dimensions of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
         * @param fieldName the name of the field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
        public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr,
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
            String fieldDimensions, String fieldName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
         * Write the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
         * @param member the member to write the header for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        public void writeMemberFooter(FieldDoc member);
2086
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   155
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   156
        /**
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   157
         * Check to see if member details should be printed. If
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   158
         * nocomment option set or if there is no text to be printed
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   159
         * for deprecation info, inline comment, no serial tag or inline tags,
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   160
         * do not print member details.
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   161
         *
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   162
         * @param member the member to check details for.
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   163
         * @return true if details need to be printed
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   164
         */
cca2603eab0b 6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
bpatel
parents: 10
diff changeset
   165
        public boolean shouldPrintMemberDetails(FieldDoc member);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
     * Write the serialized form for a given field.
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    public interface SerialMethodWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
         * Write the given heading.
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
         * @param heading the heading to write.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        public void writeHeader(String heading);
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
         * Write a warning that no serializable methods exist.
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
         * @param msg the warning to print.
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
        public void writeNoCustomizationMsg(String msg);
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
         * Write the header.
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
         * @param member the member to write the header for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
        public void writeMemberHeader(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
         * Write the footer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
         *
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
         * @param member the member to write the header for.
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        public void writeMemberFooter(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
         * Write the deprecated information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
        public void writeDeprecatedMemberInfo(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
         * Write the description for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
        public void writeMemberDescription(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
        /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
         * Write the tag information for this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
         */
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
        public void writeMemberTags(MethodDoc member);
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
}