langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java
author briangoetz
Wed, 18 Dec 2013 16:05:18 -0500
changeset 22163 3651128c74eb
parent 20237 b6d89903c867
permissions -rw-r--r--
8030244: Update langtools to use Diamond Reviewed-by: darcy
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.internal.toolkit.builders;
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
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.internal.toolkit.*;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.util.*;
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
 * Builds documentation for annotation type fields.
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
 * @since 1.8
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    44
 */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    45
public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
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
     * The annotation type whose members are being documented.
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
    protected ClassDoc classDoc;
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 visible members for the given class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    54
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    55
    protected VisibleMemberMap visibleMemberMap;
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 writer to output the member documentation.
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 AnnotationTypeFieldWriter writer;
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 list of members being documented.
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 List<ProgramElementDoc> members;
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 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
    69
     * in time.
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
    protected int currentMemberIndex;
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
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    74
     * Construct a new AnnotationTypeFieldsBuilder.
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
     * @param context  the build context.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    77
     * @param classDoc the class whose members are being documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    78
     * @param writer the doclet specific writer.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    79
     * @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
    80
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    81
    protected AnnotationTypeFieldBuilder(Context context,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    82
            ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    83
            AnnotationTypeFieldWriter writer,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    84
            int memberType) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    85
        super(context);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    86
        this.classDoc = classDoc;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    87
        this.writer = writer;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    88
        this.visibleMemberMap = new VisibleMemberMap(classDoc, memberType,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    89
            configuration);
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 20237
diff changeset
    90
        this.members = new ArrayList<>(this.visibleMemberMap.getMembersFor(classDoc));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    91
        if (configuration.getMemberComparator() != null) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    92
            Collections.sort(this.members, configuration.getMemberComparator());
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    93
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    94
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
    95
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
     * Construct a new AnnotationTypeFieldBuilder.
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
     * @param context  the build context.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   101
     * @param classDoc the class whose members are being documented.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   102
     * @param writer the doclet specific writer.
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
    public static AnnotationTypeFieldBuilder getInstance(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   105
            Context context, ClassDoc classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   106
            AnnotationTypeFieldWriter writer) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   107
        return new AnnotationTypeFieldBuilder(context, classDoc,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   108
                    writer, VisibleMemberMap.ANNOTATION_TYPE_FIELDS);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   109
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   110
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
     * {@inheritDoc}
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
    public String getName() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   115
        return "AnnotationTypeFieldDetails";
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   116
    }
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
     * 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
   120
     * 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
   121
     * generation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   122
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   123
     * @param classDoc the {@link ClassDoc} we want to check.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   124
     * @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
   125
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   126
    public List<ProgramElementDoc> members(ClassDoc classDoc) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   127
        return visibleMemberMap.getMembersFor(classDoc);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   128
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   129
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
     * 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
   132
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   133
     * @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
   134
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   135
    public VisibleMemberMap getVisibleMemberMap() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   136
        return visibleMemberMap;
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
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
     * summaryOrder.size()
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
    public boolean hasMembersToDocument() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   143
        return members.size() > 0;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   144
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   145
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
     * Build the annotation type field documentation.
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
     * @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
   150
     * @param memberDetailsTree 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
   151
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   152
    public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   153
        buildAnnotationTypeMember(node, memberDetailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   154
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   155
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   156
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   157
     * Build the member documentation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   158
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   159
     * @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
   160
     * @param memberDetailsTree 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
   161
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   162
    public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   163
        if (writer == null) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   164
            return;
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
        int size = members.size();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   167
        if (size > 0) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   168
            writer.addAnnotationFieldDetailsMarker(memberDetailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   169
            for (currentMemberIndex = 0; currentMemberIndex < size;
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   170
                    currentMemberIndex++) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   171
                Content detailsTree = writer.getMemberTreeHeader();
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   172
                writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   173
                Content annotationDocTree = writer.getAnnotationDocTreeHeader(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   174
                        (MemberDoc) members.get(currentMemberIndex),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   175
                        detailsTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   176
                buildChildren(node, annotationDocTree);
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   177
                detailsTree.addContent(writer.getAnnotationDoc(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   178
                        annotationDocTree, (currentMemberIndex == size - 1)));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   179
                memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   180
            }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   181
        }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   182
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   183
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
     * Build the signature.
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
     * @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
   188
     * @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
   189
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   190
    public void buildSignature(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   191
        annotationDocTree.addContent(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   192
                writer.getSignature((MemberDoc) members.get(currentMemberIndex)));
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
     * Build the deprecation information.
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
     * @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
   199
     * @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
   200
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   201
    public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   202
        writer.addDeprecated((MemberDoc) members.get(currentMemberIndex),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   203
                annotationDocTree);
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
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
     * 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
   208
     * {@link Configuration#nocomment} is set to true.
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
     * @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
   211
     * @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
   212
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   213
    public void buildMemberComments(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   214
        if(! configuration.nocomment){
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   215
            writer.addComments((MemberDoc) members.get(currentMemberIndex),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   216
                    annotationDocTree);
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
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   219
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   220
    /**
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   221
     * Build the tag information.
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
     * @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
   224
     * @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
   225
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   226
    public void buildTagInfo(XMLNode node, Content annotationDocTree) {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   227
        writer.addTags((MemberDoc) members.get(currentMemberIndex),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   228
                annotationDocTree);
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
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
     * 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
   233
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   234
     * @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
   235
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   236
    public AnnotationTypeFieldWriter getWriter() {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents:
diff changeset
   237
        return writer;
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
}