13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.toolkit.builders;
27
28 import java.util.*;
29
30 import javax.lang.model.element.PackageElement;
31
32 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
33 import jdk.javadoc.internal.doclets.toolkit.DocletException;
34 import jdk.javadoc.internal.doclets.toolkit.Messages;
35 import jdk.javadoc.internal.doclets.toolkit.Resources;
36 import jdk.javadoc.internal.doclets.toolkit.util.Utils;
37
38
39 /**
40 * The superclass for all builders. A builder is a class that provides
41 * the structure and content of API documentation. A builder is completely
42 * doclet independent which means that any doclet can use builders to
43 * construct documentation, as long as it implements the appropriate
44 * writer interfaces. For example, if a doclet wanted to use
45 * {@link ConstantsSummaryBuilder} to build a constant summary, all it has to
46 * do is implement the ConstantsSummaryWriter interface and pass it to the
47 * builder using a WriterFactory.
48 *
49 * <p><b>This is NOT part of any supported API.
50 * If you write code that depends on this, you do so at your own risk.
51 * This code and its internal interfaces are subject to change or
52 * deletion without notice.</b>
59 */
60 final BaseConfiguration configuration;
61
62 /**
63 * Keep track of which packages we have seen for
64 * efficiency purposes. We don't want to copy the
65 * doc files multiple times for a single package.
66 */
67 final Set<PackageElement> containingPackagesSeen;
68
69 Context(BaseConfiguration configuration, Set<PackageElement> containingPackagesSeen) {
70 this.configuration = configuration;
71 this.containingPackagesSeen = containingPackagesSeen;
72 }
73 }
74
75 /**
76 * The configuration used in this run of the doclet.
77 */
78 protected final BaseConfiguration configuration;
79
80 protected final BuilderFactory builderFactory;
81 protected final Messages messages;
82 protected final Resources resources;
83 protected final Utils utils;
84
85 /**
86 * Keep track of which packages we have seen for
87 * efficiency purposes. We don't want to copy the
88 * doc files multiple times for a single package.
89 */
90 protected final Set<PackageElement> containingPackagesSeen;
91
92 /**
93 * Construct a Builder.
94 * @param c a context providing information used in this run of the doclet
95 */
96 public AbstractBuilder(Context c) {
97 this.configuration = c.configuration;
98 this.builderFactory = configuration.getBuilderFactory();
99 this.messages = configuration.getMessages();
100 this.resources = configuration.getResources();
101 this.utils = configuration.utils;
102 this.containingPackagesSeen = c.containingPackagesSeen;
103 }
104
105 /**
106 * Build the documentation.
107 *
108 * @throws DocletException if there is a problem building the documentation
109 */
110 public abstract void build() throws DocletException;
111 }
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.javadoc.internal.doclets.toolkit.builders;
27
28 import java.util.*;
29
30 import javax.lang.model.element.PackageElement;
31
32 import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
33 import jdk.javadoc.internal.doclets.toolkit.BaseOptions;
34 import jdk.javadoc.internal.doclets.toolkit.DocletException;
35 import jdk.javadoc.internal.doclets.toolkit.Messages;
36 import jdk.javadoc.internal.doclets.toolkit.Resources;
37 import jdk.javadoc.internal.doclets.toolkit.util.Utils;
38
39
40 /**
41 * The superclass for all builders. A builder is a class that provides
42 * the structure and content of API documentation. A builder is completely
43 * doclet independent which means that any doclet can use builders to
44 * construct documentation, as long as it implements the appropriate
45 * writer interfaces. For example, if a doclet wanted to use
46 * {@link ConstantsSummaryBuilder} to build a constant summary, all it has to
47 * do is implement the ConstantsSummaryWriter interface and pass it to the
48 * builder using a WriterFactory.
49 *
50 * <p><b>This is NOT part of any supported API.
51 * If you write code that depends on this, you do so at your own risk.
52 * This code and its internal interfaces are subject to change or
53 * deletion without notice.</b>
60 */
61 final BaseConfiguration configuration;
62
63 /**
64 * Keep track of which packages we have seen for
65 * efficiency purposes. We don't want to copy the
66 * doc files multiple times for a single package.
67 */
68 final Set<PackageElement> containingPackagesSeen;
69
70 Context(BaseConfiguration configuration, Set<PackageElement> containingPackagesSeen) {
71 this.configuration = configuration;
72 this.containingPackagesSeen = containingPackagesSeen;
73 }
74 }
75
76 /**
77 * The configuration used in this run of the doclet.
78 */
79 protected final BaseConfiguration configuration;
80 protected final BaseOptions options;
81
82 protected final BuilderFactory builderFactory;
83 protected final Messages messages;
84 protected final Resources resources;
85 protected final Utils utils;
86
87 /**
88 * Keep track of which packages we have seen for
89 * efficiency purposes. We don't want to copy the
90 * doc files multiple times for a single package.
91 */
92 protected final Set<PackageElement> containingPackagesSeen;
93
94 /**
95 * Construct a Builder.
96 * @param c a context providing information used in this run of the doclet
97 */
98 public AbstractBuilder(Context c) {
99 this.configuration = c.configuration;
100 this.options = configuration.getOptions();
101 this.builderFactory = configuration.getBuilderFactory();
102 this.messages = configuration.getMessages();
103 this.resources = configuration.getResources();
104 this.utils = configuration.utils;
105 this.containingPackagesSeen = c.containingPackagesSeen;
106 }
107
108 /**
109 * Build the documentation.
110 *
111 * @throws DocletException if there is a problem building the documentation
112 */
113 public abstract void build() throws DocletException;
114 }
|