langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
author jjg
Fri, 27 May 2016 13:06:58 -0700
changeset 38617 d93a7f64e231
parent 34752 9c262a013456
permissions -rw-r--r--
8157606: deprecate com.sun.javadoc API Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     1
/*
34752
9c262a013456 8145342: Some copyright notices are inconsistently and ill formatted
vasya
parents: 29957
diff changeset
     2
 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     4
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    10
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    15
 * accompanied this code).
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    16
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    20
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    23
 * questions.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    24
 */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    25
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    26
package com.sun.tools.doclets.formats.html;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    27
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    28
import java.io.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    29
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    30
import com.sun.javadoc.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    31
import com.sun.tools.doclets.formats.html.markup.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    33
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    34
/**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    35
 * Writes annotation type field documentation in HTML format.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    36
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    37
 *  <p><b>This is NOT part of any supported API.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    38
 *  If you write code that depends on this, you do so at your own risk.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    39
 *  This code and its internal interfaces are subject to change or
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    40
 *  deletion without notice.</b>
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    41
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    42
 * @author Bhavesh Patel
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    43
 */
38617
d93a7f64e231 8157606: deprecate com.sun.javadoc API
jjg
parents: 34752
diff changeset
    44
@Deprecated
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    45
public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    46
    implements AnnotationTypeFieldWriter, MemberSummaryWriter {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    47
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    48
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    49
     * Construct a new AnnotationTypeFieldWriterImpl.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    50
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    51
     * @param writer         the writer that will write the output.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    52
     * @param annotationType the AnnotationType that holds this member.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    53
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    54
    public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    55
            AnnotationTypeDoc annotationType) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    56
        super(writer, annotationType);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    57
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    58
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    59
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    60
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    61
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    62
    public Content getMemberSummaryHeader(ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    63
            Content memberSummaryTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    64
        memberSummaryTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    65
                HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    66
        Content memberTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    67
        writer.addSummaryHeader(this, classDoc, memberTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    68
        return memberTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    69
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    70
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    71
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    72
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    73
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    74
    public Content getMemberTreeHeader() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    75
        return writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    76
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    77
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    78
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    79
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    80
     */
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    81
    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    82
        writer.addMemberTree(memberSummaryTree, memberTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    83
    }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    84
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    85
    /**
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    86
     * {@inheritDoc}
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    87
     */
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    88
    public void addAnnotationFieldDetailsMarker(Content memberDetails) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    89
        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    90
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    91
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    92
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    93
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    94
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    95
    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    96
            Content memberDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    97
        if (!writer.printedAnnotationFieldHeading) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    98
            memberDetailsTree.addContent(writer.getMarkerAnchor(
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
    99
                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   100
            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   101
                    writer.fieldDetailsLabel);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   102
            memberDetailsTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   103
            writer.printedAnnotationFieldHeading = true;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   104
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   105
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   106
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   107
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   108
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   109
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   110
    public Content getAnnotationDocTreeHeader(MemberDoc member,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   111
            Content annotationDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   112
        annotationDetailsTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   113
                writer.getMarkerAnchor(member.name()));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   114
        Content annotationDocTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   115
        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   116
        heading.addContent(member.name());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   117
        annotationDocTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   118
        return annotationDocTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   119
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   120
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   121
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   122
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   123
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   124
    public Content getSignature(MemberDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   125
        Content pre = new HtmlTree(HtmlTag.PRE);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   126
        writer.addAnnotationInfo(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   127
        addModifiers(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   128
        Content link =
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   129
                writer.getLink(new LinkInfoImpl(configuration,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   130
                        LinkInfoImpl.Kind.MEMBER, getType(member)));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   131
        pre.addContent(link);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   132
        pre.addContent(writer.getSpace());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   133
        if (configuration.linksource) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   134
            Content memberName = new StringContent(member.name());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   135
            writer.addSrcLink(member, memberName, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   136
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   137
            addName(member.name(), pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   138
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   139
        return pre;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   140
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   141
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   142
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   143
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   144
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   145
    public void addDeprecated(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   146
        addDeprecatedInfo(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   147
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   148
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   149
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   150
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   151
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   152
    public void addComments(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   153
        addComment(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   154
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   155
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   156
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   157
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   158
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   159
    public void addTags(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   160
        writer.addTagsInfo(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   161
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   162
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   163
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   164
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   165
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   166
    public Content getAnnotationDetails(Content annotationDetailsTree) {
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   167
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   168
            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   169
            return htmlTree;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   170
        }
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   171
        return getMemberTree(annotationDetailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   172
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   173
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   174
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   175
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   176
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   177
    public Content getAnnotationDoc(Content annotationDocTree,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   178
            boolean isLastContent) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   179
        return getMemberTree(annotationDocTree, isLastContent);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   180
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   181
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   182
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   183
     * Close the writer.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   184
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   185
    public void close() throws IOException {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   186
        writer.close();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   187
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   188
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   189
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   190
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   191
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   192
    public void addSummaryLabel(Content memberTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   193
        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   194
                writer.getResource("doclet.Field_Summary"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   195
        memberTree.addContent(label);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   196
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   197
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   198
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   199
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   200
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   201
    public String getTableSummary() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   202
        return configuration.getText("doclet.Member_Table_Summary",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   203
                configuration.getText("doclet.Field_Summary"),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   204
                configuration.getText("doclet.fields"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   205
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   206
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   207
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   208
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   209
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   210
    public Content getCaption() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   211
        return configuration.getResource("doclet.Fields");
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   212
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   213
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   214
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   215
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   216
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   217
    public String[] getSummaryTableHeader(ProgramElementDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   218
        String[] header = new String[] {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   219
            writer.getModifierTypeHeader(),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   220
            configuration.getText("doclet.0_and_1",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   221
                    configuration.getText("doclet.Fields"),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   222
                    configuration.getText("doclet.Description"))
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   223
        };
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   224
        return header;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   225
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   226
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   227
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   228
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   229
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   230
    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   231
        memberTree.addContent(writer.getMarkerAnchor(
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   232
                SectionName.ANNOTATION_TYPE_FIELD_SUMMARY));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   233
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   234
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   235
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   236
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   237
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   238
    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   239
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   240
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   241
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   242
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   243
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   244
    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   245
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   246
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   247
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   248
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   249
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   250
    protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   251
            Content tdSummary) {
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   252
        Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   253
                writer.getDocLink(context, (MemberDoc) member, member.name(), false));
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   254
        Content code = HtmlTree.CODE(memberLink);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   255
        tdSummary.addContent(code);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   256
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   257
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   258
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   259
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   260
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   261
    protected void addInheritedSummaryLink(ClassDoc cd,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   262
            ProgramElementDoc member, Content linksTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   263
        //Not applicable.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   264
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   265
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   266
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   267
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   268
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   269
    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   270
        MemberDoc m = (MemberDoc)member;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   271
        addModifierAndType(m, getType(m), tdSummaryType);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   272
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   273
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   274
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   275
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   276
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   277
    protected Content getDeprecatedLink(ProgramElementDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   278
        return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   279
                (MemberDoc) member, ((MemberDoc)member).qualifiedName());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   280
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   281
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   282
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   283
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   284
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   285
    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   286
        if (link) {
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   287
            return writer.getHyperLink(
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   288
                    SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   289
                    writer.getResource("doclet.navField"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   290
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   291
            return writer.getResource("doclet.navField");
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   292
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   293
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   294
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   295
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   296
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   297
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   298
    protected void addNavDetailLink(boolean link, Content liNav) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   299
        if (link) {
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   300
            liNav.addContent(writer.getHyperLink(
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   301
                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   302
                    writer.getResource("doclet.navField")));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   303
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   304
            liNav.addContent(writer.getResource("doclet.navField"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   305
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   306
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   307
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   308
    private Type getType(MemberDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   309
        if (member instanceof FieldDoc) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   310
            return ((FieldDoc) member).type();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   311
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   312
            return ((MethodDoc) member).returnType();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   313
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   314
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   315
}