23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package jdk.javadoc.internal.doclets.toolkit.builders; |
26 package jdk.javadoc.internal.doclets.toolkit.builders; |
27 |
27 |
28 import java.io.IOException; |
|
29 import java.util.Set; |
|
30 |
|
31 import javax.lang.model.element.ModuleElement; |
28 import javax.lang.model.element.ModuleElement; |
32 import javax.lang.model.element.PackageElement; |
29 import javax.lang.model.element.PackageElement; |
33 import javax.tools.StandardLocation; |
30 import javax.tools.StandardLocation; |
34 |
31 |
35 import jdk.javadoc.internal.doclets.toolkit.Content; |
32 import jdk.javadoc.internal.doclets.toolkit.Content; |
|
33 import jdk.javadoc.internal.doclets.toolkit.DocletException; |
36 import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter; |
34 import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter; |
37 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
35 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
38 |
36 |
39 |
37 |
40 /** |
38 /** |
103 return new ModuleSummaryBuilder(context, mdle, moduleWriter); |
101 return new ModuleSummaryBuilder(context, mdle, moduleWriter); |
104 } |
102 } |
105 |
103 |
106 /** |
104 /** |
107 * Build the module summary. |
105 * Build the module summary. |
108 */ |
106 * |
109 public void build() throws IOException { |
107 * @throws DocletException if there is a problem while building the documentation |
|
108 */ |
|
109 @Override |
|
110 public void build() throws DocletException { |
110 if (moduleWriter == null) { |
111 if (moduleWriter == null) { |
111 //Doclet does not support this output. |
112 //Doclet does not support this output. |
112 return; |
113 return; |
113 } |
114 } |
114 build(layoutParser.parseXML(ROOT), contentTree); |
115 build(layoutParser.parseXML(ROOT), contentTree); |
115 } |
116 } |
116 |
117 |
117 /** |
118 /** |
118 * {@inheritDoc} |
119 * {@inheritDoc} |
119 */ |
120 */ |
|
121 @Override |
120 public String getName() { |
122 public String getName() { |
121 return ROOT; |
123 return ROOT; |
122 } |
124 } |
123 |
125 |
124 /** |
126 /** |
125 * Build the module documentation. |
127 * Build the module documentation. |
126 * |
128 * |
127 * @param node the XML element that specifies which components to document |
129 * @param node the XML element that specifies which components to document |
128 * @param contentTree the content tree to which the documentation will be added |
130 * @param contentTree the content tree to which the documentation will be added |
129 */ |
131 * @throws DocletException if there is a problem while building the documentation |
130 public void buildModuleDoc(XMLNode node, Content contentTree) throws Exception { |
132 */ |
|
133 public void buildModuleDoc(XMLNode node, Content contentTree) throws DocletException { |
131 contentTree = moduleWriter.getModuleHeader(mdle.getSimpleName().toString()); |
134 contentTree = moduleWriter.getModuleHeader(mdle.getSimpleName().toString()); |
132 buildChildren(node, contentTree); |
135 buildChildren(node, contentTree); |
133 moduleWriter.addModuleFooter(contentTree); |
136 moduleWriter.addModuleFooter(contentTree); |
134 moduleWriter.printDocument(contentTree); |
137 moduleWriter.printDocument(contentTree); |
135 // TEMPORARY: |
138 // TEMPORARY: |
143 * Build the content for the module doc. |
146 * Build the content for the module doc. |
144 * |
147 * |
145 * @param node the XML element that specifies which components to document |
148 * @param node the XML element that specifies which components to document |
146 * @param contentTree the content tree to which the module contents |
149 * @param contentTree the content tree to which the module contents |
147 * will be added |
150 * will be added |
148 */ |
151 * @throws DocletException if there is a problem while building the documentation |
149 public void buildContent(XMLNode node, Content contentTree) { |
152 */ |
|
153 public void buildContent(XMLNode node, Content contentTree) throws DocletException { |
150 Content moduleContentTree = moduleWriter.getContentHeader(); |
154 Content moduleContentTree = moduleWriter.getContentHeader(); |
151 buildChildren(node, moduleContentTree); |
155 buildChildren(node, moduleContentTree); |
152 moduleWriter.addModuleContent(contentTree, moduleContentTree); |
156 moduleWriter.addModuleContent(contentTree, moduleContentTree); |
153 } |
157 } |
154 |
158 |
156 * Build the module summary. |
160 * Build the module summary. |
157 * |
161 * |
158 * @param node the XML element that specifies which components to document |
162 * @param node the XML element that specifies which components to document |
159 * @param moduleContentTree the module content tree to which the summaries will |
163 * @param moduleContentTree the module content tree to which the summaries will |
160 * be added |
164 * be added |
161 */ |
165 * @throws DocletException if there is a problem while building the documentation |
162 public void buildSummary(XMLNode node, Content moduleContentTree) { |
166 */ |
|
167 public void buildSummary(XMLNode node, Content moduleContentTree) throws DocletException { |
163 Content summaryContentTree = moduleWriter.getSummaryHeader(); |
168 Content summaryContentTree = moduleWriter.getSummaryHeader(); |
164 buildChildren(node, summaryContentTree); |
169 buildChildren(node, summaryContentTree); |
165 moduleContentTree.addContent(moduleWriter.getSummaryTree(summaryContentTree)); |
170 moduleContentTree.addContent(moduleWriter.getSummaryTree(summaryContentTree)); |
166 } |
171 } |
167 |
172 |