langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java
changeset 7614 cfadc977ca75
parent 5520 86e4b9a9da40
child 7681 1f0819a3341f
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Tue Nov 30 09:38:48 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Wed Dec 01 11:02:38 2010 -0800
@@ -37,85 +37,149 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface ClassWriter {
 
     /**
-     * Write the header of the page.
-     * @param header the header to write.
+     * Get the header of the page.
+     *
+     * @param header the header string to write
+     * @return header content that needs to be added to the documentation
      */
-    public void writeHeader(String header);
+    public Content getHeader(String header);
 
     /**
-     * Write the class tree documentation.
+     * Get the class content header.
+     *
+     * @return class content header that needs to be added to the documentation
      */
-    public void writeClassTree();
+    public Content getClassContentHeader();
+
+    /**
+     * Add the class tree documentation.
+     *
+     * @param classContentTree class content tree to which the documentation will be added
+     */
+    public void addClassTree(Content classContentTree);
 
     /**
-     * Write all implemented interfaces if this is a class.
+     * Get the class information tree header.
+     *
+     * @return class informaion tree header that needs to be added to the documentation
      */
-    public void writeImplementedInterfacesInfo();
+    public Content getClassInfoTreeHeader();
 
     /**
-     * Write all super interfaces if this is an interface.
+     * Add the type parameter information.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSuperInterfacesInfo();
+    public void addTypeParamInfo(Content classInfoTree);
 
     /**
-     * Write the type parameter information.
+     * Add all super interfaces if this is an interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeTypeParamInfo();
+    public void addSuperInterfacesInfo(Content classInfoTree);
+
+    /**
+     * Add all implemented interfaces if this is a class.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
+     */
+    public void addImplementedInterfacesInfo(Content classInfoTree);
 
     /**
-     * Write all the classes that extend this one.
+     * Add all the classes that extend this one.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSubClassInfo();
+    public void addSubClassInfo(Content classInfoTree);
 
     /**
-     * Write all the interfaces that extend this one.
+     * Add all the interfaces that extend this one.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSubInterfacesInfo();
+    public void addSubInterfacesInfo(Content classInfoTree);
 
     /**
-     * If this is an interface, write all classes that implement this
+     * If this is an interface, add all classes that implement this
      * interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeInterfaceUsageInfo ();
+    public void addInterfaceUsageInfo(Content classInfoTree);
 
     /**
-     * If this is an inner class or interface, write the enclosing class or
+     * If this is an inner class or interface, add the enclosing class or
      * interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeNestedClassInfo ();
+    public void addNestedClassInfo (Content classInfoTree);
 
     /**
-     * If this class is deprecated, write the appropriate information.
+     * Get the class information.
+     *
+     * @param classInfoTree content tree conatining the class information
+     * @return a content tree for the class
      */
-    public void writeClassDeprecationInfo ();
+    public Content getClassInfo(Content classInfoTree);
 
     /**
-     * Write the signature of the current class.
+     * If this class is deprecated, add the appropriate information.
      *
-     * @param modifiers the modifiers for the signature.
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeClassSignature(String modifiers);
+    public void addClassDeprecationInfo (Content classInfoTree);
+
+    /**
+     * Add the signature of the current class content tree.
+     *
+     * @param modifiers the modifiers for the signature
+     * @param classInfoTree the class content tree to which the signature will be added
+     */
+    public void addClassSignature(String modifiers, Content classInfoTree);
 
     /**
      * Build the class description.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeClassDescription();
+    public void addClassDescription(Content classInfoTree);
+
+    /**
+     * Add the tag information for the current class.
+     *
+     * @param classInfoTree content tree to which the tag information will be added
+     */
+    public void addClassTagInfo(Content classInfoTree);
 
     /**
-     * Write the tag information for the current class.
+     * Get the member tree header for the class.
+     *
+     * @return a content tree for the member tree header
      */
-    public void writeClassTagInfo();
+    public Content getMemberTreeHeader();
 
     /**
-     * Write the footer of the page.
+     * Add the footer of the page.
+     *
+     * @param contentTree content tree to which the footer will be added
      */
-    public void writeFooter();
+    public void addFooter(Content contentTree);
+
+    /**
+     * Print the document.
+     *
+     * @param contentTree content tree that will be printed as a document
+     */
+    public void printDocument(Content contentTree);
 
     /**
      * Close the writer.
@@ -130,8 +194,18 @@
     public ClassDoc getClassDoc();
 
     /**
-     * Perform any operations that are necessary when the member summary
-     * finished building.
+     * Get the member summary tree.
+     *
+     * @param memberTree the content tree used to build the summary tree
+     * @return a content tree for the member summary
      */
-    public void completeMemberSummaryBuild();
+    public Content getMemberSummaryTree(Content memberTree);
+
+    /**
+     * Get the member details tree.
+     *
+     * @param memberTree the content tree used to build the details tree
+     * @return a content tree for the member details
+     */
+    public Content getMemberDetailsTree(Content memberTree);
 }