Thu, 31 Aug 2017 15:17:03 +0800
merge
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package com.sun.tools.doclets.internal.toolkit; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import com.sun.javadoc.*; |
aoqi@0 | 29 | import com.sun.tools.javac.jvm.Profile; |
aoqi@0 | 30 | import com.sun.tools.doclets.internal.toolkit.util.*; |
aoqi@0 | 31 | |
aoqi@0 | 32 | /** |
aoqi@0 | 33 | * The interface for a factory creates writers. |
aoqi@0 | 34 | * |
aoqi@0 | 35 | * <p><b>This is NOT part of any supported API. |
aoqi@0 | 36 | * If you write code that depends on this, you do so at your own risk. |
aoqi@0 | 37 | * This code and its internal interfaces are subject to change or |
aoqi@0 | 38 | * deletion without notice.</b> |
aoqi@0 | 39 | * |
aoqi@0 | 40 | * @author Jamie Ho |
aoqi@0 | 41 | * @since 1.4 |
aoqi@0 | 42 | */ |
aoqi@0 | 43 | |
aoqi@0 | 44 | public interface WriterFactory { |
aoqi@0 | 45 | |
aoqi@0 | 46 | /** |
aoqi@0 | 47 | * Return the writer for the constant summary. |
aoqi@0 | 48 | * |
aoqi@0 | 49 | * @return the writer for the constant summary. Return null if this |
aoqi@0 | 50 | * writer is not supported by the doclet. |
aoqi@0 | 51 | */ |
aoqi@0 | 52 | public abstract ConstantsSummaryWriter getConstantsSummaryWriter() |
aoqi@0 | 53 | throws Exception; |
aoqi@0 | 54 | |
aoqi@0 | 55 | /** |
aoqi@0 | 56 | * Return the writer for the package summary. |
aoqi@0 | 57 | * |
aoqi@0 | 58 | * @param packageDoc the package being documented. |
aoqi@0 | 59 | * @param prevPkg the previous package that was documented. |
aoqi@0 | 60 | * @param nextPkg the next package being documented. |
aoqi@0 | 61 | * @return the writer for the package summary. Return null if this |
aoqi@0 | 62 | * writer is not supported by the doclet. |
aoqi@0 | 63 | */ |
aoqi@0 | 64 | public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc |
aoqi@0 | 65 | packageDoc, PackageDoc prevPkg, PackageDoc nextPkg) |
aoqi@0 | 66 | throws Exception; |
aoqi@0 | 67 | |
aoqi@0 | 68 | /** |
aoqi@0 | 69 | * Return the writer for the profile summary. |
aoqi@0 | 70 | * |
aoqi@0 | 71 | * @param profile the profile being documented. |
aoqi@0 | 72 | * @param prevProfile the previous profile that was documented. |
aoqi@0 | 73 | * @param nextProfile the next profile being documented. |
aoqi@0 | 74 | * @return the writer for the profile summary. Return null if this |
aoqi@0 | 75 | * writer is not supported by the doclet. |
aoqi@0 | 76 | */ |
aoqi@0 | 77 | public abstract ProfileSummaryWriter getProfileSummaryWriter(Profile |
aoqi@0 | 78 | profile, Profile prevProfile, Profile nextProfile) |
aoqi@0 | 79 | throws Exception; |
aoqi@0 | 80 | |
aoqi@0 | 81 | /** |
aoqi@0 | 82 | * Return the writer for the profile package summary. |
aoqi@0 | 83 | * |
aoqi@0 | 84 | * @param packageDoc the profile package being documented. |
aoqi@0 | 85 | * @param prevPkg the previous profile package that was documented. |
aoqi@0 | 86 | * @param nextPkg the next profile package being documented. |
aoqi@0 | 87 | * @param profile the profile being documented. |
aoqi@0 | 88 | * @return the writer for the profile package summary. Return null if this |
aoqi@0 | 89 | * writer is not supported by the doclet. |
aoqi@0 | 90 | */ |
aoqi@0 | 91 | public abstract ProfilePackageSummaryWriter getProfilePackageSummaryWriter( |
aoqi@0 | 92 | PackageDoc packageDoc, PackageDoc prevPkg, PackageDoc nextPkg, |
aoqi@0 | 93 | Profile profile) throws Exception; |
aoqi@0 | 94 | |
aoqi@0 | 95 | /** |
aoqi@0 | 96 | * Return the writer for a class. |
aoqi@0 | 97 | * |
aoqi@0 | 98 | * @param classDoc the class being documented. |
aoqi@0 | 99 | * @param prevClass the previous class that was documented. |
aoqi@0 | 100 | * @param nextClass the next class being documented. |
aoqi@0 | 101 | * @param classTree the class tree. |
aoqi@0 | 102 | * @return the writer for the class. Return null if this |
aoqi@0 | 103 | * writer is not supported by the doclet. |
aoqi@0 | 104 | */ |
aoqi@0 | 105 | public abstract ClassWriter getClassWriter(ClassDoc classDoc, |
aoqi@0 | 106 | ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) |
aoqi@0 | 107 | throws Exception; |
aoqi@0 | 108 | |
aoqi@0 | 109 | /** |
aoqi@0 | 110 | * Return the writer for an annotation type. |
aoqi@0 | 111 | * |
aoqi@0 | 112 | * @param annotationType the type being documented. |
aoqi@0 | 113 | * @param prevType the previous type that was documented. |
aoqi@0 | 114 | * @param nextType the next type being documented. |
aoqi@0 | 115 | * @return the writer for the annotation type. Return null if this |
aoqi@0 | 116 | * writer is not supported by the doclet. |
aoqi@0 | 117 | */ |
aoqi@0 | 118 | public abstract AnnotationTypeWriter getAnnotationTypeWriter( |
aoqi@0 | 119 | AnnotationTypeDoc annotationType, Type prevType, Type nextType) |
aoqi@0 | 120 | throws Exception; |
aoqi@0 | 121 | |
aoqi@0 | 122 | /** |
aoqi@0 | 123 | * Return the method writer for a given class. |
aoqi@0 | 124 | * |
aoqi@0 | 125 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 126 | * @return the method writer for the give class. Return null if this |
aoqi@0 | 127 | * writer is not supported by the doclet. |
aoqi@0 | 128 | */ |
aoqi@0 | 129 | public abstract MethodWriter getMethodWriter(ClassWriter classWriter) |
aoqi@0 | 130 | throws Exception; |
aoqi@0 | 131 | |
aoqi@0 | 132 | /** |
aoqi@0 | 133 | * Return the annotation type field writer for a given annotation type. |
aoqi@0 | 134 | * |
aoqi@0 | 135 | * @param annotationTypeWriter the writer for the annotation type |
aoqi@0 | 136 | * being documented. |
aoqi@0 | 137 | * @return the member writer for the given annotation type. Return null if |
aoqi@0 | 138 | * this writer is not supported by the doclet. |
aoqi@0 | 139 | */ |
aoqi@0 | 140 | public abstract AnnotationTypeFieldWriter |
aoqi@0 | 141 | getAnnotationTypeFieldWriter( |
aoqi@0 | 142 | AnnotationTypeWriter annotationTypeWriter) throws Exception; |
aoqi@0 | 143 | |
aoqi@0 | 144 | /** |
aoqi@0 | 145 | * Return the annotation type optional member writer for a given annotation |
aoqi@0 | 146 | * type. |
aoqi@0 | 147 | * |
aoqi@0 | 148 | * @param annotationTypeWriter the writer for the annotation type |
aoqi@0 | 149 | * being documented. |
aoqi@0 | 150 | * @return the member writer for the given annotation type. Return null if |
aoqi@0 | 151 | * this writer is not supported by the doclet. |
aoqi@0 | 152 | */ |
aoqi@0 | 153 | public abstract AnnotationTypeOptionalMemberWriter |
aoqi@0 | 154 | getAnnotationTypeOptionalMemberWriter( |
aoqi@0 | 155 | AnnotationTypeWriter annotationTypeWriter) throws Exception; |
aoqi@0 | 156 | |
aoqi@0 | 157 | /** |
aoqi@0 | 158 | * Return the annotation type required member writer for a given annotation type. |
aoqi@0 | 159 | * |
aoqi@0 | 160 | * @param annotationTypeWriter the writer for the annotation type |
aoqi@0 | 161 | * being documented. |
aoqi@0 | 162 | * @return the member writer for the given annotation type. Return null if |
aoqi@0 | 163 | * this writer is not supported by the doclet. |
aoqi@0 | 164 | */ |
aoqi@0 | 165 | public abstract AnnotationTypeRequiredMemberWriter |
aoqi@0 | 166 | getAnnotationTypeRequiredMemberWriter( |
aoqi@0 | 167 | AnnotationTypeWriter annotationTypeWriter) throws Exception; |
aoqi@0 | 168 | |
aoqi@0 | 169 | /** |
aoqi@0 | 170 | * Return the enum constant writer for a given class. |
aoqi@0 | 171 | * |
aoqi@0 | 172 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 173 | * @return the enum constant writer for the give class. Return null if this |
aoqi@0 | 174 | * writer is not supported by the doclet. |
aoqi@0 | 175 | */ |
aoqi@0 | 176 | public abstract EnumConstantWriter getEnumConstantWriter( |
aoqi@0 | 177 | ClassWriter classWriter) throws Exception; |
aoqi@0 | 178 | |
aoqi@0 | 179 | /** |
aoqi@0 | 180 | * Return the field writer for a given class. |
aoqi@0 | 181 | * |
aoqi@0 | 182 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 183 | * @return the field writer for the give class. Return null if this |
aoqi@0 | 184 | * writer is not supported by the doclet. |
aoqi@0 | 185 | */ |
aoqi@0 | 186 | public abstract FieldWriter getFieldWriter(ClassWriter classWriter) |
aoqi@0 | 187 | throws Exception; |
aoqi@0 | 188 | |
aoqi@0 | 189 | /** |
aoqi@0 | 190 | * Return the property writer for a given class. |
aoqi@0 | 191 | * |
aoqi@0 | 192 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 193 | * @return the property writer for the give class. Return null if this |
aoqi@0 | 194 | * writer is not supported by the doclet. |
aoqi@0 | 195 | */ |
aoqi@0 | 196 | public abstract PropertyWriter getPropertyWriter(ClassWriter classWriter) |
aoqi@0 | 197 | throws Exception; |
aoqi@0 | 198 | |
aoqi@0 | 199 | /** |
aoqi@0 | 200 | * Return the constructor writer for a given class. |
aoqi@0 | 201 | * |
aoqi@0 | 202 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 203 | * @return the method writer for the give class. Return null if this |
aoqi@0 | 204 | * writer is not supported by the doclet. |
aoqi@0 | 205 | */ |
aoqi@0 | 206 | public abstract ConstructorWriter getConstructorWriter( |
aoqi@0 | 207 | ClassWriter classWriter) |
aoqi@0 | 208 | throws Exception; |
aoqi@0 | 209 | |
aoqi@0 | 210 | /** |
aoqi@0 | 211 | * Return the specified member summary writer for a given class. |
aoqi@0 | 212 | * |
aoqi@0 | 213 | * @param classWriter the writer for the class being documented. |
aoqi@0 | 214 | * @param memberType the {@link VisibleMemberMap} member type indicating |
aoqi@0 | 215 | * the type of member summary that should be returned. |
aoqi@0 | 216 | * @return the summary writer for the give class. Return null if this |
aoqi@0 | 217 | * writer is not supported by the doclet. |
aoqi@0 | 218 | * |
aoqi@0 | 219 | * @see VisibleMemberMap |
aoqi@0 | 220 | * @throws IllegalArgumentException if memberType is unknown. |
aoqi@0 | 221 | */ |
aoqi@0 | 222 | public abstract MemberSummaryWriter getMemberSummaryWriter( |
aoqi@0 | 223 | ClassWriter classWriter, int memberType) |
aoqi@0 | 224 | throws Exception; |
aoqi@0 | 225 | |
aoqi@0 | 226 | /** |
aoqi@0 | 227 | * Return the specified member summary writer for a given annotation type. |
aoqi@0 | 228 | * |
aoqi@0 | 229 | * @param annotationTypeWriter the writer for the annotation type being |
aoqi@0 | 230 | * documented. |
aoqi@0 | 231 | * @param memberType the {@link VisibleMemberMap} member type indicating |
aoqi@0 | 232 | * the type of member summary that should be returned. |
aoqi@0 | 233 | * @return the summary writer for the give class. Return null if this |
aoqi@0 | 234 | * writer is not supported by the doclet. |
aoqi@0 | 235 | * |
aoqi@0 | 236 | * @see VisibleMemberMap |
aoqi@0 | 237 | * @throws IllegalArgumentException if memberType is unknown. |
aoqi@0 | 238 | */ |
aoqi@0 | 239 | public abstract MemberSummaryWriter getMemberSummaryWriter( |
aoqi@0 | 240 | AnnotationTypeWriter annotationTypeWriter, int memberType) |
aoqi@0 | 241 | throws Exception; |
aoqi@0 | 242 | |
aoqi@0 | 243 | /** |
aoqi@0 | 244 | * Return the writer for the serialized form. |
aoqi@0 | 245 | * |
aoqi@0 | 246 | * @return the writer for the serialized form. |
aoqi@0 | 247 | */ |
aoqi@0 | 248 | public SerializedFormWriter getSerializedFormWriter() throws Exception; |
aoqi@0 | 249 | } |