src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
author jjg
Thu, 16 Nov 2017 15:01:45 -0800
changeset 47846 4e78aba768f0
parent 47427 251676148c62
child 47850 4a28dc8a86c2
permissions -rw-r--r--
8190295: Introduce a new Table builder class Reviewed-by: bpatel, 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
/*
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
     2
 * Copyright (c) 2013, 2017, 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
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    27
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
    28
import jdk.javadoc.internal.doclets.formats.html.markup.Table;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
    29
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
    30
import java.util.Arrays;
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
    31
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    32
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    33
import javax.lang.model.element.ExecutableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    34
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    35
import javax.lang.model.type.TypeMirror;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    36
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
    37
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    38
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    39
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    40
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    41
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    42
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    44
import jdk.javadoc.internal.doclets.toolkit.Content;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    46
20237
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
 * Writes annotation type field documentation in HTML format.
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
 *  <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
    52
 *  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
    53
 *  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
    54
 *  deletion without notice.</b>
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    55
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    56
 * @author Bhavesh Patel
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
public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    59
    implements AnnotationTypeFieldWriter, MemberSummaryWriter {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    60
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
     * Construct a new AnnotationTypeFieldWriterImpl.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    63
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    64
     * @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
    65
     * @param annotationType the AnnotationType that holds this member.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    66
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    67
    public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    68
            TypeElement annotationType) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    69
        super(writer, annotationType);
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    73
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    74
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    75
    public Content getMemberSummaryHeader(TypeElement typeElement,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    76
            Content memberSummaryTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    77
        memberSummaryTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    78
                HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    79
        Content memberTree = writer.getMemberTreeHeader();
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
    80
        writer.addSummaryHeader(this, typeElement, memberTree);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    81
        return memberTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    82
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    83
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    84
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    85
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    86
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    87
    public Content getMemberTreeHeader() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    88
        return writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    89
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    93
     */
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    94
    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    95
        writer.addMemberTree(memberSummaryTree, memberTree);
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    96
    }
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    97
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    98
    /**
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
    99
     * {@inheritDoc}
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   100
     */
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   101
    public void addAnnotationFieldDetailsMarker(Content memberDetails) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   102
        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
   103
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   107
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   108
    public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   109
            Content memberDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   110
        if (!writer.printedAnnotationFieldHeading) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   111
            memberDetailsTree.addContent(writer.getMarkerAnchor(
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   112
                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   113
            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   114
                    contents.fieldDetailsLabel);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   115
            memberDetailsTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   116
            writer.printedAnnotationFieldHeading = true;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   117
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   118
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   122
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   123
    public Content getAnnotationDocTreeHeader(Element member,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   124
            Content annotationDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   125
        annotationDetailsTree.addContent(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   126
                writer.getMarkerAnchor(name(member)));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   127
        Content annotationDocTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   128
        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   129
        heading.addContent(name(member));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   130
        annotationDocTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   131
        return annotationDocTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   132
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   133
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   134
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   135
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   136
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   137
    public Content getSignature(Element member) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   138
        Content pre = new HtmlTree(HtmlTag.PRE);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   139
        writer.addAnnotationInfo(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   140
        addModifiers(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   141
        Content link =
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   142
                writer.getLink(new LinkInfoImpl(configuration,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   143
                        LinkInfoImpl.Kind.MEMBER, getType(member)));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   144
        pre.addContent(link);
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   145
        pre.addContent(Contents.SPACE);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   146
        if (configuration.linksource) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   147
            Content memberName = new StringContent(name(member));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   148
            writer.addSrcLink(member, memberName, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   149
        } else {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   150
            addName(name(member), pre);
20237
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
        return pre;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   153
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   157
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   158
    public void addDeprecated(Element member, Content annotationDocTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   159
        addDeprecatedInfo(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   160
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   164
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   165
    public void addComments(Element member, Content annotationDocTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   166
        addComment(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   167
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   168
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   169
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   170
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   171
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   172
    public void addTags(Element member, Content annotationDocTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   173
        writer.addTagsInfo(member, annotationDocTree);
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
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   178
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   179
    public Content getAnnotationDetails(Content annotationDetailsTree) {
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   180
        if (configuration.allowTag(HtmlTag.SECTION)) {
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   181
            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   182
            return htmlTree;
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   183
        }
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   184
        return getMemberTree(annotationDetailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   185
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   186
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
     * {@inheritDoc}
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
    public Content getAnnotationDoc(Content annotationDocTree,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   191
            boolean isLastContent) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   192
        return getMemberTree(annotationDocTree, isLastContent);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   193
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   194
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   195
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   196
     * {@inheritDoc}
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
    public void addSummaryLabel(Content memberTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   199
        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   200
                contents.fieldSummaryLabel);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   201
        memberTree.addContent(label);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   202
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   203
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   204
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   205
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   206
     */
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   207
    @Override
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   208
    public TableHeader getSummaryTableHeader(Element member) {
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   209
        return new TableHeader(contents.modifierAndTypeLabel, contents.fields,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   210
                contents.descriptionLabel);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   211
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   212
47846
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   213
    @Override
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   214
    protected Table createSummaryTable() {
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   215
        String summary = resources.getText("doclet.Member_Table_Summary",
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   216
            resources.getText("doclet.Field_Summary"),
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   217
            resources.getText("doclet.fields"));
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   218
        Content caption = contents.getContent("doclet.Fields");
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   219
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   220
        TableHeader header = new TableHeader(contents.modifierAndTypeLabel, contents.fields,
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   221
            contents.descriptionLabel);
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   222
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   223
        return new Table(configuration.htmlVersion, HtmlStyle.memberSummary)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   224
                .setSummary(summary)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   225
                .setCaption(caption)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   226
                .setHeader(header)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   227
                .setRowScopeColumn(1)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   228
                .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   229
                .setUseTBody(false);  // temporary? compatibility mode for TBody
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   230
    }
4e78aba768f0 8190295: Introduce a new Table builder class
jjg
parents: 47427
diff changeset
   231
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   232
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   233
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   234
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   235
    public void addSummaryAnchor(TypeElement typeElement, Content memberTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   236
        memberTree.addContent(writer.getMarkerAnchor(
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   237
                SectionName.ANNOTATION_TYPE_FIELD_SUMMARY));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   238
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   242
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   243
    public void addInheritedSummaryAnchor(TypeElement typeElement, Content inheritedTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   244
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   248
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   249
    public void addInheritedSummaryLabel(TypeElement typeElement, Content inheritedTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   250
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   251
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   252
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   253
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   254
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   255
    protected void addSummaryLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element member,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   256
            Content tdSummary) {
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   257
        Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   258
                writer.getDocLink(context, member, name(member), false));
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 21008
diff changeset
   259
        Content code = HtmlTree.CODE(memberLink);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   260
        tdSummary.addContent(code);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   261
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   262
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   263
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   264
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   265
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   266
    protected void addInheritedSummaryLink(TypeElement typeElement,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   267
            Element member, Content linksTree) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   268
        //Not applicable.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   269
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   270
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   271
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   272
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   273
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   274
    protected void addSummaryType(Element member, Content tdSummaryType) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   275
        addModifierAndType(member, getType(member), tdSummaryType);
20237
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
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   278
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   279
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   280
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   281
    protected Content getDeprecatedLink(Element member) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   282
        return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   283
                member, utils.getFullyQualifiedName(member));
20237
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
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   286
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   287
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   288
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   289
    protected Content getNavSummaryLink(TypeElement typeElement, boolean link) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   290
        if (link) {
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   291
            return writer.getHyperLink(
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   292
                    SectionName.ANNOTATION_TYPE_FIELD_SUMMARY,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   293
                    contents.navField);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   294
        } else {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   295
            return contents.navField;
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   296
        }
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
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   299
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   300
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   301
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   302
    protected void addNavDetailLink(boolean link, Content liNav) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   303
        if (link) {
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   304
            liNav.addContent(writer.getHyperLink(
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 20237
diff changeset
   305
                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL,
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   306
                    contents.navField));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   307
        } else {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents: 35426
diff changeset
   308
            liNav.addContent(contents.navField);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   309
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   310
    }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   311
    private TypeMirror getType(Element member) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   312
        if (utils.isConstructor(member))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   313
            return null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   314
        if (utils.isExecutableElement(member))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   315
            return utils.getReturnType((ExecutableElement)member);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 34752
diff changeset
   316
        return member.asType();
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   317
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   318
}