Mon, 09 Mar 2009 23:53:41 -0700
Merge
1 /*
2 * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
26 package com.sun.tools.doclets.formats.html;
28 import java.io.*;
30 import com.sun.javadoc.*;
31 import com.sun.tools.doclets.internal.toolkit.*;
33 /**
34 * Writes annotation type optional member documentation in HTML format.
35 *
36 * @author Jamie Ho
37 */
38 public class AnnotationTypeOptionalMemberWriterImpl extends
39 AnnotationTypeRequiredMemberWriterImpl
40 implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter {
42 /**
43 * Construct a new AnnotationTypeOptionalMemberWriterImpl.
44 *
45 * @param writer the writer that will write the output.
46 * @param annotationType the AnnotationType that holds this member.
47 */
48 public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer,
49 AnnotationTypeDoc annotationType) {
50 super(writer, annotationType);
51 }
53 /**
54 * {@inheritDoc}
55 */
56 public void writeMemberSummaryHeader(ClassDoc classDoc) {
57 writer.println("<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->");
58 writer.println();
59 writer.printSummaryHeader(this, classDoc);
60 }
62 /**
63 * {@inheritDoc}
64 */
65 public void writeDefaultValueInfo(MemberDoc member) {
66 if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
67 writer.printMemberDetailsListStartTag();
68 writer.dd();
69 writer.dl();
70 writer.dt();
71 writer.strong(ConfigurationImpl.getInstance().
72 getText("doclet.Default"));
73 writer.dtEnd();
74 writer.dd();
75 writer.print(((AnnotationTypeElementDoc) member).defaultValue());
76 writer.ddEnd();
77 writer.dlEnd();
78 writer.ddEnd();
79 }
80 }
82 /**
83 * {@inheritDoc}
84 */
85 public void close() throws IOException {
86 writer.close();
87 }
89 /**
90 * {@inheritDoc}
91 */
92 public void printSummaryLabel(ClassDoc cd) {
93 writer.strongText("doclet.Annotation_Type_Optional_Member_Summary");
94 }
96 /**
97 * {@inheritDoc}
98 */
99 public void printSummaryAnchor(ClassDoc cd) {
100 writer.anchor("annotation_type_optional_element_summary");
101 }
103 /**
104 * {@inheritDoc}
105 */
106 protected void printNavSummaryLink(ClassDoc cd, boolean link) {
107 if (link) {
108 writer.printHyperLink("", "annotation_type_optional_element_summary",
109 configuration().getText("doclet.navAnnotationTypeOptionalMember"));
110 } else {
111 writer.printText("doclet.navAnnotationTypeOptionalMember");
112 }
113 }
114 }