MemberSummaryWriter.java revision 3233:b5d08bc0d224
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.io.*;
29import java.util.*;
30
31import javax.lang.model.element.Element;
32import javax.lang.model.element.TypeElement;
33
34import com.sun.source.doctree.DocTree;
35
36/**
37 * The interface for writing member summary output.
38 *
39 *  <p><b>This is NOT part of any supported API.
40 *  If you write code that depends on this, you do so at your own risk.
41 *  This code and its internal interfaces are subject to change or
42 *  deletion without notice.</b>
43 *
44 * @author Jamie Ho
45 * @author Bhavesh Patel (Modified)
46 */
47
48public interface MemberSummaryWriter {
49
50    /**
51     * Get the member summary header for the given class.
52     *
53     * @param typeElement the class the summary belongs to
54     * @param memberSummaryTree the content tree to which the member summary will be added
55     * @return a content tree for the member summary header
56     */
57    public Content getMemberSummaryHeader(TypeElement typeElement,
58            Content memberSummaryTree);
59
60    /**
61     * Get the summary table for the given class.
62     *
63     * @param typeElement the class the summary table belongs to
64     * @param tableContents list of contents that will be added to the summary table
65     * @return a content tree for the member summary table
66     */
67    public Content getSummaryTableTree(TypeElement typeElement,
68            List<Content> tableContents);
69
70    /**
71     * Add the member summary for the given class and member.
72     *
73     * @param typeElement the class the summary belongs to
74     * @param member the member that is documented
75     * @param firstSentenceTags the tags for the sentence being documented
76     * @param tableContents list of contents to which the summary will be added
77     * @param counter the counter for determining id and style for the table row
78     */
79    public void addMemberSummary(TypeElement typeElement, Element member,
80            List<? extends DocTree> firstSentenceTags, List<Content> tableContents, int counter);
81
82    /**
83     * Get the inherited member summary header for the given class.
84     *
85     * @param typeElement the class the summary belongs to
86     * @return a content tree containing the inherited summary header
87     */
88    public Content getInheritedSummaryHeader(TypeElement typeElement);
89
90    /**
91     * Add the inherited member summary for the given class and member.
92     *
93     * @param typeElement the class the inherited member belongs to
94     * @param member the inherited member that is being documented
95     * @param isFirst true if this is the first member in the list
96     * @param isLast true if this is the last member in the list
97     * @param linksTree the content tree to which the links will be added
98     */
99    public void addInheritedMemberSummary(TypeElement typeElement,
100        Element member, boolean isFirst, boolean isLast,
101        Content linksTree);
102
103    /**
104     * Get inherited summary links.
105     *
106     * @return a content tree containing the inherited summary links
107     */
108    public Content getInheritedSummaryLinksTree();
109
110    /**
111     * Add the member tree to the member summary tree.
112     *
113     * @param memberSummaryTree the content tree representing the member summary
114     * @param memberTree the content tree representing the member
115     */
116    public void addMemberTree(Content memberSummaryTree, Content memberTree);
117
118    /**
119     * Get the member tree.
120     *
121     * @param memberTree the content tree representing the member
122     * @return a content tree for the member
123     */
124    public Content getMemberTree(Content memberTree);
125
126    /**
127     * Close the writer.
128     */
129    public void close() throws IOException;
130}
131