forked from tushartushar/DesigniteJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeVisitor.java
More file actions
47 lines (37 loc) · 1.19 KB
/
TypeVisitor.java
File metadata and controls
47 lines (37 loc) · 1.19 KB
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
37
38
39
40
41
42
43
44
45
46
47
package Designite.SourceModel;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import Designite.InputArgs;
import java.util.ArrayList;
import java.util.List;
public class TypeVisitor extends ASTVisitor{
private List<SM_Type> types = new ArrayList<SM_Type>();
private List<TypeDeclaration> typeDeclarationList = new ArrayList<TypeDeclaration>();
private CompilationUnit compilationUnit;
private SM_Type newType;
private SM_Package pkgObj;
private InputArgs inputArgs;
public TypeVisitor(CompilationUnit cu, SM_Package pkgObj, InputArgs inputArgs) {
super();
this.compilationUnit = cu;
this.pkgObj = pkgObj;
this.inputArgs = inputArgs;
}
@Override
public boolean visit(TypeDeclaration typeDeclaration){
typeDeclarationList.add(typeDeclaration);
newType = new SM_Type(typeDeclaration, compilationUnit, pkgObj, inputArgs);
types.add(newType);
return super.visit(typeDeclaration);
}
public SM_Type getType() {
return newType;
}
public List<SM_Type> getTypeList() {
return types;
}
public List<TypeDeclaration> getTypeDeclarationList() {
return typeDeclarationList;
}
}