langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java
changeset 14542 7062120649c2
parent 14260 727a84636f12
child 19667 fdfce85627a9
equal deleted inserted replaced
14541:36f9d11fc9aa 14542:7062120649c2
    50  * @author Jamie Ho
    50  * @author Jamie Ho
    51  * @since 1.5
    51  * @since 1.5
    52  */
    52  */
    53 
    53 
    54 public abstract class AbstractBuilder {
    54 public abstract class AbstractBuilder {
       
    55     public static class Context {
       
    56         /**
       
    57          * The configuration used in this run of the doclet.
       
    58          */
       
    59         final Configuration configuration;
       
    60 
       
    61         /**
       
    62          * Keep track of which packages we have seen for
       
    63          * efficiency purposes.  We don't want to copy the
       
    64          * doc files multiple times for a single package.
       
    65          */
       
    66         final Set<String> containingPackagesSeen;
       
    67 
       
    68         /**
       
    69          * Shared parser for the builder XML file
       
    70          */
       
    71         final LayoutParser layoutParser;
       
    72 
       
    73         Context(Configuration configuration,
       
    74                 Set<String> containingPackagesSeen,
       
    75                 LayoutParser layoutParser) {
       
    76             this.configuration = configuration;
       
    77             this.containingPackagesSeen = containingPackagesSeen;
       
    78             this.layoutParser = layoutParser;
       
    79         }
       
    80     }
    55 
    81 
    56     /**
    82     /**
    57      * The configuration used in this run of the doclet.
    83      * The configuration used in this run of the doclet.
    58      */
    84      */
    59     protected Configuration configuration;
    85     protected final Configuration configuration;
    60 
    86 
    61     /**
    87     /**
    62      * Keep track of which packages we have seen for
    88      * Keep track of which packages we have seen for
    63      * efficiency purposes.  We don't want to copy the
    89      * efficiency purposes.  We don't want to copy the
    64      * doc files multiple times for a single package.
    90      * doc files multiple times for a single package.
    65      */
    91      */
    66     protected static Set<String> containingPackagesSeen;
    92     protected final Set<String> containingPackagesSeen;
       
    93 
       
    94     protected final LayoutParser layoutParser;
    67 
    95 
    68     /**
    96     /**
    69      * True if we want to print debug output.
    97      * True if we want to print debug output.
    70      */
    98      */
    71     protected static final boolean DEBUG = false;
    99     protected static final boolean DEBUG = false;
    73     /**
   101     /**
    74      * Construct a Builder.
   102      * Construct a Builder.
    75      * @param configuration the configuration used in this run
   103      * @param configuration the configuration used in this run
    76      *        of the doclet.
   104      *        of the doclet.
    77      */
   105      */
    78     public AbstractBuilder(Configuration configuration) {
   106     public AbstractBuilder(Context c) {
    79         this.configuration = configuration;
   107         this.configuration = c.configuration;
       
   108         this.containingPackagesSeen = c.containingPackagesSeen;
       
   109         this.layoutParser = c.layoutParser;
    80     }
   110     }
    81 
   111 
    82     /**
   112     /**
    83      * Return the name of this builder.
   113      * Return the name of this builder.
    84      *
   114      *