01: /*
02: * Author: Mike Atkinson
03: *
04: * This software has been developed under the copyleft
05: * rules of the GNU General Public License. Please
06: * consult the GNU General Public License for more
07: * details about use and distribution of this software.
08: */
09: package org.acm.seguin.pretty.jdi;
10:
11: import net.sourceforge.jrefactory.ast.ASTNestedClassDeclaration;
12: import net.sourceforge.jrefactory.ast.ASTUnmodifiedClassDeclaration;
13: import net.sourceforge.jrefactory.ast.ASTAnnotation;
14: import net.sourceforge.jrefactory.ast.Node;
15: import org.acm.seguin.pretty.DescriptionPadder;
16: import org.acm.seguin.pretty.ForceJavadocComments;
17: import org.acm.seguin.pretty.PrintData;
18: import org.acm.seguin.pretty.ai.RequiredTags;
19:
20: /**
21: * Holds a nested class declaration
22: *
23: * @author Mike Atkinson
24: * @since jRefactory 2.9.0, created October 16, 2003
25: */
26: public class NestedClassDeclaration extends BaseJDI {
27: private ASTNestedClassDeclaration clazz;
28:
29: /**
30: * Constructor for the NestedClassDeclaration JavaDoc creator.
31: *
32: * @param clazz Create JavaDoc for this node.
33: */
34: public NestedClassDeclaration(ASTNestedClassDeclaration clazz) {
35: super ();
36: this .clazz = clazz;
37: }
38:
39: /**
40: * Checks to see if it was printed
41: *
42: * @return true if it still needs to be printed
43: */
44: public boolean isRequired() {
45: return jdi.isRequired()
46: && (new ForceJavadocComments()).isJavaDocRequired(
47: "class", clazz);
48: }
49:
50: /**
51: * Prints all the java doc components
52: *
53: * @param printData the print data
54: */
55: public void printJavaDocComponents(PrintData printData) {
56: jdi.printJavaDocComponents(printData, bundle
57: .getString("class.tags"));
58: }
59:
60: /** Makes sure all the java doc components are present */
61: public void finish() {
62: // Description of the class
63: jdi.require("", DescriptionPadder.find(bundle, "class.descr"));
64:
65: // Require the other tags
66: int childNo = clazz.skipAnnotations();
67: Node child = clazz.jjtGetChild(childNo);
68: RequiredTags.getTagger().addTags(bundle, "class",
69: ((ASTUnmodifiedClassDeclaration) child).getName(), jdi);
70: }
71:
72: }
|