langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java
changeset 7614 cfadc977ca75
parent 5520 86e4b9a9da40
child 7681 1f0819a3341f
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Tue Nov 30 09:38:48 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Wed Dec 01 11:02:38 2010 -0800
@@ -25,9 +25,9 @@
 
 package com.sun.tools.doclets.internal.toolkit;
 
-import com.sun.javadoc.*;
 import java.util.*;
 import java.io.*;
+import com.sun.javadoc.*;
 
 /**
  * The interface for writing constants summary output.
@@ -37,38 +37,34 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface ConstantsSummaryWriter {
 
     /**
-     * Write the header for the summary.
-     */
-    public abstract void writeHeader();
-
-    /**
-     * Write the footer for the summary.
-     */
-    public abstract void writeFooter();
-
-    /**
      * Close the writer.
      */
     public abstract void close() throws IOException;
 
     /**
-     * Write the header for the index.
+     * Get the header for the constant summary documentation.
+     *
+     * @return header that needs to be added to the documentation
      */
-    public abstract void writeContentsHeader();
+    public abstract Content getHeader();
 
     /**
-     * Write the footer for the index.
+     * Get the header for the constant content list.
+     *
+     * @return content header that needs to be added to the documentation
      */
-    public abstract void writeContentsFooter();
+    public abstract Content getContentsHeader();
 
     /**
-     * Add the given package name to the index.
+     * Adds the given package name link to the constant content list tree.
+     *
      * @param pkg                    the {@link PackageDoc} to index.
      * @param parsedPackageName      the parsed package name.  We only Write the
      *                               first 2 directory levels of the package
@@ -77,38 +73,70 @@
      * @param WriteedPackageHeaders the set of package headers that have already
      *                              been indexed.  We don't want to index
      *                              something more than once.
+     * @param contentListTree the content tree to which the link will be added
      */
-    public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
-        Set<String> WriteedPackageHeaders);
+    public abstract void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
+        Set<String> WriteedPackageHeaders, Content contentListTree);
 
     /**
-     * Write the given package name.
-     * @param pkg                    the {@link PackageDoc} to index.
-     * @param parsedPackageName      the parsed package name.  We only Write the
-     *                               first 2 directory levels of the package
-     *                               name. For example, java.lang.ref would be
-     *                               indexed as java.lang.*.
+     * Get the content list to be added to the documentation tree.
+     *
+     * @param contentListTree the content that will be added to the list
+     * @return content list that will be added to the documentation tree
      */
-    public abstract void writePackageName(PackageDoc pkg,
-        String parsedPackageName);
+    public abstract Content getContentsList(Content contentListTree);
+
+    /**
+     * Get the constant summaries for the document.
+     *
+     * @return constant summaries header to be added to the documentation tree
+     */
+    public abstract Content getConstantSummaries();
 
     /**
-     * Write the heading for the current table of constants for a given class.
-     * @param cd the class whose constants are being documented.
+     * Adds the given package name.
+     *
+     * @param pkg the {@link PackageDoc} to index.
+     * @param parsedPackageName the parsed package name.  We only Write the
+     *                          first 2 directory levels of the package
+     *                          name. For example, java.lang.ref would be
+     *                          indexed as java.lang.*.
+     * @param summariesTree the documentation tree to which the package name will
+     *                    be written
      */
-    public abstract void writeConstantMembersHeader(ClassDoc cd);
+    public abstract void addPackageName(PackageDoc pkg,
+        String parsedPackageName, Content summariesTree);
 
     /**
-     * Document the given constants.
+     * Get the class summary header for the constants summary.
+     *
+     * @return the header content for the class constants summary
+     */
+    public abstract Content getClassConstantHeader();
+
+    /**
+     * Adds the constant member table to the documentation tree.
+     *
      * @param cd the class whose constants are being documented.
      * @param fields the constants being documented.
+     * @param classConstantTree the documentation tree to which theconstant member
+     *                    table content will be added
      */
-    public abstract void writeConstantMembers(ClassDoc cd, List<FieldDoc> fields);
+    public abstract void addConstantMembers(ClassDoc cd, List<FieldDoc> fields,
+            Content classConstantTree);
 
     /**
-     * Document the given constants.
-     * @param cd the class whose constants are being documented.
+     * Adds the footer for the summary documentation.
+     *
+     * @param contentTree content tree to which the footer will be added
      */
-    public abstract void writeConstantMembersFooter(ClassDoc cd);
+    public abstract void addFooter(Content contentTree);
+
+    /**
+     * Print the constants summary document.
+     *
+     * @param contentTree content tree which should be printed
+     */
+    public abstract void printDocument(Content contentTree);
 
 }