001/* 002 * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. 003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 004 * 005 * This code is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU General Public License version 2 only, as 007 * published by the Free Software Foundation. Oracle designates this 008 * particular file as subject to the "Classpath" exception as provided 009 * by Oracle in the LICENSE file that accompanied this code. 010 * 011 * This code is distributed in the hope that it will be useful, but WITHOUT 012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 014 * version 2 for more details (a copy is included in the LICENSE file that 015 * accompanied this code). 016 * 017 * You should have received a copy of the GNU General Public License version 018 * 2 along with this work; if not, write to the Free Software Foundation, 019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 020 * 021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 022 * or visit www.oracle.com if you need additional information or have any 023 * questions. 024 */ 025 026package org.jdrupes.mdoclet.internal.doclets.toolkit; 027 028import java.util.*; 029 030import javax.lang.model.element.PackageElement; 031import javax.lang.model.element.TypeElement; 032import javax.lang.model.element.VariableElement; 033 034import org.jdrupes.mdoclet.internal.doclets.toolkit.util.DocFileIOException; 035 036/** 037 * The interface for writing constants summary output. 038 */ 039public interface ConstantsSummaryWriter { 040 041 /** 042 * Get the header for the constant summary documentation. 043 * 044 * @return header that needs to be added to the documentation 045 */ 046 Content getHeader(); 047 048 /** 049 * Get the header for the constant content list. 050 * 051 * @return content header that needs to be added to the documentation 052 */ 053 Content getContentsHeader(); 054 055 /** 056 * Adds the given package name link to the constant content list. 057 * 058 * @param abbrevPackageName the abbreviated package name 059 * @param content the content to which the link will be added 060 */ 061 void addLinkToPackageContent(String abbrevPackageName, Content content); 062 063 /** 064 * Add the content list to the documentation. 065 * 066 * @param content the content that will be added to the list 067 */ 068 void addContentsList(Content content); 069 070 /** 071 * Get the constant summaries for the document. 072 * 073 * @return constant summaries header to be added to the documentation 074 */ 075 Content getConstantSummaries(); 076 077 /** 078 * Adds a header for the given abbreviated package name. 079 * 080 * @param abbrevPackageName the abbreviated package name 081 * @param toContent the summaries documentation 082 */ 083 void addPackageGroup(String abbrevPackageName, Content toContent); 084 085 /** 086 * Get the class summary header for the constants summary. 087 * 088 * @return the header content for the class constants summary 089 */ 090 Content getClassConstantHeader(); 091 092 /** 093 * Add the content list to the documentation summaries. 094 * 095 * @param fromClassConstant the class constant content that will be added to the list 096 */ 097 void addClassConstant(Content fromClassConstant); 098 099 /** 100 * Adds the constant member table to the documentation. 101 * 102 * @param typeElement the class whose constants are being documented. 103 * @param fields the constants being documented. 104 * @param target the content to which the constant member 105 * table content will be added 106 */ 107 void addConstantMembers(TypeElement typeElement, 108 Collection<VariableElement> fields, 109 Content target); 110 111 /** 112 * Add the summaries list to the content. 113 * 114 * @param content the summaries content that will be added to the list 115 */ 116 void addConstantSummaries(Content content); 117 118 /** 119 * Adds the footer for the summary documentation. 120 */ 121 void addFooter(); 122 123 /** 124 * Print the constants summary document. 125 * 126 * @param content the content which should be printed 127 * @throws DocFileIOException if there is a problem while writing the document 128 */ 129 void printDocument(Content content) throws DocFileIOException; 130}