langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.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:
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
     2
 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     4
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    10
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    15
 * accompanied this code).
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    16
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    20
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    23
 * questions.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    24
 */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
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;
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    27
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    28
import java.util.*;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
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.ExecutableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    33
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.PropertyWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    39
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    40
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    41
/**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    42
 * Builds documentation for a property.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    43
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    44
 *  <p><b>This is NOT part of any supported API.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    45
 *  If you write code that depends on this, you do so at your own risk.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    46
 *  This code and its internal interfaces are subject to change or
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    47
 *  deletion without notice.</b>
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    48
 *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    49
 * @author Jamie Ho
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    50
 * @author Bhavesh Patel (Modified)
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    51
 */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    52
public class PropertyBuilder extends AbstractMemberBuilder {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    53
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    54
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    55
     * The class whose properties are being documented.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    56
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    57
    private final TypeElement typeElement;
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    58
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    59
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    60
     * The visible properties for the given class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    61
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    62
    private final VisibleMemberMap visibleMemberMap;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    63
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    64
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    65
     * The writer to output the property documentation.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    66
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    67
    private final PropertyWriter writer;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    68
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    69
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    70
     * The list of properties being documented.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    71
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    72
    private final SortedSet<Element> properties;
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    73
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    74
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    75
     * The index of the current property that is being documented at this point
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    76
     * in time.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    77
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    78
    private ExecutableElement currentProperty;
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    79
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    80
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    81
     * Construct a new PropertyBuilder.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    82
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    83
     * @param context  the build context.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    84
     * @param typeElement the class whoses members are being documented.
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    85
     * @param writer the doclet specific writer.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    86
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    87
    private PropertyBuilder(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    88
            TypeElement typeElement,
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    89
            PropertyWriter writer) {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    90
        super(context);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    91
        this.typeElement = typeElement;
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    92
        this.writer = writer;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    93
        visibleMemberMap =
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    94
                new VisibleMemberMap(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    95
                typeElement,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    96
                VisibleMemberMap.Kind.PROPERTIES,
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    97
                configuration);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    98
        properties = visibleMemberMap.getMembersFor(typeElement);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
    99
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   100
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   101
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   102
     * Construct a new PropertyBuilder.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   103
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   104
     * @param context  the build context.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   105
     * @param typeElement the class whoses members are being documented.
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   106
     * @param writer the doclet specific writer.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   107
     * @return the new PropertyBuilder
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   108
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   109
    public static PropertyBuilder getInstance(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   110
            TypeElement typeElement,
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   111
            PropertyWriter writer) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   112
        return new PropertyBuilder(context, typeElement, writer);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   113
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   114
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   115
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   116
     * {@inheritDoc}
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   117
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   118
    @Override
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   119
    public String getName() {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   120
        return "PropertyDetails";
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   121
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   122
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   123
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   124
     * Returns a list of properties that will be documented for the given class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   125
     * This information can be used for doclet specific documentation
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   126
     * generation.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   127
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   128
     * @param typeElement the {@link TypeElement} we want to check.
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   129
     * @return a list of properties that will be documented.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   130
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   131
    public SortedSet<Element> members(TypeElement typeElement) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   132
        return visibleMemberMap.getMembersFor(typeElement);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   133
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   134
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   135
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   136
     * Returns the visible member map for the properties of this class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   137
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   138
     * @return the visible member map for the properties of this class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   139
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   140
    public VisibleMemberMap getVisibleMemberMap() {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   141
        return visibleMemberMap;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   142
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   143
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   144
    /**
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   145
     * Returns whether or not there are members to document.
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   146
     *
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   147
     * @return whether or not there are members to document
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   148
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   149
    @Override
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   150
    public boolean hasMembersToDocument() {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   151
        return !properties.isEmpty();
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   152
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   153
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   154
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   155
     * Build the property documentation.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   156
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   157
     * @param node the XML element that specifies which components to document
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   158
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   159
     * @throws DocletException if there is a problem while building the documentation
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   160
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 35426
diff changeset
   161
    public void buildPropertyDoc(XMLNode node, Content memberDetailsTree) throws DocletException {
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   162
        if (writer == null) {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   163
            return;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   164
        }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   165
        int size = properties.size();
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   166
        if (size > 0) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   167
            Content propertyDetailsTree = writer.getPropertyDetailsTreeHeader(typeElement,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   168
                    memberDetailsTree);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   169
            for (Element e : properties) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   170
                currentProperty = (ExecutableElement) e;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   171
                Content propertyDocTree = writer.getPropertyDocTreeHeader(currentProperty,
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   172
                        propertyDetailsTree);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   173
                buildChildren(node, propertyDocTree);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   174
                propertyDetailsTree.addContent(writer.getPropertyDoc(
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   175
                        propertyDocTree, currentProperty == properties.last()));
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   176
            }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   177
            memberDetailsTree.addContent(
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   178
                    writer.getPropertyDetails(propertyDetailsTree));
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   179
        }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   180
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   181
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   182
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   183
     * Build the signature.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   184
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   185
     * @param node the XML element that specifies which components to document
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   186
     * @param propertyDocTree the content tree to which the documentation will be added
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   187
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   188
    public void buildSignature(XMLNode node, Content propertyDocTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   189
        propertyDocTree.addContent(writer.getSignature(currentProperty));
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   190
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   191
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   192
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   193
     * Build the deprecation information.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   194
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   195
     * @param node the XML element that specifies which components to document
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   196
     * @param propertyDocTree the content tree to which the documentation will be added
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   197
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   198
    public void buildDeprecationInfo(XMLNode node, Content propertyDocTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   199
        writer.addDeprecated(currentProperty, propertyDocTree);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   200
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   201
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   202
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   203
     * Build the comments for the property.  Do nothing if
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   204
     * {@link Configuration#nocomment} is set to true.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   205
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   206
     * @param node the XML element that specifies which components to document
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   207
     * @param propertyDocTree the content tree to which the documentation will be added
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   208
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   209
    public void buildPropertyComments(XMLNode node, Content propertyDocTree) {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   210
        if (!configuration.nocomment) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   211
            writer.addComments(currentProperty, propertyDocTree);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   212
        }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   213
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   214
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   215
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   216
     * Build the tag information.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   217
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   218
     * @param node the XML element that specifies which components to document
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   219
     * @param propertyDocTree the content tree to which the documentation will be added
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   220
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   221
    public void buildTagInfo(XMLNode node, Content propertyDocTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   222
        writer.addTags(currentProperty, propertyDocTree);
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   223
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   224
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   225
    /**
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   226
     * Return the property writer for this builder.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   227
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   228
     * @return the property writer for this builder.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   229
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   230
    public PropertyWriter getWriter() {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   231
        return writer;
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   232
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents:
diff changeset
   233
}