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,
147: String fieldTypeStr, String fieldDimensions,
148: String fieldName);
149:
150: /**
151: * Write the footer.
152: *
153: * @param member the member to write the header for.
154: */
155: public void writeMemberFooter(FieldDoc member);
156: }
157:
158: /**
159: * Write the serialized form for a given field.
160: */
161: public interface SerialMethodWriter {
162:
163: /**
164: * Write the given heading.
165: *
166: * @param heading the heading to write.
167: */
168: public void writeHeader(String heading);
169:
170: /**
171: * Write a warning that no serializable methods exist.
172: *
173: * @param msg the warning to print.
174: */
175: public void writeNoCustomizationMsg(String msg);
176:
177: /**
178: * Write the header.
179: *
180: * @param member the member to write the header for.
181: */
182: public void writeMemberHeader(MethodDoc member);
183:
184: /**
185: * Write the footer.
186: *
187: * @param member the member to write the header for.
188: */
189: public void writeMemberFooter(MethodDoc member);
190:
191: /**
192: * Write the deprecated information for this member.
193: */
194: public void writeDeprecatedMemberInfo(MethodDoc member);
195:
196: /**
197: * Write the description for this member.
198: */
199: public void writeMemberDescription(MethodDoc member);
200:
201: /**
202: * Write the tag information for this member.
203: */
204: public void writeMemberTags(MethodDoc member);
205: }
206: }
|