langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java
changeset 40587 1c355ea550ed
parent 35426 374342e56a56
child 42000 8b7412f7eecd
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    31 import javax.lang.model.element.TypeElement;
    31 import javax.lang.model.element.TypeElement;
    32 import javax.lang.model.element.VariableElement;
    32 import javax.lang.model.element.VariableElement;
    33 
    33 
    34 import jdk.javadoc.internal.doclets.toolkit.Configuration;
    34 import jdk.javadoc.internal.doclets.toolkit.Configuration;
    35 import jdk.javadoc.internal.doclets.toolkit.Content;
    35 import jdk.javadoc.internal.doclets.toolkit.Content;
       
    36 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    36 import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
    37 import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
    37 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    38 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
    38 
    39 
    39 
    40 
    40 /**
    41 /**
   101      * Construct a new FieldBuilder.
   102      * Construct a new FieldBuilder.
   102      *
   103      *
   103      * @param context  the build context.
   104      * @param context  the build context.
   104      * @param typeElement the class whoses members are being documented.
   105      * @param typeElement the class whoses members are being documented.
   105      * @param writer the doclet specific writer.
   106      * @param writer the doclet specific writer.
       
   107      * @return the new FieldBuilder
   106      */
   108      */
   107     public static FieldBuilder getInstance(Context context,
   109     public static FieldBuilder getInstance(Context context,
   108             TypeElement typeElement,
   110             TypeElement typeElement,
   109             FieldWriter writer) {
   111             FieldWriter writer) {
   110         return new FieldBuilder(context, typeElement, writer);
   112         return new FieldBuilder(context, typeElement, writer);
   138     public VisibleMemberMap getVisibleMemberMap() {
   140     public VisibleMemberMap getVisibleMemberMap() {
   139         return visibleMemberMap;
   141         return visibleMemberMap;
   140     }
   142     }
   141 
   143 
   142     /**
   144     /**
   143      * summaryOrder.size()
   145      * Returns whether or not there are members to document.
       
   146      *
       
   147      * @return whether or not there are members to document
   144      */
   148      */
   145     @Override
   149     @Override
   146     public boolean hasMembersToDocument() {
   150     public boolean hasMembersToDocument() {
   147         return !fields.isEmpty();
   151         return !fields.isEmpty();
   148     }
   152     }
   150     /**
   154     /**
   151      * Build the field documentation.
   155      * Build the field documentation.
   152      *
   156      *
   153      * @param node the XML element that specifies which components to document
   157      * @param node the XML element that specifies which components to document
   154      * @param memberDetailsTree the content tree to which the documentation will be added
   158      * @param memberDetailsTree the content tree to which the documentation will be added
   155      */
   159      * @throws DocletException if there is a problem while building the documentation
   156     public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
   160      */
       
   161     public void buildFieldDoc(XMLNode node, Content memberDetailsTree) throws DocletException {
   157         if (writer == null) {
   162         if (writer == null) {
   158             return;
   163             return;
   159         }
   164         }
   160         if (!fields.isEmpty()) {
   165         if (!fields.isEmpty()) {
   161             Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(typeElement, memberDetailsTree);
   166             Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(typeElement, memberDetailsTree);