langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
author bpatel
Wed, 18 Sep 2013 17:13:26 -0700
changeset 20237 b6d89903c867
parent 19253 b97b3e18547f
child 21008 af0b915df7cc
permissions -rw-r--r--
8015249: javadoc fails to document static final fields in annotation types Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 14542
diff changeset
     2
 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
10
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
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
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
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    23
 * questions.
10
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
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    28
import java.io.*;
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    29
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.javadoc.*;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    31
import com.sun.tools.doclets.formats.html.markup.*;
2216
b124d5c924eb 6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents: 1787
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * Writes annotation type required member documentation in HTML format.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    37
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    38
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    39
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    40
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 7681
diff changeset
    41
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Jamie Ho
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
    43
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
    implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     * Construct a new AnnotationTypeRequiredMemberWriterImpl.
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * @param writer         the writer that will write the output.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * @param annotationType the AnnotationType that holds this member.
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
    public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer,
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
    55
            AnnotationTypeDoc annotationType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
        super(writer, annotationType);
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    60
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    62
    public Content getMemberSummaryHeader(ClassDoc classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    63
            Content memberSummaryTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    64
        memberSummaryTree.addContent(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    65
                HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    66
        Content memberTree = writer.getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    67
        writer.addSummaryHeader(this, classDoc, memberTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    68
        return memberTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     */
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    74
    public Content getMemberTreeHeader() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    75
        return writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    76
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    77
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    78
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    79
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    80
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    81
    public void addAnnotationDetailsMarker(Content memberDetails) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    82
        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    83
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    84
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    85
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    86
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 19253
diff changeset
    87
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    88
    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    89
            Content memberDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    90
        if (!writer.printedAnnotationHeading) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    91
            memberDetailsTree.addContent(writer.getMarkerAnchor(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    92
                    "annotation_type_element_detail"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    93
            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    94
                    writer.annotationTypeDetailsLabel);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    95
            memberDetailsTree.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    96
            writer.printedAnnotationHeading = true;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    97
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   103
    public Content getAnnotationDocTreeHeader(MemberDoc member,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   104
            Content annotationDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   105
        annotationDetailsTree.addContent(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   106
                writer.getMarkerAnchor(member.name() +
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   107
                ((ExecutableMemberDoc) member).signature()));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   108
        Content annotationDocTree = writer.getMemberTreeHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   109
        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   110
        heading.addContent(member.name());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   111
        annotationDocTree.addContent(heading);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   112
        return annotationDocTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   118
    public Content getSignature(MemberDoc member) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   119
        Content pre = new HtmlTree(HtmlTag.PRE);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   120
        writer.addAnnotationInfo(member, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   121
        addModifiers(member, pre);
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   122
        Content link =
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   123
                writer.getLink(new LinkInfoImpl(configuration,
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   124
                        LinkInfoImpl.Kind.MEMBER, getType(member)));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   125
        pre.addContent(link);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   126
        pre.addContent(writer.getSpace());
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   127
        if (configuration.linksource) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   128
            Content memberName = new StringContent(member.name());
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
            writer.addSrcLink(member, memberName, pre);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   130
        } else {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
            addName(member.name(), pre);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   133
        return pre;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   139
    public void addDeprecated(MemberDoc member, Content annotationDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
        addDeprecatedInfo(member, annotationDocTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   141
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   142
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   143
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   144
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   145
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   146
    public void addComments(MemberDoc member, Content annotationDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   147
        addComment(member, annotationDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   153
    public void addTags(MemberDoc member, Content annotationDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   154
        writer.addTagsInfo(member, annotationDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   158
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   160
    public Content getAnnotationDetails(Content annotationDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   161
        return getMemberTree(annotationDetailsTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   165
     * {@inheritDoc}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   167
    public Content getAnnotationDoc(Content annotationDocTree,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   168
            boolean isLastContent) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   169
        return getMemberTree(annotationDocTree, isLastContent);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     * Close the writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
    public void close() throws IOException {
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        writer.close();
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   182
    public void addSummaryLabel(Content memberTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   183
        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   184
                writer.getResource("doclet.Annotation_Type_Required_Member_Summary"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   185
        memberTree.addContent(label);
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   186
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   187
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   188
    /**
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   189
     * {@inheritDoc}
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   190
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   191
    public String getTableSummary() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   192
        return configuration.getText("doclet.Member_Table_Summary",
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   193
                configuration.getText("doclet.Annotation_Type_Required_Member_Summary"),
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   194
                configuration.getText("doclet.annotation_type_required_members"));
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   195
    }
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   196
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   197
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   198
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   199
     */
17570
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17559
diff changeset
   200
    public Content getCaption() {
78512b2899db 8012183: replace some uses of Configuration.getText with Configuration.getResource
jjg
parents: 17559
diff changeset
   201
        return configuration.getResource("doclet.Annotation_Type_Required_Members");
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   202
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   203
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   204
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   205
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   206
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   207
    public String[] getSummaryTableHeader(ProgramElementDoc member) {
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   208
        String[] header = new String[] {
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   209
            writer.getModifierTypeHeader(),
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   210
            configuration.getText("doclet.0_and_1",
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   211
                    configuration.getText("doclet.Annotation_Type_Required_Member"),
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14357
diff changeset
   212
                    configuration.getText("doclet.Description"))
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 2216
diff changeset
   213
        };
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   214
        return header;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   220
    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   221
        memberTree.addContent(writer.getMarkerAnchor(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   222
                "annotation_type_required_element_summary"));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   223
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   224
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   225
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   226
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   227
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   228
    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   234
    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     */
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 14542
diff changeset
   240
    protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   241
            Content tdSummary) {
19253
b97b3e18547f 7198274: RFE : Javadoc Accessibility : Use CSS styles rather than <strong> or <i> tags
bpatel
parents: 17570
diff changeset
   242
        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
17559
87c28ee29329 8011642: Remove LinkOutput in favor of direct use of Content
jjg
parents: 17558
diff changeset
   243
                writer.getDocLink(context, (MemberDoc) member, member.name(), false));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   244
        Content code = HtmlTree.CODE(strong);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   245
        tdSummary.addContent(code);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   251
    protected void addInheritedSummaryLink(ClassDoc cd,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   252
            ProgramElementDoc member, Content linksTree) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
        //Not applicable.
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   259
    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
        MemberDoc m = (MemberDoc)member;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   261
        addModifierAndType(m, getType(m), tdSummaryType);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   267
    protected Content getDeprecatedLink(ProgramElementDoc member) {
17558
eee4ccf66cfd 8010440: Replace int constants in LinkInfoImpl with enum
jjg
parents: 14542
diff changeset
   268
        return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   269
                (MemberDoc) member, ((MemberDoc)member).qualifiedName());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   275
    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        if (link) {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   277
            return writer.getHyperLink("annotation_type_required_element_summary",
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   278
                    writer.getResource("doclet.navAnnotationTypeRequiredMember"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   280
            return writer.getResource("doclet.navAnnotationTypeRequiredMember");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   287
    protected void addNavDetailLink(boolean link, Content liNav) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
        if (link) {
14357
faf9cde2817b 8000741: refactor javadoc to use abstraction to handle relative paths
jjg
parents: 14260
diff changeset
   289
            liNav.addContent(writer.getHyperLink("annotation_type_element_detail",
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   290
                    writer.getResource("doclet.navAnnotationTypeMember")));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   291
        } else {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   292
            liNav.addContent(writer.getResource("doclet.navAnnotationTypeMember"));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
    private Type getType(MemberDoc member) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
        if (member instanceof FieldDoc) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
            return ((FieldDoc) member).type();
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            return ((MethodDoc) member).returnType();
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
}