langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
author bpatel
Wed, 18 Sep 2013 17:13:26 -0700
changeset 20237 b6d89903c867
child 21008 af0b915df7cc
permissions -rw-r--r--
8015249: javadoc fails to document static final fields in annotation types Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     1
/*
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
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
 */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    44
public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    45
    implements AnnotationTypeFieldWriter, MemberSummaryWriter {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    46
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
     * Construct a new AnnotationTypeFieldWriterImpl.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    49
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    50
     * @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
    51
     * @param annotationType the AnnotationType that holds this member.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    52
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    53
    public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    54
            AnnotationTypeDoc annotationType) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    55
        super(writer, annotationType);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    56
    }
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
     * {@inheritDoc}
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
    public Content getMemberSummaryHeader(ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    62
            Content memberSummaryTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    63
        memberSummaryTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    64
                HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    65
        Content memberTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    66
        writer.addSummaryHeader(this, classDoc, memberTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    67
        return memberTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    68
    }
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
     * {@inheritDoc}
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
    public Content getMemberTreeHeader() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    74
        return writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    75
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    79
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    80
    public void addAnnotationFieldDetailsMarker(Content memberDetails) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    81
        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
    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 void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    88
            Content memberDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    89
        if (!writer.printedAnnotationFieldHeading) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    90
            memberDetailsTree.addContent(writer.getMarkerAnchor(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    91
                    "annotation_type_field_detail"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    92
            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    93
                    writer.fieldDetailsLabel);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    94
            memberDetailsTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    95
            writer.printedAnnotationFieldHeading = true;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    96
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    97
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    98
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    99
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   100
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   101
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   102
    public Content getAnnotationDocTreeHeader(MemberDoc member,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   103
            Content annotationDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   104
        annotationDetailsTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   105
                writer.getMarkerAnchor(member.name()));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   106
        Content annotationDocTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   107
        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   108
        heading.addContent(member.name());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   109
        annotationDocTree.addContent(heading);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   110
        return annotationDocTree;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   111
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   112
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   113
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   114
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   115
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   116
    public Content getSignature(MemberDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   117
        Content pre = new HtmlTree(HtmlTag.PRE);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   118
        writer.addAnnotationInfo(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   119
        addModifiers(member, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   120
        Content link =
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   121
                writer.getLink(new LinkInfoImpl(configuration,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   122
                        LinkInfoImpl.Kind.MEMBER, getType(member)));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   123
        pre.addContent(link);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   124
        pre.addContent(writer.getSpace());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   125
        if (configuration.linksource) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   126
            Content memberName = new StringContent(member.name());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   127
            writer.addSrcLink(member, memberName, pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   128
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   129
            addName(member.name(), pre);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   130
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   131
        return pre;
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
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   137
    public void addDeprecated(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   138
        addDeprecatedInfo(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   139
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   143
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   144
    public void addComments(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   145
        addComment(member, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   146
    }
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   150
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   151
    public void addTags(MemberDoc member, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   152
        writer.addTagsInfo(member, annotationDocTree);
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
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   158
    public Content getAnnotationDetails(Content annotationDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   159
        return getMemberTree(annotationDetailsTree);
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
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   165
    public Content getAnnotationDoc(Content annotationDocTree,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   166
            boolean isLastContent) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   167
        return getMemberTree(annotationDocTree, isLastContent);
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   171
     * Close the writer.
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
    public void close() throws IOException {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   174
        writer.close();
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   178
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   179
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   180
    public void addSummaryLabel(Content memberTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   181
        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   182
                writer.getResource("doclet.Field_Summary"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   183
        memberTree.addContent(label);
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
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
     * {@inheritDoc}
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
    public String getTableSummary() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   190
        return configuration.getText("doclet.Member_Table_Summary",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   191
                configuration.getText("doclet.Field_Summary"),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   192
                configuration.getText("doclet.fields"));
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 Content getCaption() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   199
        return configuration.getResource("doclet.Fields");
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
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
     * {@inheritDoc}
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
    public String[] getSummaryTableHeader(ProgramElementDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   206
        String[] header = new String[] {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   207
            writer.getModifierTypeHeader(),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   208
            configuration.getText("doclet.0_and_1",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   209
                    configuration.getText("doclet.Fields"),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   210
                    configuration.getText("doclet.Description"))
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
        return header;
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   216
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   217
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   218
    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   219
        memberTree.addContent(writer.getMarkerAnchor(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   220
                "annotation_type_field_summary"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   221
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   222
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
     * {@inheritDoc}
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
    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
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
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
     * {@inheritDoc}
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   231
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   232
    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
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
    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
   239
            Content tdSummary) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   240
        Content strong = HtmlTree.SPAN(HtmlStyle.strong,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   241
                writer.getDocLink(context, (MemberDoc) member, member.name(), false));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   242
        Content code = HtmlTree.CODE(strong);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   243
        tdSummary.addContent(code);
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
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   249
    protected void addInheritedSummaryLink(ClassDoc cd,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   250
            ProgramElementDoc member, Content linksTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   251
        //Not applicable.
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
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   254
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   255
     * {@inheritDoc}
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
    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   258
        MemberDoc m = (MemberDoc)member;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   259
        addModifierAndType(m, getType(m), tdSummaryType);
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
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
     * {@inheritDoc}
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
    protected Content getDeprecatedLink(ProgramElementDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   266
        return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   267
                (MemberDoc) member, ((MemberDoc)member).qualifiedName());
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
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
     * {@inheritDoc}
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
    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   274
        if (link) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   275
            return writer.getHyperLink("annotation_type_field_summary",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   276
                    writer.getResource("doclet.navField"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   277
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   278
            return writer.getResource("doclet.navField");
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   279
        }
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 void addNavDetailLink(boolean link, Content liNav) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   286
        if (link) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   287
            liNav.addContent(writer.getHyperLink("annotation_type_field_detail",
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   288
                    writer.getResource("doclet.navField")));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   289
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   290
            liNav.addContent(writer.getResource("doclet.navField"));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   291
        }
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
    private Type getType(MemberDoc member) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   295
        if (member instanceof FieldDoc) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   296
            return ((FieldDoc) member).type();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   297
        } else {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   298
            return ((MethodDoc) member).returnType();
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
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   301
}