langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java
author briangoetz
Wed, 18 Dec 2013 16:05:18 -0500
changeset 22163 3651128c74eb
parent 16319 e586bfeb39c5
permissions -rw-r--r--
8030244: Update langtools to use Diamond Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 14542
diff changeset
     2
 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.internal.toolkit.builders;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    28
import java.util.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 7681
diff changeset
    29
8d2148961366 8000663: clean up langtools imports
jjg
parents: 7681
diff changeset
    30
import com.sun.javadoc.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.*;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 7681
diff changeset
    32
import com.sun.tools.doclets.internal.toolkit.util.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * Builds documentation for a field.
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    37
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    38
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    39
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    40
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Jamie Ho
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    43
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @since 1.5
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
public class FieldBuilder extends AbstractMemberBuilder {
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    48
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    49
     * The class whose fields are being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    50
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    51
    private final ClassDoc classDoc;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    53
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    54
     * The visible fields for the given class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    55
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    56
    private final VisibleMemberMap visibleMemberMap;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    58
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    59
     * The writer to output the field documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    60
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    61
    private final FieldWriter writer;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    63
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    64
     * The list of fields being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    65
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    66
    private final List<ProgramElementDoc> fields;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    68
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    69
     * The index of the current field that is being documented at this point
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    70
     * in time.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    71
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    72
    private int currentFieldIndex;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    74
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    75
     * Construct a new FieldBuilder.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    76
     *
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    77
     * @param context  the build context.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    78
     * @param classDoc the class whoses members are being documented.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    79
     * @param writer the doclet specific writer.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    80
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    81
    private FieldBuilder(Context context,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    82
            ClassDoc classDoc,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    83
            FieldWriter writer) {
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    84
        super(context);
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    85
        this.classDoc = classDoc;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    86
        this.writer = writer;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    87
        visibleMemberMap =
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    88
                new VisibleMemberMap(
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    89
                classDoc,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    90
                VisibleMemberMap.FIELDS,
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 14542
diff changeset
    91
                configuration);
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 16319
diff changeset
    92
        fields = new ArrayList<>(visibleMemberMap.getLeafClassMembers(configuration));
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    93
        if (configuration.getMemberComparator() != null) {
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    94
            Collections.sort(fields, configuration.getMemberComparator());
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    95
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    96
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    98
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    99
     * Construct a new FieldBuilder.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   100
     *
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   101
     * @param context  the build context.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   102
     * @param classDoc the class whoses members are being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   103
     * @param writer the doclet specific writer.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   104
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   105
    public static FieldBuilder getInstance(Context context,
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   106
            ClassDoc classDoc,
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   107
            FieldWriter writer) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   108
        return new FieldBuilder(context, classDoc, writer);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   109
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   111
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   112
     * {@inheritDoc}
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   113
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   114
    public String getName() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   115
        return "FieldDetails";
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   116
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   118
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   119
     * Returns a list of fields that will be documented for the given class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   120
     * This information can be used for doclet specific documentation
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   121
     * generation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   122
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   123
     * @param classDoc the {@link ClassDoc} we want to check.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   124
     * @return a list of fields that will be documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   125
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   126
    public List<ProgramElementDoc> members(ClassDoc classDoc) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   127
        return visibleMemberMap.getMembersFor(classDoc);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   128
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   130
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   131
     * Returns the visible member map for the fields of this class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   132
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   133
     * @return the visible member map for the fields of this class.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   134
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   135
    public VisibleMemberMap getVisibleMemberMap() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   136
        return visibleMemberMap;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   137
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   139
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   140
     * summaryOrder.size()
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   141
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   142
    public boolean hasMembersToDocument() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   143
        return fields.size() > 0;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   144
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   146
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   147
     * Build the field documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   148
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   149
     * @param node the XML element that specifies which components to document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   150
     * @param memberDetailsTree the content tree to which the documentation will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   151
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   152
    public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   153
        if (writer == null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   154
            return;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   156
        int size = fields.size();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   157
        if (size > 0) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   158
            Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   159
                    classDoc, memberDetailsTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   160
            for (currentFieldIndex = 0; currentFieldIndex < size;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   161
                    currentFieldIndex++) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   162
                Content fieldDocTree = writer.getFieldDocTreeHeader(
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
                        (FieldDoc) fields.get(currentFieldIndex),
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   164
                        fieldDetailsTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   165
                buildChildren(node, fieldDocTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   166
                fieldDetailsTree.addContent(writer.getFieldDoc(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   167
                        fieldDocTree, (currentFieldIndex == size - 1)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   168
            }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   169
            memberDetailsTree.addContent(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   170
                    writer.getFieldDetails(fieldDetailsTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   172
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   174
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   175
     * Build the signature.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   176
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   177
     * @param node the XML element that specifies which components to document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   178
     * @param fieldDocTree the content tree to which the documentation will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   179
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   180
    public void buildSignature(XMLNode node, Content fieldDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   181
        fieldDocTree.addContent(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   182
                writer.getSignature((FieldDoc) fields.get(currentFieldIndex)));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   183
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   185
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   186
     * Build the deprecation information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   187
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   188
     * @param node the XML element that specifies which components to document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   189
     * @param fieldDocTree the content tree to which the documentation will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   190
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   191
    public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   192
        writer.addDeprecated(
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   193
                (FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   194
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   196
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   197
     * Build the comments for the field.  Do nothing if
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   198
     * {@link Configuration#nocomment} is set to true.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   199
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   200
     * @param node the XML element that specifies which components to document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   201
     * @param fieldDocTree the content tree to which the documentation will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   202
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   203
    public void buildFieldComments(XMLNode node, Content fieldDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   204
        if (!configuration.nocomment) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   205
            writer.addComments((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   207
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   209
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   210
     * Build the tag information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   211
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   212
     * @param node the XML element that specifies which components to document
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   213
     * @param fieldDocTree the content tree to which the documentation will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   214
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   215
    public void buildTagInfo(XMLNode node, Content fieldDocTree) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   216
        writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   217
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   219
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   220
     * Return the field writer for this builder.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   221
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   222
     * @return the field writer for this builder.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   223
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   224
    public FieldWriter getWriter() {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   225
        return writer;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   226
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
}