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