001: /*
002: * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.doclets.formats.html;
027:
028: import com.sun.tools.doclets.internal.toolkit.*;
029: import com.sun.javadoc.*;
030:
031: import java.io.*;
032:
033: /**
034: * Writes annotation type optional member documentation in HTML format.
035: *
036: * @author Jamie Ho
037: */
038: public class AnnotationTypeOptionalMemberWriterImpl extends
039: AnnotationTypeRequiredMemberWriterImpl implements
040: AnnotationTypeOptionalMemberWriter, MemberSummaryWriter {
041:
042: /**
043: * Construct a new AnnotationTypeOptionalMemberWriterImpl.
044: *
045: * @param writer the writer that will write the output.
046: * @param annotationType the AnnotationType that holds this member.
047: */
048: public AnnotationTypeOptionalMemberWriterImpl(
049: SubWriterHolderWriter writer,
050: AnnotationTypeDoc annotationType) {
051: super (writer, annotationType);
052: }
053:
054: /**
055: * {@inheritDoc}
056: */
057: public void writeMemberSummaryHeader(ClassDoc classDoc) {
058: writer
059: .println("<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->");
060: writer.println();
061: writer.printSummaryHeader(this , classDoc);
062: }
063:
064: /**
065: * {@inheritDoc}
066: */
067: public void writeDefaultValueInfo(MemberDoc member) {
068: writer.dl();
069: writer.dt();
070: writer.bold(ConfigurationImpl.getInstance().getText(
071: "doclet.Default"));
072: writer.dd();
073: writer
074: .print(((AnnotationTypeElementDoc) member)
075: .defaultValue());
076: writer.ddEnd();
077: writer.dlEnd();
078: }
079:
080: /**
081: * {@inheritDoc}
082: */
083: public void close() throws IOException {
084: writer.close();
085: }
086:
087: /**
088: * {@inheritDoc}
089: */
090: public void printSummaryLabel(ClassDoc cd) {
091: writer
092: .boldText("doclet.Annotation_Type_Optional_Member_Summary");
093: }
094:
095: /**
096: * {@inheritDoc}
097: */
098: public void printSummaryAnchor(ClassDoc cd) {
099: writer.anchor("annotation_type_optional_element_summary");
100: }
101:
102: /**
103: * {@inheritDoc}
104: */
105: protected void printNavSummaryLink(ClassDoc cd, boolean link) {
106: if (link) {
107: writer.printHyperLink("",
108: "annotation_type_optional_element_summary",
109: configuration().getText(
110: "doclet.navAnnotationTypeOptionalMember"));
111: } else {
112: writer.printText("doclet.navAnnotationTypeOptionalMember");
113: }
114: }
115: }
|