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.ASTAnnotationMethodDeclaration;
12: import org.acm.seguin.pretty.ForceJavadocComments;
13: import org.acm.seguin.pretty.PrintData;
14: import org.acm.seguin.pretty.DescriptionPadder;
15: import org.acm.seguin.pretty.ai.RequiredTags;
16:
17: /**
18: * Holds a method declaration in a class
19: *
20: * @author Mike Atkinson
21: * @since jRefactory 2.9.0, created October 16, 2003
22: */
23: public class AnnotationMethodDeclaration extends BaseJDI {
24: ASTAnnotationMethodDeclaration method;
25:
26: /**
27: * Constructor for the AnnotationMethodDeclaration JavaDoc creator.
28: *
29: * @param method Create JavaDoc for this node.
30: */
31: public AnnotationMethodDeclaration(
32: ASTAnnotationMethodDeclaration method) {
33: super ();
34: this .method = method;
35: }
36:
37: /**
38: * Checks to see if it was printed
39: *
40: * @return true if it still needs to be printed
41: */
42: public boolean isRequired() {
43: return jdi.isRequired()
44: && (new ForceJavadocComments()).isJavaDocRequired(
45: "annotation.method", method);
46: }
47:
48: /**
49: * Prints all the java doc components
50: *
51: * @param printData the print data
52: */
53: public void printJavaDocComponents(PrintData printData) {
54: jdi.printJavaDocComponents(printData, bundle
55: .getString("annotation.method.tags"));
56: }
57:
58: /**
59: * Makes sure all the java doc components are present. For methods and constructors we need to do more work -
60: * checking parameters, return types, and exceptions.
61: */
62: public void finish() {
63: finish("");
64: }
65:
66: /**
67: * Makes sure all the java doc components are present. For methods and constructors we need to do more work -
68: * checking parameters, return types, and exceptions.
69: *
70: * @param className Description of Parameter
71: */
72: public void finish(String className) {
73: jdi.require("", DescriptionPadder.find(bundle,
74: "annotation.method.descr"));
75: RequiredTags.getTagger().addTags(bundle, "annotation.method",
76: method.getName(), jdi);
77: }
78:
79: }
|