src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java

Mon, 09 Mar 2009 23:53:41 -0700

author
tbell
date
Mon, 09 Mar 2009 23:53:41 -0700
changeset 240
8c55d5b0ed71
parent 233
5240b1120530
child 243
edd944553131
permissions
-rw-r--r--

Merge

duke@1 1 /*
duke@1 2 * Copyright 2003-2004 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.formats.html;
duke@1 27
bpatel@233 28 import java.io.*;
bpatel@233 29
bpatel@233 30 import com.sun.javadoc.*;
duke@1 31 import com.sun.tools.doclets.internal.toolkit.*;
duke@1 32
duke@1 33 /**
duke@1 34 * Writes annotation type optional member documentation in HTML format.
duke@1 35 *
duke@1 36 * @author Jamie Ho
duke@1 37 */
duke@1 38 public class AnnotationTypeOptionalMemberWriterImpl extends
duke@1 39 AnnotationTypeRequiredMemberWriterImpl
duke@1 40 implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter {
duke@1 41
duke@1 42 /**
duke@1 43 * Construct a new AnnotationTypeOptionalMemberWriterImpl.
duke@1 44 *
duke@1 45 * @param writer the writer that will write the output.
duke@1 46 * @param annotationType the AnnotationType that holds this member.
duke@1 47 */
duke@1 48 public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer,
duke@1 49 AnnotationTypeDoc annotationType) {
duke@1 50 super(writer, annotationType);
duke@1 51 }
duke@1 52
duke@1 53 /**
duke@1 54 * {@inheritDoc}
duke@1 55 */
duke@1 56 public void writeMemberSummaryHeader(ClassDoc classDoc) {
duke@1 57 writer.println("<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->");
duke@1 58 writer.println();
duke@1 59 writer.printSummaryHeader(this, classDoc);
duke@1 60 }
duke@1 61
duke@1 62 /**
duke@1 63 * {@inheritDoc}
duke@1 64 */
duke@1 65 public void writeDefaultValueInfo(MemberDoc member) {
bpatel@233 66 if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
bpatel@233 67 writer.printMemberDetailsListStartTag();
bpatel@233 68 writer.dd();
bpatel@233 69 writer.dl();
bpatel@233 70 writer.dt();
bpatel@233 71 writer.strong(ConfigurationImpl.getInstance().
bpatel@233 72 getText("doclet.Default"));
bpatel@233 73 writer.dtEnd();
bpatel@233 74 writer.dd();
bpatel@233 75 writer.print(((AnnotationTypeElementDoc) member).defaultValue());
bpatel@233 76 writer.ddEnd();
bpatel@233 77 writer.dlEnd();
bpatel@233 78 writer.ddEnd();
bpatel@233 79 }
duke@1 80 }
duke@1 81
duke@1 82 /**
duke@1 83 * {@inheritDoc}
duke@1 84 */
duke@1 85 public void close() throws IOException {
duke@1 86 writer.close();
duke@1 87 }
duke@1 88
duke@1 89 /**
duke@1 90 * {@inheritDoc}
duke@1 91 */
duke@1 92 public void printSummaryLabel(ClassDoc cd) {
bpatel@182 93 writer.strongText("doclet.Annotation_Type_Optional_Member_Summary");
duke@1 94 }
duke@1 95
duke@1 96 /**
duke@1 97 * {@inheritDoc}
duke@1 98 */
duke@1 99 public void printSummaryAnchor(ClassDoc cd) {
duke@1 100 writer.anchor("annotation_type_optional_element_summary");
duke@1 101 }
duke@1 102
duke@1 103 /**
duke@1 104 * {@inheritDoc}
duke@1 105 */
duke@1 106 protected void printNavSummaryLink(ClassDoc cd, boolean link) {
duke@1 107 if (link) {
duke@1 108 writer.printHyperLink("", "annotation_type_optional_element_summary",
duke@1 109 configuration().getText("doclet.navAnnotationTypeOptionalMember"));
duke@1 110 } else {
duke@1 111 writer.printText("doclet.navAnnotationTypeOptionalMember");
duke@1 112 }
duke@1 113 }
duke@1 114 }

mercurial