langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ModuleSummaryWriter.java
author bpatel
Thu, 28 Apr 2016 05:10:11 +0000
changeset 37747 878801512393
parent 36526 3b41f1c69604
child 38911 48a00b5ee366
permissions -rw-r--r--
8154119: Module summary page should display module description Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    25
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    27
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import java.io.*;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import java.util.Set;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    30
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import javax.lang.model.element.PackageElement;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    32
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    33
/**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    34
 * The interface for writing module summary output.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    35
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    36
 *  <p><b>This is NOT part of any supported API.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    37
 *  If you write code that depends on this, you do so at your own risk.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    38
 *  This code and its internal interfaces are subject to change or
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    39
 *  deletion without notice.</b>
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    40
 *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    41
 * @author Bhavesh Patel
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    42
 */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    43
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    44
public interface ModuleSummaryWriter {
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    45
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    46
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    47
     * Get the header for the summary.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    48
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    49
     * @param heading module name.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    50
     * @return the header to be added to the content tree
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    51
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    52
    public abstract Content getModuleHeader(String heading);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    53
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    54
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    55
     * Get the header for the module content.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    56
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    57
     * @return a content tree for the module content header
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    58
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    59
    public abstract Content getContentHeader();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    60
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    61
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    62
     * Get the header for the summary header.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    63
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    64
     * @return a content tree with the summary header
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    65
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    66
    public abstract Content getSummaryHeader();
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    67
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    68
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    69
     * Get the header for the summary tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    70
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    71
     * @param summaryContentTree the content tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    72
     * @return a content tree with the summary tree
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    73
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    74
    public abstract Content getSummaryTree(Content summaryContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    75
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    76
    /**
37747
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    77
     * Adds the module description.
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    78
     *
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    79
     * @param moduleContentTree the content tree to which the module description
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    80
     *                           will be added
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    81
     */
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    82
    public abstract void addModuleDescription(Content moduleContentTree);
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    83
878801512393 8154119: Module summary page should display module description
bpatel
parents: 36526
diff changeset
    84
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    85
     * Adds the table of packages to the documentation tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    86
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    87
     * @param packages the set of packages that should be added.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    88
     * @param label the label for this table.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    89
     * @param tableSummary the summary string for the table
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    90
     * @param summaryContentTree the content tree to which the summary will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    91
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    92
    public abstract void addPackagesSummary(Set<PackageElement> packages, String label,
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    93
            String tableSummary, Content summaryContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    94
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    95
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    96
     * Adds the module content tree to the documentation tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    97
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    98
     * @param contentTree the tree to which the module content tree will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
    99
     * @param moduleContentTree the content tree that will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   100
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   101
    public abstract void addModuleContent(Content contentTree, Content moduleContentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   102
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   103
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   104
     * Adds the footer to the documentation tree.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   105
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   106
     * @param contentTree the tree to which the footer will be added
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   107
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   108
    public abstract void addModuleFooter(Content contentTree);
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   109
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   110
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   111
     * Print the module summary document.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   112
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   113
     * @param contentTree the content tree that will be printed
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   114
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   115
    public abstract void printDocument(Content contentTree) throws IOException;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   116
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   117
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   118
     * Close the writer.
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   119
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   120
    public abstract void close() throws IOException;
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   121
3b41f1c69604 8142968: Module System implementation
alanb
parents:
diff changeset
   122
}