src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java
author hannesw
Wed, 27 Nov 2019 13:08:16 +0100
changeset 59294 48b88b9c11eb
parent 54596 86c1da00dd6a
permissions -rw-r--r--
8223378: CSS solution for navbar problem with <a> elements is not ideal Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
     2
 * Copyright (c) 2003, 2017, 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;
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.SortedSet;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    29
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    30
import javax.lang.model.element.TypeElement;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    32
import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    33
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * The interface for writing package summary output.
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: 5520
diff changeset
    43
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
public interface PackageSummaryWriter {
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    49
     * Get the header for the summary.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    50
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    51
     * @param heading Package name.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    52
     * @return the header to be added to the content tree
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    54
    public abstract Content getPackageHeader(String heading);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    57
     * Get the header for the package content.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    58
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    59
     * @return a content tree for the package content header
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    61
    public abstract Content getContentHeader();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    64
     * Get the header for the package summary.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    65
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    66
     * @return a content tree with the package summary header
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    67
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    68
    public abstract Content getSummaryHeader();
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    69
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    70
    /**
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    71
     * Adds the table of interfaces to the documentation tree.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    72
     *
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    73
     * @param interfaces the interfaces to document.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    74
     * @param summaryContentTree the content tree to which the summaries will be added
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    75
     */
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    76
    public abstract void addInterfaceSummary(SortedSet<TypeElement> interfaces,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    77
            Content summaryContentTree);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    78
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    79
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
    80
     * Adds the table of classes to the documentation tree.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     *
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    82
     * @param classes the classes to document.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    83
     * @param summaryContentTree the content tree to which the summaries will be added
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    84
     */
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    85
    public abstract void addClassSummary(SortedSet<TypeElement> classes,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    86
            Content summaryContentTree);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    87
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    88
    /**
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    89
     * Adds the table of enums to the documentation tree.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    90
     *
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    91
     * @param enums the enums to document.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    92
     * @param summaryContentTree the content tree to which the summaries will be added
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    93
     */
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    94
    public abstract void addEnumSummary(SortedSet<TypeElement> enums,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    95
            Content summaryContentTree);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    96
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    97
    /**
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    98
     * Adds the table of exceptions to the documentation tree.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
    99
     *
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   100
     * @param exceptions the exceptions to document.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   101
     * @param summaryContentTree the content tree to which the summaries will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     */
47427
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   103
    public abstract void addExceptionSummary(SortedSet<TypeElement> exceptions,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   104
            Content summaryContentTree);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   105
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   106
    /**
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   107
     * Adds the table of errors to the documentation tree.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   108
     *
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   109
     * @param errors the errors to document.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   110
     * @param summaryContentTree the content tree to which the summaries will be added
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   111
     */
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   112
    public abstract void addErrorSummary(SortedSet<TypeElement> errors,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   113
            Content summaryContentTree);
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   114
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   115
    /**
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   116
     * Adds the table of annotation types to the documentation tree.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   117
     *
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   118
     * @param annoTypes the annotation types to document.
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   119
     * @param summaryContentTree the content tree to which the summaries will be added
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   120
     */
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   121
    public abstract void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes,
251676148c62 8189405: More cleanup in HtmlWriter
jjg
parents: 47216
diff changeset
   122
            Content summaryContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   125
     * Adds the package description from the "packages.html" file to the documentation
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   126
     * tree.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   128
     * @param packageContentTree the content tree to which the package description
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   129
     *                           will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   131
    public abstract void addPackageDescription(Content packageContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   134
     * Adds the tag information from the "packages.html" file to the documentation
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   135
     * tree.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   136
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   137
     * @param packageContentTree the content tree to which the package tags will
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   138
     *                           be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     */
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   140
    public abstract void addPackageTags(Content packageContentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    /**
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   143
     * Adds the tag information from the "packages.html" or "package-info.java" file to the
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   144
     * documentation tree.
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   145
     *
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   146
     * @param packageContentTree the package content tree to be added
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   147
     */
59294
48b88b9c11eb 8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents: 54596
diff changeset
   148
    public abstract void addPackageContent(Content packageContentTree);
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   149
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 25874
diff changeset
   150
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   151
     * Adds the footer to the documentation tree.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     */
59294
48b88b9c11eb 8223378: CSS solution for navbar problem with <a> elements is not ideal
hannesw
parents: 54596
diff changeset
   153
    public abstract void addPackageFooter();
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   156
     * Print the package summary document.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5520
diff changeset
   158
     * @param contentTree the content tree that will be printed
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   159
     * @throws DocFileIOException if there is a problem while writing the document
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   161
    public abstract void printDocument(Content contentTree) throws DocFileIOException;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
54596
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   163
    /**
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   164
     * Gets the package summary tree.
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   165
     * @param summaryContentTree the content tree representing the package summary
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   166
     * @return a content tree for the package summary
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   167
     */
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   168
    public abstract Content getPackageSummary(Content summaryContentTree);
86c1da00dd6a 8219998: Eliminate inherently singleton lists
pmuthuswamy
parents: 47427
diff changeset
   169
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
}