src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java
changeset 59294 48b88b9c11eb
parent 54596 86c1da00dd6a
equal deleted inserted replaced
59293:5af9fa90cd7b 59294:48b88b9c11eb
    66 
    66 
    67     /**
    67     /**
    68      * Keep track of whether or not this typeElement is an enum.
    68      * Keep track of whether or not this typeElement is an enum.
    69      */
    69      */
    70     private final boolean isEnum;
    70     private final boolean isEnum;
    71 
       
    72     /**
       
    73      * The content tree for the class documentation.
       
    74      */
       
    75     private Content contentTree;
       
    76 
    71 
    77     private final Utils utils;
    72     private final Utils utils;
    78 
    73 
    79     /**
    74     /**
    80      * Construct a new ClassBuilder.
    75      * Construct a new ClassBuilder.
   116     /**
   111     /**
   117      * {@inheritDoc}
   112      * {@inheritDoc}
   118      */
   113      */
   119     @Override
   114     @Override
   120     public void build() throws DocletException {
   115     public void build() throws DocletException {
   121         buildClassDoc(contentTree);
   116         buildClassDoc();
   122     }
   117     }
   123 
   118 
   124      /**
   119      /**
   125       * Handles the {@literal <TypeElement>} tag.
   120       * Handles the {@literal <TypeElement>} tag.
   126       *
   121       *
   127       * @param contentTree the content tree to which the documentation will be added
       
   128       * @throws DocletException if there is a problem while building the documentation
   122       * @throws DocletException if there is a problem while building the documentation
   129       */
   123       */
   130      protected void buildClassDoc(Content contentTree) throws DocletException {
   124      protected void buildClassDoc() throws DocletException {
   131         String key;
   125         String key;
   132         if (isInterface) {
   126         if (isInterface) {
   133             key = "doclet.Interface";
   127             key = "doclet.Interface";
   134         } else if (isEnum) {
   128         } else if (isEnum) {
   135             key = "doclet.Enum";
   129             key = "doclet.Enum";
   136         } else {
   130         } else {
   137             key = "doclet.Class";
   131             key = "doclet.Class";
   138         }
   132         }
   139         contentTree = writer.getHeader(resources.getText(key) + " "
   133         Content contentTree = writer.getHeader(resources.getText(key) + " "
   140                 + utils.getSimpleName(typeElement));
   134                 + utils.getSimpleName(typeElement));
   141         Content classContentTree = writer.getClassContentHeader();
   135         Content classContentTree = writer.getClassContentHeader();
   142 
   136 
   143         buildClassTree(classContentTree);
   137         buildClassTree(classContentTree);
   144         buildClassInfo(classContentTree);
   138         buildClassInfo(classContentTree);
   145         buildMemberSummary(classContentTree);
   139         buildMemberSummary(classContentTree);
   146         buildMemberDetails(classContentTree);
   140         buildMemberDetails(classContentTree);
   147 
   141 
   148         writer.addClassContentTree(contentTree, classContentTree);
   142         writer.addClassContentTree(classContentTree);
   149         writer.addFooter(contentTree);
   143         writer.addFooter();
   150         writer.printDocument(contentTree);
   144         writer.printDocument(contentTree);
   151         copyDocFiles();
   145         copyDocFiles();
   152     }
   146     }
   153 
   147 
   154      /**
   148      /**