1/*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package jdk.javadoc.internal.doclets.toolkit;
27
28import java.util.List;
29import java.util.SortedSet;
30
31import javax.lang.model.element.TypeElement;
32
33import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
34
35/**
36 * The interface for writing package summary output.
37 *
38 *  <p><b>This is NOT part of any supported API.
39 *  If you write code that depends on this, you do so at your own risk.
40 *  This code and its internal interfaces are subject to change or
41 *  deletion without notice.</b>
42 *
43 * @author Jamie Ho
44 * @author Bhavesh Patel (Modified)
45 */
46
47public interface PackageSummaryWriter {
48
49    /**
50     * Get the header for the summary.
51     *
52     * @param heading Package name.
53     * @return the header to be added to the content tree
54     */
55    public abstract Content getPackageHeader(String heading);
56
57    /**
58     * Get the header for the package content.
59     *
60     * @return a content tree for the package content header
61     */
62    public abstract Content getContentHeader();
63
64    /**
65     * Get the header for the package summary.
66     *
67     * @return a content tree with the package summary header
68     */
69    public abstract Content getSummaryHeader();
70
71    /**
72     * Adds the table of classes to the documentation tree.
73     *
74     * @param classes the array of classes to document.
75     * @param label the label for this table.
76     * @param tableSummary the summary string for the table
77     * @param tableHeader array of table headers
78     * @param summaryContentTree the content tree to which the summaries will be added
79     */
80    public abstract void addClassesSummary(SortedSet<TypeElement> classes, String label,
81            String tableSummary, List<String> tableHeader, Content summaryContentTree);
82
83    /**
84     * Adds the package description from the "packages.html" file to the documentation
85     * tree.
86     *
87     * @param packageContentTree the content tree to which the package description
88     *                           will be added
89     */
90    public abstract void addPackageDescription(Content packageContentTree);
91
92    /**
93     * Adds the tag information from the "packages.html" file to the documentation
94     * tree.
95     *
96     * @param packageContentTree the content tree to which the package tags will
97     *                           be added
98     */
99    public abstract void addPackageTags(Content packageContentTree);
100
101    /**
102     * Adds the tag information from the "packages.html" or "package-info.java" file to the
103     * documentation tree.
104     *
105     * @param contentTree the content tree to which the package content tree will be added
106     * @param packageContentTree the package content tree to be added
107     */
108    public abstract void addPackageContent(Content contentTree, Content packageContentTree);
109
110    /**
111     * Adds the footer to the documentation tree.
112     *
113     * @param contentTree the tree to which the footer will be added
114     */
115    public abstract void addPackageFooter(Content contentTree);
116
117    /**
118     * Print the package summary document.
119     *
120     * @param contentTree the content tree that will be printed
121     * @throws DocFileIOException if there is a problem while writing the document
122     */
123    public abstract void printDocument(Content contentTree) throws DocFileIOException;
124
125}
126