KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > reflect > code > CtVariableAccessImpl


1 package spoon.support.reflect.code;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.List JavaDoc;
5
6 import spoon.reflect.code.CtCodeElement;
7 import spoon.reflect.code.CtVariableAccess;
8 import spoon.reflect.declaration.CtSimpleType;
9 import spoon.reflect.reference.CtTypeReference;
10 import spoon.reflect.reference.CtVariableReference;
11 import spoon.reflect.visitor.CtVisitor;
12
13 public class CtVariableAccessImpl<T> extends CtExpressionImpl<T> implements
14         CtVariableAccess<T> {
15     private static final long serialVersionUID = 1L;
16     List JavaDoc<CtTypeReference<?>> casts = new ArrayList JavaDoc<CtTypeReference<?>>();
17
18     CtTypeReference<T> type;
19
20     CtVariableReference<T> variable;
21
22     public void accept(CtVisitor visitor) {
23         visitor.visitCtVariableAccess(this);
24     }
25
26     public CtCodeElement getSubstitution(CtSimpleType targetType) {
27         return getFactory().Core().clone(this);
28     }
29
30     public CtTypeReference<T> getType() {
31         return type;
32     }
33
34     public List JavaDoc<CtTypeReference<?>> getTypeCasts() {
35         return casts;
36     }
37
38     public CtVariableReference<T> getVariable() {
39         return variable;
40     }
41
42     public T S() {
43         return null;
44     }
45
46     public void setType(CtTypeReference<T> type) {
47         this.type = (CtTypeReference<T>) type;
48     }
49
50     public void setTypeCasts(List JavaDoc<CtTypeReference<?>> casts) {
51         this.casts = casts;
52     }
53
54     public void setVariable(CtVariableReference<T> variable) {
55         this.variable = variable;
56     }
57
58 }
59
Popular Tags