src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java
author pmuthuswamy
Tue, 23 Apr 2019 18:28:48 +0530
changeset 54596 86c1da00dd6a
parent 54060 53a95878619f
child 59294 48b88b9c11eb
permissions -rw-r--r--
8219998: Eliminate inherently singleton lists Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
54060
53a95878619f 8220202: Simplify/standardize method naming for HtmlTree
jjg
parents: 48029
diff changeset
     2
 * Copyright (c) 2003, 2019, 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: 2320
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: 2320
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: 2320
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2320
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit.builders;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    28
import java.util.Set;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    29
import java.util.SortedSet;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    30
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    31
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    32
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    33
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    34
import jdk.javadoc.internal.doclets.toolkit.Content;
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47427
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.DocletException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    38
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * Builds the summary for a given package.
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    43
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    44
 *  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
    45
 *  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
    46
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * @author Jamie Ho
2320
5b8c377175f4 6786688: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Table must have captions and headers
bpatel
parents: 1789
diff changeset
    49
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
public class PackageSummaryBuilder extends AbstractBuilder {
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 package being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    55
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    56
    private final PackageElement packageElement;
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 doclet specific writer that will output the result.
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: 14368
diff changeset
    61
    private final PackageSummaryWriter packageWriter;
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 content that will be added to the package summary documentation tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    65
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    66
    private Content contentTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    68
    /**
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    69
     * Construct a new PackageSummaryBuilder.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    70
     *
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    71
     * @param context  the build context.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    72
     * @param pkg the package being documented.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    73
     * @param packageWriter the doclet specific writer that will output the
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    74
     *        result.
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    75
     */
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    76
    private PackageSummaryBuilder(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    77
            PackageElement pkg,
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    78
            PackageSummaryWriter packageWriter) {
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    79
        super(context);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    80
        this.packageElement = pkg;
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    81
        this.packageWriter = packageWriter;
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    82
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    84
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    85
     * Construct a new PackageSummaryBuilder.
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    86
     *
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    87
     * @param context  the build context.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    88
     * @param pkg the package being documented.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    89
     * @param packageWriter the doclet specific writer that will output the
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    90
     *        result.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    91
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    92
     * @return an instance of a PackageSummaryBuilder.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    93
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    94
    public static PackageSummaryBuilder getInstance(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    95
            PackageElement pkg, PackageSummaryWriter packageWriter) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    96
        return new PackageSummaryBuilder(context, pkg, packageWriter);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    97
    }
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
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   100
     * Build the package summary.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   101
     *
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   102
     * @throws DocletException if there is a problem while building the documentation
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   103
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   104
    @Override
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   105
    public void build() throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   106
        if (packageWriter == null) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   107
            //Doclet does not support this output.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   108
            return;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
        }
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   110
        buildPackageDoc(contentTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   111
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
7614
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
     * Build the package documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   115
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   116
     * @param contentTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   117
     * @throws DocletException if there is a problem while building the documentation
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   118
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   119
    protected void buildPackageDoc(Content contentTree) throws DocletException {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   120
        contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageElement));
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   121
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   122
        buildContent(contentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   123
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   124
        packageWriter.addPackageFooter(contentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   125
        packageWriter.printDocument(contentTree);
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47427
diff changeset
   126
        DocFilesHandler docFilesHandler = configuration
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47427
diff changeset
   127
                .getWriterFactory()
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47427
diff changeset
   128
                .getDocFilesHandler(packageElement);
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47427
diff changeset
   129
        docFilesHandler.copyDocFiles();
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   130
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   132
    /**
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   133
     * Build the content for the package.
7614
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
     * @param contentTree the content tree to which the package contents
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   136
     *                    will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   137
     * @throws DocletException if there is a problem while building the documentation
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   138
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   139
    protected void buildContent(Content contentTree) throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   140
        Content packageContentTree = packageWriter.getContentHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   141
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   142
        buildPackageDescription(packageContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   143
        buildPackageTags(packageContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   144
        buildSummary(packageContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   145
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   146
        packageWriter.addPackageContent(contentTree, packageContentTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   147
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   149
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   150
     * Build the package summary.
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
     * @param packageContentTree the package content tree to which the summaries will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   153
     *                           be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40508
diff changeset
   154
     * @throws DocletException if there is a problem while building the documentation
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   155
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   156
    protected void buildSummary(Content packageContentTree) throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   157
        Content summaryContentTree = packageWriter.getSummaryHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   158
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   159
        buildInterfaceSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   160
        buildClassSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   161
        buildEnumSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   162
        buildExceptionSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   163
        buildErrorSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   164
        buildAnnotationTypeSummary(summaryContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   165
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 54060
diff changeset
   166
        packageContentTree.add(packageWriter.getPackageSummary(summaryContentTree));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   167
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   169
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   170
     * Build the summary for the interfaces in this package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   171
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   172
     * @param summaryContentTree the summary tree to which the interface summary
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   173
     *                           will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   174
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   175
    protected void buildInterfaceSummary(Content summaryContentTree) {
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   176
        SortedSet<TypeElement> ilist = utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   177
                        ? utils.getTypeElementsAsSortedSet(utils.getInterfaces(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   178
                        : configuration.typeElementCatalog.interfaces(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   179
        SortedSet<TypeElement> interfaces = utils.filterOutPrivateClasses(ilist, configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   180
        if (!interfaces.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   181
            packageWriter.addInterfaceSummary(interfaces, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
        }
7614
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 summary for the classes in this package.
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 summaryContentTree the summary tree to which the class summary will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   189
     *                           be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   190
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   191
    protected void buildClassSummary(Content summaryContentTree) {
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   192
        SortedSet<TypeElement> clist = utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   193
            ? utils.getTypeElementsAsSortedSet(utils.getOrdinaryClasses(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   194
            : configuration.typeElementCatalog.ordinaryClasses(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   195
        SortedSet<TypeElement> classes = utils.filterOutPrivateClasses(clist, configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   196
        if (!classes.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   197
            packageWriter.addClassSummary(classes, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   199
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   201
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   202
     * Build the summary for the enums in this package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   203
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   204
     * @param summaryContentTree the summary tree to which the enum summary will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   205
     *                           be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   206
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   207
    protected void buildEnumSummary(Content summaryContentTree) {
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   208
        SortedSet<TypeElement> elist = utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   209
            ? utils.getTypeElementsAsSortedSet(utils.getEnums(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   210
            : configuration.typeElementCatalog.enums(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   211
        SortedSet<TypeElement> enums = utils.filterOutPrivateClasses(elist, configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   212
        if (!enums.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   213
            packageWriter.addEnumSummary(enums, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   215
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   217
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   218
     * Build the summary for the exceptions in this package.
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
     * @param summaryContentTree the summary tree to which the exception summary will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   221
     *                           be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   222
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   223
    protected void buildExceptionSummary(Content summaryContentTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   224
        Set<TypeElement> iexceptions =
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   225
            utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   226
                ? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   227
                : configuration.typeElementCatalog.exceptions(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   228
        SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   229
                configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   230
        if (!exceptions.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   231
            packageWriter.addExceptionSummary(exceptions, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   233
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   235
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   236
     * Build the summary for the errors in this package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   237
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   238
     * @param summaryContentTree the summary tree to which the error summary will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   239
     *                           be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   240
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   241
    protected void buildErrorSummary(Content summaryContentTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   242
        Set<TypeElement> ierrors =
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   243
            utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   244
                ? utils.getTypeElementsAsSortedSet(utils.getErrors(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   245
                : configuration.typeElementCatalog.errors(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   246
        SortedSet<TypeElement> errors = utils.filterOutPrivateClasses(ierrors, configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   247
        if (!errors.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   248
            packageWriter.addErrorSummary(errors, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   250
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   252
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   253
     * Build the summary for the annotation type in this package.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   254
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   255
     * @param summaryContentTree the summary tree to which the annotation type
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   256
     *                           summary will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   257
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   258
    protected void buildAnnotationTypeSummary(Content summaryContentTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   259
        SortedSet<TypeElement> iannotationTypes =
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents: 40303
diff changeset
   260
            utils.isSpecified(packageElement)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   261
                ? utils.getTypeElementsAsSortedSet(utils.getAnnotationTypes(packageElement))
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   262
                : configuration.typeElementCatalog.annotationTypes(packageElement);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   263
        SortedSet<TypeElement> annotationTypes = utils.filterOutPrivateClasses(iannotationTypes,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   264
                configuration.javafx);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   265
        if (!annotationTypes.isEmpty()) {
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   266
            packageWriter.addAnnotationTypeSummary(annotationTypes, summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
        }
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   268
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   269
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   270
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   271
     * Build the description of the summary.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   272
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   273
     * @param packageContentTree the tree to which the package description will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   274
     *                           be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   275
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   276
    protected void buildPackageDescription(Content packageContentTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   277
        if (configuration.nocomment) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   278
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   279
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   280
        packageWriter.addPackageDescription(packageContentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   281
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   282
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   283
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   284
     * Build the tags of the summary.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   285
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   286
     * @param packageContentTree the tree to which the package tags will be added
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   287
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   288
    protected void buildPackageTags(Content packageContentTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   289
        if (configuration.nocomment) {
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   290
            return;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   291
        }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   292
        packageWriter.addPackageTags(packageContentTree);
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   293
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
}