KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > reflect > declaration > CtFieldImpl


1 package spoon.support.reflect.declaration;
2
3 import spoon.reflect.code.CtExpression;
4 import spoon.reflect.declaration.CtField;
5 import spoon.reflect.declaration.CtSimpleType;
6 import spoon.reflect.reference.CtFieldReference;
7 import spoon.reflect.reference.CtTypeReference;
8 import spoon.reflect.visitor.CtVisitor;
9
10 /**
11  * The implementation for {@link spoon.reflect.declaration.CtField}.
12  *
13  * @author Renaud Pawlak
14  */

15 public class CtFieldImpl<T> extends CtNamedElementImpl implements CtField<T> {
16     private static final long serialVersionUID = 1L;
17     CtExpression<T> defaultExpression;
18
19     CtTypeReference<T> type;
20
21     public CtFieldImpl() {
22         super();
23     }
24
25     public void accept(CtVisitor v) {
26         v.visitCtField(this);
27     }
28
29     public CtSimpleType<?> getDeclaringType() {
30         return (CtSimpleType) parent;
31     }
32
33     public CtExpression<T> getDefaultExpression() {
34         return defaultExpression;
35     }
36
37     @Override JavaDoc
38     public CtFieldReference<T> getReference() {
39         return getFactory().Field().createReference(this);
40     }
41
42     public CtTypeReference<T> getType() {
43         return type;
44     }
45
46     public void setDefaultExpression(CtExpression<T> defaultExpression) {
47         this.defaultExpression = (CtExpression<T>) defaultExpression;
48     }
49
50     public void setType(CtTypeReference<T> type) {
51         this.type = (CtTypeReference<T>) type;
52     }
53
54 }
55
Popular Tags