forked from tushartushar/DesigniteJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodVisitor.java
More file actions
36 lines (28 loc) · 910 Bytes
/
MethodVisitor.java
File metadata and controls
36 lines (28 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package Designite.SourceModel;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
public class MethodVisitor extends ASTVisitor {
List<SM_Method> methods = new ArrayList<SM_Method>();
//private TypeDeclaration typeDeclaration;
private SM_Type parentType;
public MethodVisitor(TypeDeclaration typeDeclaration, SM_Type typeObj) {
super();
//this.typeDeclaration = typeDeclaration;
this.parentType = typeObj;
}
@Override
public boolean visit(MethodDeclaration method) {
SM_Method newMethod = new SM_Method(method, parentType);
methods.add(newMethod);
return super.visit(method);
}
public List<SM_Method> getMethods(){
return methods;
}
public int countMethods() {
return methods.size();
}
}