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 26 package jdk.javadoc.internal.doclets.toolkit; 27 28 import java.util.SortedSet; 29 30 import javax.lang.model.element.TypeElement; 31 32 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; 33 34 /** 35 * The interface for writing package summary output. 36 * 37 * <p><b>This is NOT part of any supported API. 38 * If you write code that depends on this, you do so at your own risk. 39 * This code and its internal interfaces are subject to change or 40 * deletion without notice.</b> 41 * 42 * @author Jamie Ho 43 * @author Bhavesh Patel (Modified) 44 */ 45 46 public interface PackageSummaryWriter { 47 48 /** 49 * Get the header for the summary. 50 * 51 * @param heading Package name. 52 * @return the header to be added to the content tree 53 */ 54 public abstract Content getPackageHeader(String heading); 55 56 /** 57 * Get the header for the package content. 58 * 59 * @return a content tree for the package content header 60 */ 61 public abstract Content getContentHeader(); 62 63 /** 64 * Get the header for the package summary. 65 * 66 * @return a content tree with the package summary header 67 */ 68 public abstract Content getSummaryHeader(); 69 70 /** 71 * Adds the table of interfaces to the documentation tree. 72 * 73 * @param interfaces the interfaces to document. 74 * @param summaryContentTree the content tree to which the summaries will be added 75 */ 76 public abstract void addInterfaceSummary(SortedSet<TypeElement> interfaces, 77 Content summaryContentTree); 78 79 /** 80 * Adds the table of classes to the documentation tree. 81 * 82 * @param classes the classes to document. 83 * @param summaryContentTree the content tree to which the summaries will be added 84 */ 85 public abstract void addClassSummary(SortedSet<TypeElement> classes, 86 Content summaryContentTree); 87 88 /** 89 * Adds the table of enums to the documentation tree. 90 * 91 * @param enums the enums to document. 92 * @param summaryContentTree the content tree to which the summaries will be added 93 */ 94 public abstract void addEnumSummary(SortedSet<TypeElement> enums, 95 Content summaryContentTree); 96 97 /** 98 * Adds the table of exceptions to the documentation tree. 99 * 100 * @param exceptions the exceptions to document. 101 * @param summaryContentTree the content tree to which the summaries will be added 102 */ 103 public abstract void addExceptionSummary(SortedSet<TypeElement> exceptions, 104 Content summaryContentTree); 105 106 /** 107 * Adds the table of errors to the documentation tree. 108 * 109 * @param errors the errors to document. 110 * @param summaryContentTree the content tree to which the summaries will be added 111 */ 112 public abstract void addErrorSummary(SortedSet<TypeElement> errors, 113 Content summaryContentTree); 114 115 /** 116 * Adds the table of annotation types to the documentation tree. 117 * 118 * @param annoTypes the annotation types to document. 119 * @param summaryContentTree the content tree to which the summaries will be added 120 */ 121 public abstract void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, 122 Content summaryContentTree); 123 124 /** 125 * Adds the package description from the "packages.html" file to the documentation 126 * tree. 127 * 128 * @param packageContentTree the content tree to which the package description 129 * will be added 130 */ 131 public abstract void addPackageDescription(Content packageContentTree); 132 133 /** 134 * Adds the tag information from the "packages.html" file to the documentation 135 * tree. 136 * 137 * @param packageContentTree the content tree to which the package tags will 138 * be added 139 */ 140 public abstract void addPackageTags(Content packageContentTree); 141 142 /** 143 * Adds the tag information from the "packages.html" or "package-info.java" file to the 144 * documentation tree. 145 * 146 * @param contentTree the content tree to which the package content tree will be added 147 * @param packageContentTree the package content tree to be added 148 */ 149 public abstract void addPackageContent(Content contentTree, Content packageContentTree); 150 151 /** 152 * Adds the footer to the documentation tree. 153 * 154 * @param contentTree the tree to which the footer will be added 155 */ 156 public abstract void addPackageFooter(Content contentTree); 157 158 /** 159 * Print the package summary document. 160 * 161 * @param contentTree the content tree that will be printed 162 * @throws DocFileIOException if there is a problem while writing the document 163 */ 164 public abstract void printDocument(Content contentTree) throws DocFileIOException; 165 166 }