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

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
9a66ca7c79fa
child 554
9d9f26857129
permissions
-rw-r--r--

Initial load

duke@1 1 /*
duke@1 2 * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation. Sun designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
duke@1 9 * by Sun in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
duke@1 21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 22 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 23 * have any questions.
duke@1 24 */
duke@1 25
duke@1 26 package com.sun.tools.doclets.internal.toolkit;
duke@1 27
duke@1 28 import com.sun.tools.doclets.internal.toolkit.util.*;
duke@1 29 import com.sun.javadoc.*;
duke@1 30
duke@1 31 /**
duke@1 32 * The interface for a factory creates writers.
duke@1 33 *
duke@1 34 * This code is not part of an API.
duke@1 35 * It is implementation that is subject to change.
duke@1 36 * Do not use it as an API
duke@1 37 *
duke@1 38 * @author Jamie Ho
duke@1 39 * @since 1.4
duke@1 40 */
duke@1 41
duke@1 42 public interface WriterFactory {
duke@1 43
duke@1 44 /**
duke@1 45 * Return the writer for the constant summary.
duke@1 46 *
duke@1 47 * @return the writer for the constant summary. Return null if this
duke@1 48 * writer is not supported by the doclet.
duke@1 49 */
duke@1 50 public abstract ConstantsSummaryWriter getConstantsSummaryWriter()
duke@1 51 throws Exception;
duke@1 52
duke@1 53 /**
duke@1 54 * Return the writer for the package summary.
duke@1 55 *
duke@1 56 * @param packageDoc the package being documented.
duke@1 57 * @param prevPkg the previous package that was documented.
duke@1 58 * @param nextPkg the next package being documented.
duke@1 59 * @return the writer for the package summary. Return null if this
duke@1 60 * writer is not supported by the doclet.
duke@1 61 */
duke@1 62 public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc
duke@1 63 packageDoc, PackageDoc prevPkg, PackageDoc nextPkg)
duke@1 64 throws Exception;
duke@1 65
duke@1 66 /**
duke@1 67 * Return the writer for a class.
duke@1 68 *
duke@1 69 * @param classDoc the class being documented.
duke@1 70 * @param prevClass the previous class that was documented.
duke@1 71 * @param nextClass the next class being documented.
duke@1 72 * @param classTree the class tree.
duke@1 73 * @return the writer for the class. Return null if this
duke@1 74 * writer is not supported by the doclet.
duke@1 75 */
duke@1 76 public abstract ClassWriter getClassWriter(ClassDoc classDoc,
duke@1 77 ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
duke@1 78 throws Exception;
duke@1 79
duke@1 80 /**
duke@1 81 * Return the writer for an annotation type.
duke@1 82 *
duke@1 83 * @param annotationType the type being documented.
duke@1 84 * @param prevType the previous type that was documented.
duke@1 85 * @param nextType the next type being documented.
duke@1 86 * @return the writer for the annotation type. Return null if this
duke@1 87 * writer is not supported by the doclet.
duke@1 88 */
duke@1 89 public abstract AnnotationTypeWriter getAnnotationTypeWriter(
duke@1 90 AnnotationTypeDoc annotationType, Type prevType, Type nextType)
duke@1 91 throws Exception;
duke@1 92
duke@1 93 /**
duke@1 94 * Return the method writer for a given class.
duke@1 95 *
duke@1 96 * @param classWriter the writer for the class being documented.
duke@1 97 * @return the method writer for the give class. Return null if this
duke@1 98 * writer is not supported by the doclet.
duke@1 99 */
duke@1 100 public abstract MethodWriter getMethodWriter(ClassWriter classWriter)
duke@1 101 throws Exception;
duke@1 102
duke@1 103 /**
duke@1 104 * Return the annotation type optional member writer for a given annotation
duke@1 105 * type.
duke@1 106 *
duke@1 107 * @param annotationTypeWriter the writer for the annotation type
duke@1 108 * being documented.
duke@1 109 * @return the member writer for the given annotation type. Return null if
duke@1 110 * this writer is not supported by the doclet.
duke@1 111 */
duke@1 112 public abstract AnnotationTypeOptionalMemberWriter
duke@1 113 getAnnotationTypeOptionalMemberWriter(
duke@1 114 AnnotationTypeWriter annotationTypeWriter) throws Exception;
duke@1 115
duke@1 116 /**
duke@1 117 * Return the annotation type required member writer for a given annotation type.
duke@1 118 *
duke@1 119 * @param annotationTypeWriter the writer for the annotation type
duke@1 120 * being documented.
duke@1 121 * @return the member writer for the given annotation type. Return null if
duke@1 122 * this writer is not supported by the doclet.
duke@1 123 */
duke@1 124 public abstract AnnotationTypeRequiredMemberWriter
duke@1 125 getAnnotationTypeRequiredMemberWriter(
duke@1 126 AnnotationTypeWriter annotationTypeWriter) throws Exception;
duke@1 127
duke@1 128 /**
duke@1 129 * Return the enum constant writer for a given class.
duke@1 130 *
duke@1 131 * @param classWriter the writer for the class being documented.
duke@1 132 * @return the enum constant writer for the give class. Return null if this
duke@1 133 * writer is not supported by the doclet.
duke@1 134 */
duke@1 135 public abstract EnumConstantWriter getEnumConstantWriter(
duke@1 136 ClassWriter classWriter) throws Exception;
duke@1 137
duke@1 138 /**
duke@1 139 * Return the field writer for a given class.
duke@1 140 *
duke@1 141 * @param classWriter the writer for the class being documented.
duke@1 142 * @return the field writer for the give class. Return null if this
duke@1 143 * writer is not supported by the doclet.
duke@1 144 */
duke@1 145 public abstract FieldWriter getFieldWriter(ClassWriter classWriter)
duke@1 146 throws Exception;
duke@1 147
duke@1 148 /**
duke@1 149 * Return the constructor writer for a given class.
duke@1 150 *
duke@1 151 * @param classWriter the writer for the class being documented.
duke@1 152 * @return the method writer for the give class. Return null if this
duke@1 153 * writer is not supported by the doclet.
duke@1 154 */
duke@1 155 public abstract ConstructorWriter getConstructorWriter(
duke@1 156 ClassWriter classWriter)
duke@1 157 throws Exception;
duke@1 158
duke@1 159 /**
duke@1 160 * Return the specified member summary writer for a given class.
duke@1 161 *
duke@1 162 * @param classWriter the writer for the class being documented.
duke@1 163 * @param memberType the {@link VisibleMemberMap} member type indicating
duke@1 164 * the type of member summary that should be returned.
duke@1 165 * @return the summary writer for the give class. Return null if this
duke@1 166 * writer is not supported by the doclet.
duke@1 167 *
duke@1 168 * @see VisibleMemberMap
duke@1 169 * @throws IllegalArgumentException if memberType is unknown.
duke@1 170 */
duke@1 171 public abstract MemberSummaryWriter getMemberSummaryWriter(
duke@1 172 ClassWriter classWriter, int memberType)
duke@1 173 throws Exception;
duke@1 174
duke@1 175 /**
duke@1 176 * Return the specified member summary writer for a given annotation type.
duke@1 177 *
duke@1 178 * @param annotationTypeWriter the writer for the annotation type being
duke@1 179 * documented.
duke@1 180 * @param memberType the {@link VisibleMemberMap} member type indicating
duke@1 181 * the type of member summary that should be returned.
duke@1 182 * @return the summary writer for the give class. Return null if this
duke@1 183 * writer is not supported by the doclet.
duke@1 184 *
duke@1 185 * @see VisibleMemberMap
duke@1 186 * @throws IllegalArgumentException if memberType is unknown.
duke@1 187 */
duke@1 188 public abstract MemberSummaryWriter getMemberSummaryWriter(
duke@1 189 AnnotationTypeWriter annotationTypeWriter, int memberType)
duke@1 190 throws Exception;
duke@1 191
duke@1 192 /**
duke@1 193 * Return the writer for the serialized form.
duke@1 194 *
duke@1 195 * @return the writer for the serialized form.
duke@1 196 */
duke@1 197 public SerializedFormWriter getSerializedFormWriter() throws Exception;
duke@1 198 }

mercurial