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 net.sourceforge.jrefactory.ast;
10:
11: import net.sourceforge.jrefactory.parser.JavaParser;
12: import net.sourceforge.jrefactory.parser.JavaParserVisitor;
13:
14: /**
15: * Constains the name and the parameters associated with this method
16: *
17: * @author Mike Atkinson
18: * @since jRefactory 2.9.0, created October 16, 2003
19: */
20: public class ASTMethodDeclarator extends NamedNode {
21: private int arrayCount;
22:
23: /**
24: * Constructor for the ASTMethodDeclarator node.
25: *
26: * @param identifier The id of this node (JJTMETHODDECLARATOR).
27: */
28: public ASTMethodDeclarator(int identifier) {
29: super (identifier);
30: arrayCount = 0;
31: }
32:
33: /**
34: * Constructor for the ASTMethodDeclarator node.
35: *
36: * @param parser The JavaParser that created this ASTMethodDeclarator node
37: * @param identifier The id of this node (JJTMETHODDECLARATOR).
38: */
39: public ASTMethodDeclarator(JavaParser parser, int identifier) {
40: super (parser, identifier);
41: arrayCount = 0;
42: }
43:
44: /**
45: * Set the number of levels of array indirection
46: *
47: * @param count the number of []
48: */
49: public void setArrayCount(int count) {
50: arrayCount = count;
51: }
52:
53: /**
54: * Return the number of array brackets
55: *
56: * @return the levels of indirection
57: */
58: public int getArrayCount() {
59: return arrayCount;
60: }
61:
62: /**
63: * Gets the parameterCount attribute of the ASTMethodDeclarator node.
64: *
65: * @return The parameterCount value
66: */
67: public int getParameterCount() {
68: return this .jjtGetFirstChild().jjtGetNumChildren();
69: }
70:
71: /**
72: * Makes sure all the java doc components are present. For methods and constructors we need to do more work -
73: * checking parameters, return types, and exceptions.
74: */
75: public void finish() {
76: }
77:
78: /**
79: * Accept the visitor.
80: *
81: * @param visitor An implementation of JavaParserVisitor that processes the ASTMethodDeclarator node.
82: * @param data Some data being passed between the visitor methods.
83: * @return Usually the data parameter (possibly modified).
84: */
85: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
86: return visitor.visit(this, data);
87: }
88: }
|