langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java
changeset 40587 1c355ea550ed
parent 35426 374342e56a56
child 42000 8b7412f7eecd
equal deleted inserted replaced
40519:e17429a7e843 40587:1c355ea550ed
    24  */
    24  */
    25 
    25 
    26 package jdk.javadoc.internal.doclets.toolkit.builders;
    26 package jdk.javadoc.internal.doclets.toolkit.builders;
    27 
    27 
    28 import jdk.javadoc.internal.doclets.toolkit.Content;
    28 import jdk.javadoc.internal.doclets.toolkit.Content;
    29 import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException;
    29 import jdk.javadoc.internal.doclets.toolkit.DocletException;
    30 
    30 
    31 /**
    31 /**
    32  * The superclass for all member builders.  Member builders are only executed
    32  * The superclass for all member builders.  Member builders are only executed
    33  * within Class Builders.  They essentially build sub-components.  For example,
    33  * within Class Builders.  They essentially build sub-components.  For example,
    34  * method documentation is a sub-component of class documentation.
    34  * method documentation is a sub-component of class documentation.
    42  */
    42  */
    43 public abstract class AbstractMemberBuilder extends AbstractBuilder {
    43 public abstract class AbstractMemberBuilder extends AbstractBuilder {
    44 
    44 
    45     /**
    45     /**
    46      * Construct a SubBuilder.
    46      * Construct a SubBuilder.
    47      * @param configuration the configuration used in this run
    47      * @param context a context object, providing information used in this run
    48      *        of the doclet.
    48      *        of the doclet.
    49      */
    49      */
    50     public AbstractMemberBuilder(Context context) {
    50     public AbstractMemberBuilder(Context context) {
    51         super(context);
    51         super(context);
    52     }
    52     }
    53 
    53 
    54     /**
    54     /**
    55      * This method is not supported by sub-builders.
    55      * This method is not supported by sub-builders.
    56      *
    56      *
    57      * @throws DocletAbortException this method will always throw a
    57      * @throws AssertionError always
    58      * DocletAbortException because it is not supported.
       
    59      */
    58      */
    60     public void build() throws DocletAbortException {
    59     @Override
    61         //You may not call the build method in a subbuilder.
    60     public void build() {
    62         throw new DocletAbortException("not supported");
    61         // You may not call the build method in a subbuilder.
       
    62         throw new AssertionError();
    63     }
    63     }
    64 
    64 
    65 
    65 
    66     /**
    66     /**
    67      * Build the sub component if there is anything to document.
    67      * Builds the sub component if there is anything to document.
    68      *
    68      *
    69      * @param node the XML element that specifies which components to document.
    69      * @param node the XML element that specifies which components to document.
    70      * @param contentTree content tree to which the documentation will be added
    70      * @param contentTree content tree to which the documentation will be added
       
    71      * @throws DocletException if there is a problem while building the documentation
    71      */
    72      */
    72     @Override
    73     @Override
    73     public void build(XMLNode node, Content contentTree) {
    74     public void build(XMLNode node, Content contentTree) throws DocletException {
    74         if (hasMembersToDocument()) {
    75         if (hasMembersToDocument()) {
    75             super.build(node, contentTree);
    76             super.build(node, contentTree);
    76         }
    77         }
    77     }
    78     }
    78 
    79 
    79     /**
    80     /**
    80      * Return true if this subbuilder has anything to document.
    81      * Returns true if this subbuilder has anything to document.
    81      *
    82      *
    82      * @return true if this subbuilder has anything to document.
    83      * @return true if this subbuilder has anything to document
    83      */
    84      */
    84     public abstract boolean hasMembersToDocument();
    85     public abstract boolean hasMembersToDocument();
    85 }
    86 }