src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
changeset 59294 48b88b9c11eb
parent 54596 86c1da00dd6a
equal deleted inserted replaced
59293:5af9fa90cd7b 59294:48b88b9c11eb
    94      * The current member being documented.
    94      * The current member being documented.
    95      */
    95      */
    96     protected Element currentMember;
    96     protected Element currentMember;
    97 
    97 
    98     /**
    98     /**
    99      * The content that will be added to the serialized form documentation tree.
       
   100      */
       
   101     private Content contentTree;
       
   102 
       
   103 
       
   104     /**
       
   105      * Construct a new SerializedFormBuilder.
    99      * Construct a new SerializedFormBuilder.
   106      * @param context  the build context.
   100      * @param context  the build context.
   107      */
   101      */
   108     private SerializedFormBuilder(Context context) {
   102     private SerializedFormBuilder(Context context) {
   109         super(context);
   103         super(context);
   135         writer = configuration.getWriterFactory().getSerializedFormWriter();
   129         writer = configuration.getWriterFactory().getSerializedFormWriter();
   136         if (writer == null) {
   130         if (writer == null) {
   137             //Doclet does not support this output.
   131             //Doclet does not support this output.
   138             return;
   132             return;
   139         }
   133         }
   140         buildSerializedForm(contentTree);
   134         buildSerializedForm();
   141     }
   135     }
   142 
   136 
   143     /**
   137     /**
   144      * Build the serialized form.
   138      * Build the serialized form.
   145      *
   139      *
   146      * @param serializedTree content tree to which the documentation will be added
   140      * @throws DocletException if there is a problem while building the documentation
   147      * @throws DocletException if there is a problem while building the documentation
   141      */
   148      */
   142     protected void buildSerializedForm() throws DocletException {
   149     protected void buildSerializedForm(Content serializedTree) throws DocletException {
   143         Content contentTree = writer.getHeader(resources.getText(
   150         serializedTree = writer.getHeader(resources.getText(
       
   151                 "doclet.Serialized_Form"));
   144                 "doclet.Serialized_Form"));
   152 
   145 
   153         buildSerializedFormSummaries(serializedTree);
   146         buildSerializedFormSummaries();
   154 
   147 
   155         writer.addFooter(serializedTree);
   148         writer.addFooter();
   156         writer.printDocument(serializedTree);
   149         writer.printDocument(contentTree);
   157     }
   150     }
   158 
   151 
   159     /**
   152     /**
   160      * Build the serialized form summaries.
   153      * Build the serialized form summaries.
   161      *
   154      *
   162      * @param serializedTree content tree to which the documentation will be added
   155      * @throws DocletException if there is a problem while building the documentation
   163      * @throws DocletException if there is a problem while building the documentation
   156      */
   164      */
   157     protected void buildSerializedFormSummaries()
   165     protected void buildSerializedFormSummaries(Content serializedTree)
       
   166             throws DocletException {
   158             throws DocletException {
   167         Content serializedSummariesTree = writer.getSerializedSummariesHeader();
   159         Content serializedSummariesTree = writer.getSerializedSummariesHeader();
   168         for (PackageElement pkg : configuration.packages) {
   160         for (PackageElement pkg : configuration.packages) {
   169             currentPackage = pkg;
   161             currentPackage = pkg;
   170 
   162 
   171             buildPackageSerializedForm(serializedSummariesTree);
   163             buildPackageSerializedForm(serializedSummariesTree);
   172         }
   164         }
   173         serializedTree.add(writer.getSerializedContent(
   165         writer.addSerializedContent(serializedSummariesTree);
   174                 serializedSummariesTree));
       
   175     }
   166     }
   176 
   167 
   177     /**
   168     /**
   178      * Build the package serialized form for the current package being processed.
   169      * Build the package serialized form for the current package being processed.
   179      *
   170      *