001    /*
002     * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
003     * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004     *
005     * This code is free software; you can redistribute it and/or modify it
006     * under the terms of the GNU General Public License version 2 only, as
007     * published by the Free Software Foundation.  Sun designates this
008     * particular file as subject to the "Classpath" exception as provided
009     * by Sun in the LICENSE file that accompanied this code.
010     *
011     * This code is distributed in the hope that it will be useful, but WITHOUT
012     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014     * version 2 for more details (a copy is included in the LICENSE file that
015     * accompanied this code).
016     *
017     * You should have received a copy of the GNU General Public License version
018     * 2 along with this work; if not, write to the Free Software Foundation,
019     * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020     *
021     * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022     * CA 95054 USA or visit www.sun.com if you need additional information or
023     * have any questions.
024     */
025    
026    package com.sun.tools.doclets.internal.toolkit;
027    
028    import com.sun.javadoc.*;
029    import java.io.*;
030    
031    /**
032     * The interface for writing serialized form output.
033     *
034     * This code is not part of an API.
035     * It is implementation that is subject to change.
036     * Do not use it as an API
037     *
038     * @author Jamie Ho
039     * @since 1.5
040     */
041    
042    public interface SerializedFormWriter {
043    
044        /**
045         * Write the given header.
046         *
047         * @param header the header to write.
048         */
049        public void writeHeader(String header);
050    
051        /**
052         * Write the given package header.
053         *
054         * @param packageName the package header to write.
055         */
056        public void writePackageHeader(String packageName);
057    
058        /**
059         * Write the heading for the serializable class.
060         *
061         * @param classDoc the class being processed.
062         */
063        public void writeClassHeader(ClassDoc classDoc);
064    
065        /**
066         * Write the serial UID info.
067         *
068         * @param header the header that will show up before the UID.
069         * @param serialUID the serial UID to print.
070         */
071        public void writeSerialUIDInfo(String header, String serialUID);
072    
073        /**
074         * Return an instance of a SerialFieldWriter.
075         *
076         * @return an instance of a SerialFieldWriter.
077         */
078        public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc);
079    
080        /**
081         * Return an instance of a SerialMethodWriter.
082         *
083         * @return an instance of a SerialMethodWriter.
084         */
085        public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc);
086    
087        /**
088         * Close the writer.
089         */
090        public abstract void close() throws IOException;
091    
092        /**
093         * Write the footer.
094         */
095        public void writeFooter();
096    
097        /**
098         * Write the serialized form for a given field.
099         */
100        public interface SerialFieldWriter {
101    
102            /**
103             * Write the given heading.
104             *
105             * @param heading the heading to write.
106             */
107            public void writeHeader(String heading);
108    
109            /**
110             * Write the deprecated information for this member.
111             *
112             * @param field the field to document.
113             */
114            public void writeMemberDeprecatedInfo(FieldDoc field);
115    
116            /**
117             * Write the description text for this member.
118             *
119             * @param field the field to document.
120             */
121            public void writeMemberDescription(FieldDoc field);
122    
123            /**
124             * Write the description text for this member represented by the tag.
125             *
126             * @param serialFieldTag the field to document (represented by tag).
127             */
128            public void writeMemberDescription(SerialFieldTag serialFieldTag);
129    
130            /**
131             * Write the tag information for this member.
132             *
133             * @param field the field to document.
134             */
135            public void writeMemberTags(FieldDoc field);
136    
137            /**
138             * Write the member header.
139             *
140             * @param fieldType the type of the field.
141             * @param fieldTypeStr the type of the field in string format.  We will
142             * print this out if we can't link to the type.
143             * @param fieldDimensions the dimensions of the field.
144             * @param fieldName the name of the field.
145             */
146            public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr,
147                String fieldDimensions, String fieldName);
148    
149            /**
150             * Write the footer.
151             *
152             * @param member the member to write the header for.
153             */
154            public void writeMemberFooter(FieldDoc member);
155        }
156    
157        /**
158         * Write the serialized form for a given field.
159         */
160        public interface SerialMethodWriter {
161    
162            /**
163             * Write the given heading.
164             *
165             * @param heading the heading to write.
166             */
167            public void writeHeader(String heading);
168    
169            /**
170             * Write a warning that no serializable methods exist.
171             *
172             * @param msg the warning to print.
173             */
174            public void writeNoCustomizationMsg(String msg);
175    
176            /**
177             * Write the header.
178             *
179             * @param member the member to write the header for.
180             */
181            public void writeMemberHeader(MethodDoc member);
182    
183            /**
184             * Write the footer.
185             *
186             * @param member the member to write the header for.
187             */
188            public void writeMemberFooter(MethodDoc member);
189    
190            /**
191             * Write the deprecated information for this member.
192             */
193            public void writeDeprecatedMemberInfo(MethodDoc member);
194    
195            /**
196             * Write the description for this member.
197             */
198            public void writeMemberDescription(MethodDoc member);
199    
200            /**
201             * Write the tag information for this member.
202             */
203            public void writeMemberTags(MethodDoc member);
204        }
205    }