KickJava   Java API By Example, From Geeks To Geeks.

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


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

15 public class CtParameterImpl<T> extends CtNamedElementImpl implements
16         CtParameter<T> {
17     private static final long serialVersionUID = 1L;
18     CtExpression<T> defaultExpression;
19
20     CtTypeReference<T> type;
21
22     boolean varArgs = false;
23
24     public CtParameterImpl() {
25         super();
26     }
27
28     public void accept(CtVisitor v) {
29         v.visitCtParameter(this);
30     }
31
32     public CtExpression<T> getDefaultExpression() {
33         return defaultExpression;
34     }
35
36     @Override JavaDoc
37     public CtExecutable<?> getParent() {
38         return (CtExecutable) super.getParent();
39     }
40
41     @Override JavaDoc
42     public CtParameterReference<T> getReference() {
43         return getFactory().Executable().createParameterReference(this);
44     }
45
46     public CtTypeReference<T> getType() {
47         return type;
48     }
49
50     public void setDefaultExpression(CtExpression<T> defaultExpression) {
51         this.defaultExpression = defaultExpression;
52     }
53
54     public void setType(CtTypeReference<T> type) {
55         this.type = type;
56     }
57
58     public boolean isVarArgs() {
59         return varArgs;
60     }
61
62     public void setVarArgs(boolean varArgs) {
63         this.varArgs = varArgs;
64     }
65 }
66
Popular Tags