01: package net.sourceforge.pmd.util.designer;
02:
03: import net.sourceforge.pmd.AbstractRule;
04: import net.sourceforge.pmd.ast.ASTCompilationUnit;
05: import net.sourceforge.pmd.ast.ASTMethodDeclaration;
06:
07: import java.util.List;
08:
09: public class DFAGraphRule extends AbstractRule {
10:
11: private List<ASTMethodDeclaration> methods;
12: private List<ASTMethodDeclaration> constructors;
13:
14: public DFAGraphRule() {
15: super .setUsesDFA();
16: }
17:
18: public List<ASTMethodDeclaration> getMethods() {
19: return this .methods;
20: }
21:
22: public List<ASTMethodDeclaration> getConstructors() {
23: return this .constructors;
24: }
25:
26: public Object visit(ASTCompilationUnit acu, Object data) {
27: methods = acu.findChildrenOfType(ASTMethodDeclaration.class);
28: constructors = acu
29: .findChildrenOfType(ASTMethodDeclaration.class);
30: return data;
31: }
32: }
|