1 |
| package net.sourceforge.pmd.util.designer; |
2 |
| |
3 |
| import net.sourceforge.pmd.AbstractRule; |
4 |
| import net.sourceforge.pmd.ast.ASTCompilationUnit; |
5 |
| import net.sourceforge.pmd.ast.ASTMethodDeclaration; |
6 |
| |
7 |
| import java.util.List; |
8 |
| |
9 |
| public class DFAGraphRule extends AbstractRule { |
10 |
| |
11 |
| private List methods; |
12 |
| private List constructors; |
13 |
| |
14 |
0
| public DFAGraphRule() {
|
15 |
0
| super.setUsesDFA();
|
16 |
| } |
17 |
| |
18 |
0
| public List getMethods() {
|
19 |
0
| return this.methods;
|
20 |
| } |
21 |
| |
22 |
0
| public List getConstructors() {
|
23 |
0
| return this.constructors;
|
24 |
| } |
25 |
| |
26 |
0
| public Object visit(ASTCompilationUnit acu, Object data) {
|
27 |
0
| methods = acu.findChildrenOfType(ASTMethodDeclaration.class);
|
28 |
0
| constructors = acu.findChildrenOfType(ASTMethodDeclaration.class);
|
29 |
0
| return data;
|
30 |
| } |
31 |
| } |
32 |
| |
33 |
| |