duke@1: /* duke@1: * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as duke@1: * published by the Free Software Foundation. Sun designates this duke@1: * particular file as subject to the "Classpath" exception as provided duke@1: * by Sun in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * duke@1: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@1: * CA 95054 USA or visit www.sun.com if you need additional information or duke@1: * have any questions. duke@1: */ duke@1: duke@1: package com.sun.tools.doclets.internal.toolkit; duke@1: duke@1: import com.sun.tools.doclets.internal.toolkit.util.*; duke@1: import com.sun.javadoc.*; duke@1: duke@1: /** duke@1: * The interface for a factory creates writers. duke@1: * duke@1: * This code is not part of an API. duke@1: * It is implementation that is subject to change. duke@1: * Do not use it as an API duke@1: * duke@1: * @author Jamie Ho duke@1: * @since 1.4 duke@1: */ duke@1: duke@1: public interface WriterFactory { duke@1: duke@1: /** duke@1: * Return the writer for the constant summary. duke@1: * duke@1: * @return the writer for the constant summary. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract ConstantsSummaryWriter getConstantsSummaryWriter() duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the writer for the package summary. duke@1: * duke@1: * @param packageDoc the package being documented. duke@1: * @param prevPkg the previous package that was documented. duke@1: * @param nextPkg the next package being documented. duke@1: * @return the writer for the package summary. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc duke@1: packageDoc, PackageDoc prevPkg, PackageDoc nextPkg) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the writer for a class. duke@1: * duke@1: * @param classDoc the class being documented. duke@1: * @param prevClass the previous class that was documented. duke@1: * @param nextClass the next class being documented. duke@1: * @param classTree the class tree. duke@1: * @return the writer for the class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract ClassWriter getClassWriter(ClassDoc classDoc, duke@1: ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the writer for an annotation type. duke@1: * duke@1: * @param annotationType the type being documented. duke@1: * @param prevType the previous type that was documented. duke@1: * @param nextType the next type being documented. duke@1: * @return the writer for the annotation type. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract AnnotationTypeWriter getAnnotationTypeWriter( duke@1: AnnotationTypeDoc annotationType, Type prevType, Type nextType) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the method writer for a given class. duke@1: * duke@1: * @param classWriter the writer for the class being documented. duke@1: * @return the method writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract MethodWriter getMethodWriter(ClassWriter classWriter) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the annotation type optional member writer for a given annotation duke@1: * type. duke@1: * duke@1: * @param annotationTypeWriter the writer for the annotation type duke@1: * being documented. duke@1: * @return the member writer for the given annotation type. Return null if duke@1: * this writer is not supported by the doclet. duke@1: */ duke@1: public abstract AnnotationTypeOptionalMemberWriter duke@1: getAnnotationTypeOptionalMemberWriter( duke@1: AnnotationTypeWriter annotationTypeWriter) throws Exception; duke@1: duke@1: /** duke@1: * Return the annotation type required member writer for a given annotation type. duke@1: * duke@1: * @param annotationTypeWriter the writer for the annotation type duke@1: * being documented. duke@1: * @return the member writer for the given annotation type. Return null if duke@1: * this writer is not supported by the doclet. duke@1: */ duke@1: public abstract AnnotationTypeRequiredMemberWriter duke@1: getAnnotationTypeRequiredMemberWriter( duke@1: AnnotationTypeWriter annotationTypeWriter) throws Exception; duke@1: duke@1: /** duke@1: * Return the enum constant writer for a given class. duke@1: * duke@1: * @param classWriter the writer for the class being documented. duke@1: * @return the enum constant writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract EnumConstantWriter getEnumConstantWriter( duke@1: ClassWriter classWriter) throws Exception; duke@1: duke@1: /** duke@1: * Return the field writer for a given class. duke@1: * duke@1: * @param classWriter the writer for the class being documented. duke@1: * @return the field writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract FieldWriter getFieldWriter(ClassWriter classWriter) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the constructor writer for a given class. duke@1: * duke@1: * @param classWriter the writer for the class being documented. duke@1: * @return the method writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: */ duke@1: public abstract ConstructorWriter getConstructorWriter( duke@1: ClassWriter classWriter) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the specified member summary writer for a given class. duke@1: * duke@1: * @param classWriter the writer for the class being documented. duke@1: * @param memberType the {@link VisibleMemberMap} member type indicating duke@1: * the type of member summary that should be returned. duke@1: * @return the summary writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: * duke@1: * @see VisibleMemberMap duke@1: * @throws IllegalArgumentException if memberType is unknown. duke@1: */ duke@1: public abstract MemberSummaryWriter getMemberSummaryWriter( duke@1: ClassWriter classWriter, int memberType) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the specified member summary writer for a given annotation type. duke@1: * duke@1: * @param annotationTypeWriter the writer for the annotation type being duke@1: * documented. duke@1: * @param memberType the {@link VisibleMemberMap} member type indicating duke@1: * the type of member summary that should be returned. duke@1: * @return the summary writer for the give class. Return null if this duke@1: * writer is not supported by the doclet. duke@1: * duke@1: * @see VisibleMemberMap duke@1: * @throws IllegalArgumentException if memberType is unknown. duke@1: */ duke@1: public abstract MemberSummaryWriter getMemberSummaryWriter( duke@1: AnnotationTypeWriter annotationTypeWriter, int memberType) duke@1: throws Exception; duke@1: duke@1: /** duke@1: * Return the writer for the serialized form. duke@1: * duke@1: * @return the writer for the serialized form. duke@1: */ duke@1: public SerializedFormWriter getSerializedFormWriter() throws Exception; duke@1: }