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.ASTInterfaceDeclaration;
12: import net.sourceforge.jrefactory.ast.ASTUnmodifiedInterfaceDeclaration;
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 an interface declaration. Essentially this is the method declaration inside an interface.
22: *
23: * @author Mike Atkinson
24: * @since jRefactory 2.9.0, created October 16, 2003
25: */
26: public class InterfaceDeclaration extends BaseJDI {
27: ASTInterfaceDeclaration intf;
28:
29: /**
30: * Constructor for the InterfaceDeclaration JavaDoc creator.
31: *
32: * @param intf Create JavaDoc for this node.
33: */
34: public InterfaceDeclaration(ASTInterfaceDeclaration intf) {
35: super ();
36: this .intf = intf;
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", intf);
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: /**
61: * Makes sure all the java doc components are present. For classes and interfaces, this means a date and an author.
62: */
63: public void finish() {
64: jdi.require("", DescriptionPadder.find(bundle,
65: "interface.descr"));
66:
67: // Require the other tags
68: int childNo = intf.skipAnnotations();
69: Node child = intf.jjtGetChild(childNo);
70: RequiredTags.getTagger().addTags(bundle, "class",
71: ((ASTUnmodifiedInterfaceDeclaration) child).getName(),
72: jdi);
73: }
74:
75: }
|