src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ConstantsSummaryWriter.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2015, 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 com.sun.tools.doclets.internal.toolkit;
  27 
  28 import java.io.*;
  29 import java.util.*;
  30 
  31 import com.sun.javadoc.*;


  32 
  33 /**
  34  * The interface for writing constants summary output.
  35  *
  36  *  <p><b>This is NOT part of any supported API.
  37  *  If you write code that depends on this, you do so at your own risk.
  38  *  This code and its internal interfaces are subject to change or
  39  *  deletion without notice.</b>
  40  *
  41  * @author Jamie Ho
  42  * @author Bhavesh Patel (Modified)
  43  * @since 1.5
  44  */
  45 
  46 public interface ConstantsSummaryWriter {
  47 
  48     /**
  49      * Close the writer.
  50      */
  51     public abstract void close() throws IOException;
  52 
  53     /**
  54      * Get the header for the constant summary documentation.
  55      *
  56      * @return header that needs to be added to the documentation
  57      */
  58     public abstract Content getHeader();
  59 
  60     /**
  61      * Get the header for the constant content list.
  62      *
  63      * @return content header that needs to be added to the documentation
  64      */
  65     public abstract Content getContentsHeader();
  66 
  67     /**
  68      * Adds the given package name link to the constant content list tree.
  69      *
  70      * @param pkg                    the {@link PackageDoc} to index.
  71      * @param parsedPackageName      the parsed package name.  We only Write the
  72      *                               first 2 directory levels of the package
  73      *                               name. For example, java.lang.ref would be
  74      *                               indexed as java.lang.*.
  75      * @param WriteedPackageHeaders the set of package headers that have already
  76      *                              been indexed.  We don't want to index
  77      *                              something more than once.
  78      * @param contentListTree the content tree to which the link will be added
  79      */
  80     public abstract void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
  81         Set<String> WriteedPackageHeaders, Content contentListTree);
  82 
  83     /**
  84      * Add the content list to the documentation tree.
  85      *
  86      * @param contentTree the tree to which the contents list will be added
  87      * @param contentListTree the content that will be added to the list
  88      */
  89     public abstract void addContentsList(Content contentTree, Content contentListTree);
  90 
  91     /**
  92      * Get the constant summaries for the document.
  93      *
  94      * @return constant summaries header to be added to the documentation tree
  95      */
  96     public abstract Content getConstantSummaries();
  97 
  98     /**
  99      * Adds the given package name.
 100      *
 101      * @param parsedPackageName the parsed package name.  We only Write the
 102      *                          first 2 directory levels of the package
 103      *                          name. For example, java.lang.ref would be
 104      *                          indexed as java.lang.*.
 105      * @param summariesTree the summaries documentation tree
 106      * @param first true if the first package is listed
 107      *                    be written
 108      */
 109     public abstract void addPackageName(String parsedPackageName, Content summariesTree, boolean first);
 110 
 111     /**
 112      * Get the class summary header for the constants summary.
 113      *
 114      * @return the header content for the class constants summary
 115      */
 116     public abstract Content getClassConstantHeader();
 117 
 118     /**
 119      * Add the content list to the documentation summaries tree.
 120      *
 121      * @param summariesTree the tree to which the class constants list will be added
 122      * @param classConstantTree the class constant tree that will be added to the list
 123      */
 124     public abstract void addClassConstant(Content summariesTree, Content classConstantTree);
 125 
 126     /**
 127      * Adds the constant member table to the documentation tree.
 128      *
 129      * @param cd the class whose constants are being documented.
 130      * @param fields the constants being documented.
 131      * @param classConstantTree the documentation tree to which theconstant member
 132      *                    table content will be added
 133      */
 134     public abstract void addConstantMembers(ClassDoc cd, List<FieldDoc> fields,
 135             Content classConstantTree);
 136 
 137     /**
 138      * Add the summaries list to the content tree.
 139      *
 140      * @param contentTree the tree to which the summaries list will be added
 141      * @param summariesTree the summaries content tree that will be added to the list
 142      */
 143     public abstract void addConstantSummaries(Content contentTree, Content summariesTree);
 144 
 145     /**
 146      * Adds the footer for the summary documentation.
 147      *
 148      * @param contentTree content tree to which the footer will be added
 149      */
 150     public abstract void addFooter(Content contentTree);
 151 
 152     /**
 153      * Print the constants summary document.
 154      *
   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.io.*;
  29 import java.util.*;
  30 
  31 import javax.lang.model.element.PackageElement;
  32 import javax.lang.model.element.TypeElement;
  33 import javax.lang.model.element.VariableElement;
  34 
  35 /**
  36  * The interface for writing constants 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  * @since 1.5
  46  */
  47 
  48 public interface ConstantsSummaryWriter {
  49 
  50     /**
  51      * Close the writer.
  52      */
  53     public abstract void close() throws IOException;
  54 
  55     /**
  56      * Get the header for the constant summary documentation.
  57      *
  58      * @return header that needs to be added to the documentation
  59      */
  60     public abstract Content getHeader();
  61 
  62     /**
  63      * Get the header for the constant content list.
  64      *
  65      * @return content header that needs to be added to the documentation
  66      */
  67     public abstract Content getContentsHeader();
  68 
  69     /**
  70      * Adds the given package name link to the constant content list tree.
  71      *
  72      * @param pkg                    the {@link PackageElement} to index.
  73      * @param writtenPackageHeaders  the set of package headers that have already
  74      *                               been indexed, we want to index utmost once.





  75      * @param contentListTree        the content tree to which the link will be added
  76      */
  77     public abstract void addLinkToPackageContent(PackageElement pkg,
  78             Set<PackageElement> writtenPackageHeaders, Content contentListTree);
  79 
  80     /**
  81      * Add the content list to the documentation tree.
  82      *
  83      * @param contentTree the tree to which the contents list will be added
  84      * @param contentListTree the content that will be added to the list
  85      */
  86     public abstract void addContentsList(Content contentTree, Content contentListTree);
  87 
  88     /**
  89      * Get the constant summaries for the document.
  90      *
  91      * @return constant summaries header to be added to the documentation tree
  92      */
  93     public abstract Content getConstantSummaries();
  94 
  95     /**
  96      * Adds the given package name.
  97      *
  98      * @param pkg  the parsed package name.  We only Write the
  99      *                          first 2 directory levels of the package
 100      *                          name. For example, java.lang.ref would be
 101      *                          indexed as java.lang.*.
 102      * @param summariesTree the summaries documentation tree
 103      * @param first true if the first package is listed
 104      *                    be written
 105      */
 106     public abstract void addPackageName(PackageElement pkg, Content summariesTree, boolean first);
 107 
 108     /**
 109      * Get the class summary header for the constants summary.
 110      *
 111      * @return the header content for the class constants summary
 112      */
 113     public abstract Content getClassConstantHeader();
 114 
 115     /**
 116      * Add the content list to the documentation summaries tree.
 117      *
 118      * @param summariesTree the tree to which the class constants list will be added
 119      * @param classConstantTree the class constant tree that will be added to the list
 120      */
 121     public abstract void addClassConstant(Content summariesTree, Content classConstantTree);
 122 
 123     /**
 124      * Adds the constant member table to the documentation tree.
 125      *
 126      * @param typeElement the class whose constants are being documented.
 127      * @param fields the constants being documented.
 128      * @param classConstantTree the documentation tree to which theconstant member
 129      *                    table content will be added
 130      */
 131     public abstract void addConstantMembers(TypeElement typeElement, Collection<VariableElement> fields,
 132             Content classConstantTree);
 133 
 134     /**
 135      * Add the summaries list to the content tree.
 136      *
 137      * @param contentTree the tree to which the summaries list will be added
 138      * @param summariesTree the summaries content tree that will be added to the list
 139      */
 140     public abstract void addConstantSummaries(Content contentTree, Content summariesTree);
 141 
 142     /**
 143      * Adds the footer for the summary documentation.
 144      *
 145      * @param contentTree content tree to which the footer will be added
 146      */
 147     public abstract void addFooter(Content contentTree);
 148 
 149     /**
 150      * Print the constants summary document.
 151      *