duke@1: /* duke@1: * Copyright 2003-2004 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.formats.html; duke@1: bpatel@233: import java.io.*; bpatel@233: bpatel@233: import com.sun.javadoc.*; duke@1: import com.sun.tools.doclets.internal.toolkit.*; duke@1: duke@1: /** duke@1: * Writes annotation type optional member documentation in HTML format. duke@1: * duke@1: * @author Jamie Ho duke@1: */ duke@1: public class AnnotationTypeOptionalMemberWriterImpl extends duke@1: AnnotationTypeRequiredMemberWriterImpl duke@1: implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter { duke@1: duke@1: /** duke@1: * Construct a new AnnotationTypeOptionalMemberWriterImpl. duke@1: * duke@1: * @param writer the writer that will write the output. duke@1: * @param annotationType the AnnotationType that holds this member. duke@1: */ duke@1: public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer, duke@1: AnnotationTypeDoc annotationType) { duke@1: super(writer, annotationType); duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: public void writeMemberSummaryHeader(ClassDoc classDoc) { duke@1: writer.println(""); duke@1: writer.println(); duke@1: writer.printSummaryHeader(this, classDoc); duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: public void writeDefaultValueInfo(MemberDoc member) { bpatel@233: if (((AnnotationTypeElementDoc) member).defaultValue() != null) { bpatel@233: writer.printMemberDetailsListStartTag(); bpatel@233: writer.dd(); bpatel@233: writer.dl(); bpatel@233: writer.dt(); bpatel@233: writer.strong(ConfigurationImpl.getInstance(). bpatel@233: getText("doclet.Default")); bpatel@233: writer.dtEnd(); bpatel@233: writer.dd(); bpatel@233: writer.print(((AnnotationTypeElementDoc) member).defaultValue()); bpatel@233: writer.ddEnd(); bpatel@233: writer.dlEnd(); bpatel@233: writer.ddEnd(); bpatel@233: } duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: public void close() throws IOException { duke@1: writer.close(); duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: public void printSummaryLabel(ClassDoc cd) { bpatel@182: writer.strongText("doclet.Annotation_Type_Optional_Member_Summary"); duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: public void printSummaryAnchor(ClassDoc cd) { duke@1: writer.anchor("annotation_type_optional_element_summary"); duke@1: } duke@1: duke@1: /** duke@1: * {@inheritDoc} duke@1: */ duke@1: protected void printNavSummaryLink(ClassDoc cd, boolean link) { duke@1: if (link) { duke@1: writer.printHyperLink("", "annotation_type_optional_element_summary", duke@1: configuration().getText("doclet.navAnnotationTypeOptionalMember")); duke@1: } else { duke@1: writer.printText("doclet.navAnnotationTypeOptionalMember"); duke@1: } duke@1: } duke@1: }