langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java
author jjg
Mon, 22 Aug 2016 16:32:40 -0700
changeset 40587 1c355ea550ed
parent 35426 374342e56a56
child 42000 8b7412f7eecd
permissions -rw-r--r--
8164130: Simplify doclet IOException handling 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
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
     2
 * Copyright (c) 2013, 2016, 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: 25874
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit.builders;
20237
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.util.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    29
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    30
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    31
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    33
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    34
import jdk.javadoc.internal.doclets.toolkit.Configuration;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.Content;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.DocletException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    38
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    39
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    40
/**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    41
 * Builds documentation for annotation type fields.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    42
 *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    43
 *  <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
    44
 *  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
    45
 *  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
    46
 *  deletion without notice.</b>
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
 * @author Bhavesh Patel
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
public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    51
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
     * The annotation type whose members are being documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    54
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    55
    protected TypeElement typeElement;
20237
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
     * The visible members for the given class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    59
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    60
    protected VisibleMemberMap visibleMemberMap;
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    63
     * The writer to output the member documentation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    64
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    65
    protected AnnotationTypeFieldWriter writer;
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    68
     * The list of members being documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    69
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    70
    protected SortedSet<Element> members;
20237
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
     * The index of the current member that is being documented at this point
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    74
     * in time.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    75
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    76
    protected Element currentMember;
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    77
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    78
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    79
     * Construct a new AnnotationTypeFieldsBuilder.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    80
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    81
     * @param context  the build context.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    82
     * @param typeElement the class whose members are being documented.
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    83
     * @param writer the doclet specific writer.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    84
     * @param memberType the type of member that is being documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    85
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    86
    protected AnnotationTypeFieldBuilder(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    87
            TypeElement typeElement,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    88
            AnnotationTypeFieldWriter writer,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    89
            VisibleMemberMap.Kind memberType) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    90
        super(context);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    91
        this.typeElement = typeElement;
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    92
        this.writer = writer;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    93
        this.visibleMemberMap = new VisibleMemberMap(typeElement, memberType, configuration);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    94
        this.members = this.visibleMemberMap.getMembersFor(typeElement);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    95
    }
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
     * Construct a new AnnotationTypeFieldBuilder.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   100
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   101
     * @param context  the build context.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   102
     * @param typeElement the class whose members are being documented.
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   103
     * @param writer the doclet specific writer.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   104
     * @return the new AnnotationTypeFieldBuilder
20237
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
    public static AnnotationTypeFieldBuilder getInstance(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   107
            Context context, TypeElement typeElement,
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   108
            AnnotationTypeFieldWriter writer) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   109
        return new AnnotationTypeFieldBuilder(context, typeElement,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   110
                    writer, VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
20237
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
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   116
    @Override
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   117
    public String getName() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   118
        return "AnnotationTypeFieldDetails";
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   119
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   120
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   121
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   122
     * Returns a list of members that will be documented for the given class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   123
     * This information can be used for doclet specific documentation
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   124
     * generation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   125
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   126
     * @param typeElement the TypeElement we want to check.
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   127
     * @return a list of members that will be documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   128
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   129
    public SortedSet<Element> members(TypeElement typeElement) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   130
        return visibleMemberMap.getMembersFor(typeElement);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   131
    }
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
     * Returns the visible member map for the members of this class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   135
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   136
     * @return the visible member map for the members of this class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   137
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   138
    public VisibleMemberMap getVisibleMemberMap() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   139
        return visibleMemberMap;
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
    /**
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   143
     * Returns whether or not there are members to document.
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   144
     * @return whether or not there are members to document
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   145
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   146
    @Override
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   147
    public boolean hasMembersToDocument() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   148
        return members.size() > 0;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   149
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   150
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
     * Build the annotation type field documentation.
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
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   155
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   156
     * @throws DocletException if there is a problem while building the documentation
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   157
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   158
    public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree)
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   159
            throws DocletException {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   160
        buildAnnotationTypeMember(node, memberDetailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   161
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   162
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   163
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   164
     * Build the member documentation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   165
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   166
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   167
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   168
     * @throws DocletException if there is a problem while building the documentation
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   169
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   170
    public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree)
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   171
            throws DocletException {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   172
        if (writer == null) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   173
            return;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   174
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   175
        if (!members.isEmpty()) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   176
            writer.addAnnotationFieldDetailsMarker(memberDetailsTree);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   177
            for (Element element : members) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   178
                currentMember = element;
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   179
                Content detailsTree = writer.getMemberTreeHeader();
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   180
                writer.addAnnotationDetailsTreeHeader(typeElement, detailsTree);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   181
                Content annotationDocTree = writer.getAnnotationDocTreeHeader(element, detailsTree);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   182
                buildChildren(node, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   183
                detailsTree.addContent(writer.getAnnotationDoc(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   184
                        annotationDocTree, currentMember == members.last()));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   185
                memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
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
    }
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   191
     * Build the signature.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   192
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   193
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   194
     * @param annotationDocTree the content tree to which the documentation will be added
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
    public void buildSignature(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   197
        annotationDocTree.addContent(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   198
                writer.getSignature(currentMember));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   199
    }
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
     * Build the deprecation information.
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
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   205
     * @param annotationDocTree the content tree to which the documentation will be added
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   206
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   207
    public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   208
        writer.addDeprecated(currentMember, annotationDocTree);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   209
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   210
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
     * Build the comments for the member.  Do nothing if
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   213
     * {@link Configuration#nocomment} is set to true.
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
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   216
     * @param annotationDocTree the content tree to which the documentation will be added
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 buildMemberComments(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   219
        if(! configuration.nocomment){
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   220
            writer.addComments(currentMember, annotationDocTree);
20237
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   225
     * Build the tag information.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   226
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   227
     * @param node the XML element that specifies which components to document
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   228
     * @param annotationDocTree the content tree to which the documentation will be added
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   229
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   230
    public void buildTagInfo(XMLNode node, Content annotationDocTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   231
        writer.addTags(currentMember, annotationDocTree);
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
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
     * Return the annotation type field writer for this builder.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   236
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   237
     * @return the annotation type field writer for this builder.
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
    public AnnotationTypeFieldWriter getWriter() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   240
        return writer;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   241
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   242
}