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

Tue, 20 Jan 2009 15:17:45 -0800

author
jjg
date
Tue, 20 Jan 2009 15:17:45 -0800
changeset 197
1bf037016426
parent 182
47a62d8d98b4
child 233
5240b1120530
permissions
-rw-r--r--

6794582: javadoc should read files using a FileManager
Reviewed-by: darcy, bpatel

     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 com.sun.tools.doclets.internal.toolkit.*;
    29 import com.sun.javadoc.*;
    31 import java.io.*;
    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         writer.dl();
    67         writer.dt();
    68         writer.strong(ConfigurationImpl.getInstance().
    69             getText("doclet.Default"));
    70         writer.dd();
    71         writer.print(((AnnotationTypeElementDoc) member).defaultValue());
    72         writer.ddEnd();
    73         writer.dlEnd();
    74     }
    76     /**
    77      * {@inheritDoc}
    78      */
    79     public void close() throws IOException {
    80         writer.close();
    81     }
    83     /**
    84      * {@inheritDoc}
    85      */
    86     public void printSummaryLabel(ClassDoc cd) {
    87         writer.strongText("doclet.Annotation_Type_Optional_Member_Summary");
    88     }
    90     /**
    91      * {@inheritDoc}
    92      */
    93     public void printSummaryAnchor(ClassDoc cd) {
    94         writer.anchor("annotation_type_optional_element_summary");
    95     }
    97     /**
    98      * {@inheritDoc}
    99      */
   100     protected void printNavSummaryLink(ClassDoc cd, boolean link) {
   101         if (link) {
   102             writer.printHyperLink("", "annotation_type_optional_element_summary",
   103                     configuration().getText("doclet.navAnnotationTypeOptionalMember"));
   104         } else {
   105             writer.printText("doclet.navAnnotationTypeOptionalMember");
   106         }
   107     }
   108 }

mercurial