1
2
3 package net.sourceforge.pmd.ast;
4
5 public class ASTMethodDeclaration extends AccessNode {
6 public ASTMethodDeclaration(int id) {
7 super(id);
8 }
9
10 public ASTMethodDeclaration(JavaParser p, int id) {
11 super(p, id);
12 }
13
14
15 /***
16 * Accept the visitor. *
17 */
18 public Object jjtAccept(JavaParserVisitor visitor, Object data) {
19 return visitor.visit(this, data);
20 }
21
22 public void dump(String prefix) {
23 System.out.println(collectDumpedModifiers(prefix));
24 dumpChildren(prefix);
25 }
26
27 /***
28 * Gets the name of the method.
29 * @return
30 */
31 public String getMethodName() {
32 ASTMethodDeclarator md = (ASTMethodDeclarator) getFirstChildOfType(ASTMethodDeclarator.class);
33 if (md!=null)
34 return md.getImage();
35 return null;
36 }
37 }