103 isEnum = false; |
103 isEnum = false; |
104 } |
104 } |
105 } |
105 } |
106 |
106 |
107 /** |
107 /** |
108 * Construct a new ClassBuilder. |
108 * Constructs a new ClassBuilder. |
109 * |
109 * |
110 * @param context the build context |
110 * @param context the build context |
111 * @param typeElement the class being documented. |
111 * @param typeElement the class being documented. |
112 * @param writer the doclet specific writer. |
112 * @param writer the doclet specific writer. |
|
113 * @return the new ClassBuilder |
113 */ |
114 */ |
114 public static ClassBuilder getInstance(Context context, |
115 public static ClassBuilder getInstance(Context context, |
115 TypeElement typeElement, ClassWriter writer) { |
116 TypeElement typeElement, ClassWriter writer) { |
116 return new ClassBuilder(context, typeElement, writer); |
117 return new ClassBuilder(context, typeElement, writer); |
117 } |
118 } |
118 |
119 |
119 /** |
120 /** |
120 * {@inheritDoc} |
121 * {@inheritDoc} |
121 */ |
122 */ |
122 public void build() throws IOException { |
123 @Override |
|
124 public void build() throws DocletException { |
123 build(layoutParser.parseXML(ROOT), contentTree); |
125 build(layoutParser.parseXML(ROOT), contentTree); |
124 } |
126 } |
125 |
127 |
126 /** |
128 /** |
127 * {@inheritDoc} |
129 * {@inheritDoc} |
128 */ |
130 */ |
|
131 @Override |
129 public String getName() { |
132 public String getName() { |
130 return ROOT; |
133 return ROOT; |
131 } |
134 } |
132 |
135 |
133 /** |
136 /** |
134 * Handles the {@literal <TypeElement>} tag. |
137 * Handles the {@literal <TypeElement>} tag. |
135 * |
138 * |
136 * @param node the XML element that specifies which components to document |
139 * @param node the XML element that specifies which components to document |
137 * @param contentTree the content tree to which the documentation will be added |
140 * @param contentTree the content tree to which the documentation will be added |
|
141 * @throws DocletException if there is a problem while building the documentation |
138 */ |
142 */ |
139 public void buildClassDoc(XMLNode node, Content contentTree) throws Exception { |
143 public void buildClassDoc(XMLNode node, Content contentTree) throws DocletException { |
140 String key; |
144 String key; |
141 if (isInterface) { |
145 if (isInterface) { |
142 key = "doclet.Interface"; |
146 key = "doclet.Interface"; |
143 } else if (isEnum) { |
147 } else if (isEnum) { |
144 key = "doclet.Enum"; |
148 key = "doclet.Enum"; |
168 /** |
172 /** |
169 * Build the class information tree documentation. |
173 * Build the class information tree documentation. |
170 * |
174 * |
171 * @param node the XML element that specifies which components to document |
175 * @param node the XML element that specifies which components to document |
172 * @param classContentTree the content tree to which the documentation will be added |
176 * @param classContentTree the content tree to which the documentation will be added |
173 */ |
177 * @throws DocletException if there is a problem while building the documentation |
174 public void buildClassInfo(XMLNode node, Content classContentTree) { |
178 */ |
|
179 public void buildClassInfo(XMLNode node, Content classContentTree) throws DocletException { |
175 Content classInfoTree = writer.getClassInfoTreeHeader(); |
180 Content classInfoTree = writer.getClassInfoTreeHeader(); |
176 buildChildren(node, classInfoTree); |
181 buildChildren(node, classInfoTree); |
177 classContentTree.addContent(writer.getClassInfo(classInfoTree)); |
182 classContentTree.addContent(writer.getClassInfo(classInfoTree)); |
178 } |
183 } |
179 |
184 |
180 /** |
185 /** |
181 * Build the typeparameters of this class. |
186 * Build the type parameters of this class. |
182 * |
187 * |
183 * @param node the XML element that specifies which components to document |
188 * @param node the XML element that specifies which components to document |
184 * @param classInfoTree the content tree to which the documentation will be added |
189 * @param classInfoTree the content tree to which the documentation will be added |
185 */ |
190 */ |
186 public void buildTypeParamInfo(XMLNode node, Content classInfoTree) { |
191 public void buildTypeParamInfo(XMLNode node, Content classInfoTree) { |
329 /** |
337 /** |
330 * Build the member details contents of the page. |
338 * Build the member details contents of the page. |
331 * |
339 * |
332 * @param node the XML element that specifies which components to document |
340 * @param node the XML element that specifies which components to document |
333 * @param classContentTree the content tree to which the documentation will be added |
341 * @param classContentTree the content tree to which the documentation will be added |
334 */ |
342 * @throws DocletException if there is a problem while building the documentation |
335 public void buildMemberDetails(XMLNode node, Content classContentTree) { |
343 */ |
|
344 public void buildMemberDetails(XMLNode node, Content classContentTree) throws DocletException { |
336 Content memberDetailsTree = writer.getMemberTreeHeader(); |
345 Content memberDetailsTree = writer.getMemberTreeHeader(); |
337 buildChildren(node, memberDetailsTree); |
346 buildChildren(node, memberDetailsTree); |
338 classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); |
347 classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); |
339 } |
348 } |
340 |
349 |
341 /** |
350 /** |
342 * Build the enum constants documentation. |
351 * Build the enum constants documentation. |
343 * |
352 * |
344 * @param node the XML element that specifies which components to document |
353 * @param node the XML element that specifies which components to document |
345 * @param memberDetailsTree the content tree to which the documentation will be added |
354 * @param memberDetailsTree the content tree to which the documentation will be added |
|
355 * @throws DocletException if there is a problem while building the documentation |
346 */ |
356 */ |
347 public void buildEnumConstantsDetails(XMLNode node, |
357 public void buildEnumConstantsDetails(XMLNode node, |
348 Content memberDetailsTree) throws Exception { |
358 Content memberDetailsTree) throws DocletException { |
349 configuration.getBuilderFactory(). |
359 configuration.getBuilderFactory(). |
350 getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); |
360 getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); |
351 } |
361 } |
352 |
362 |
353 /** |
363 /** |
354 * Build the field documentation. |
364 * Build the field documentation. |
355 * |
365 * |
356 * @param node the XML element that specifies which components to document |
366 * @param node the XML element that specifies which components to document |
357 * @param memberDetailsTree the content tree to which the documentation will be added |
367 * @param memberDetailsTree the content tree to which the documentation will be added |
|
368 * @throws DocletException if there is a problem while building the documentation |
358 */ |
369 */ |
359 public void buildFieldDetails(XMLNode node, |
370 public void buildFieldDetails(XMLNode node, |
360 Content memberDetailsTree) throws Exception { |
371 Content memberDetailsTree) throws DocletException { |
361 configuration.getBuilderFactory(). |
372 configuration.getBuilderFactory(). |
362 getFieldBuilder(writer).buildChildren(node, memberDetailsTree); |
373 getFieldBuilder(writer).buildChildren(node, memberDetailsTree); |
363 } |
374 } |
364 |
375 |
365 /** |
376 /** |
366 * Build the property documentation. |
377 * Build the property documentation. |
367 * |
378 * |
368 * @param elements the XML elements that specify how a field is documented. |
379 * @param node the XML element that specifies which components to document |
|
380 * @param memberDetailsTree the content tree to which the documentation will be added |
|
381 * @throws DocletException if there is a problem while building the documentation |
369 */ |
382 */ |
370 public void buildPropertyDetails(XMLNode node, |
383 public void buildPropertyDetails(XMLNode node, |
371 Content memberDetailsTree) throws Exception { |
384 Content memberDetailsTree) throws DocletException { |
372 configuration.getBuilderFactory(). |
385 configuration.getBuilderFactory(). |
373 getPropertyBuilder(writer).buildChildren(node, memberDetailsTree); |
386 getPropertyBuilder(writer).buildChildren(node, memberDetailsTree); |
374 } |
387 } |
375 |
388 |
376 /** |
389 /** |
377 * Build the constructor documentation. |
390 * Build the constructor documentation. |
378 * |
391 * |
379 * @param node the XML element that specifies which components to document |
392 * @param node the XML element that specifies which components to document |
380 * @param memberDetailsTree the content tree to which the documentation will be added |
393 * @param memberDetailsTree the content tree to which the documentation will be added |
|
394 * @throws DocletException if there is a problem while building the documentation |
381 */ |
395 */ |
382 public void buildConstructorDetails(XMLNode node, |
396 public void buildConstructorDetails(XMLNode node, |
383 Content memberDetailsTree) throws Exception { |
397 Content memberDetailsTree) throws DocletException { |
384 configuration.getBuilderFactory(). |
398 configuration.getBuilderFactory(). |
385 getConstructorBuilder(writer).buildChildren(node, memberDetailsTree); |
399 getConstructorBuilder(writer).buildChildren(node, memberDetailsTree); |
386 } |
400 } |
387 |
401 |
388 /** |
402 /** |
389 * Build the method documentation. |
403 * Build the method documentation. |
390 * |
404 * |
391 * @param node the XML element that specifies which components to document |
405 * @param node the XML element that specifies which components to document |
392 * @param memberDetailsTree the content tree to which the documentation will be added |
406 * @param memberDetailsTree the content tree to which the documentation will be added |
|
407 * @throws DocletException if there is a problem while building the documentation |
393 */ |
408 */ |
394 public void buildMethodDetails(XMLNode node, |
409 public void buildMethodDetails(XMLNode node, |
395 Content memberDetailsTree) throws Exception { |
410 Content memberDetailsTree) throws DocletException { |
396 configuration.getBuilderFactory(). |
411 configuration.getBuilderFactory(). |
397 getMethodBuilder(writer).buildChildren(node, memberDetailsTree); |
412 getMethodBuilder(writer).buildChildren(node, memberDetailsTree); |
398 } |
413 } |
399 } |
414 } |