KickJava   Java API By Example, From Geeks To Geeks.

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


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.CtBlock;
7 import spoon.reflect.code.CtExpression;
8 import spoon.reflect.code.CtInvocation;
9 import spoon.reflect.code.CtStatement;
10 import spoon.reflect.code.CtStatementList;
11 import spoon.reflect.declaration.CtElement;
12 import spoon.reflect.reference.CtExecutableReference;
13 import spoon.reflect.visitor.CtVisitor;
14
15 public class CtInvocationImpl<T> extends CtTargetedExpressionImpl<T,CtExpression<?>> implements
16         CtInvocation<T> {
17     private static final long serialVersionUID = 1L;
18     List JavaDoc<CtExpression<?>> arguments = new ArrayList JavaDoc<CtExpression<?>>();
19
20     CtBlock block;
21
22     CtExecutableReference<T> executable;
23
24     List JavaDoc<CtExpression<Integer JavaDoc>> indexExpressions=new ArrayList JavaDoc<CtExpression<Integer JavaDoc>>();
25
26     public void accept(CtVisitor visitor) {
27         visitor.visitCtInvocation(this);
28     }
29
30     @Override JavaDoc
31     public void setTarget(CtExpression<?> target) {
32         // TODO Auto-generated method stub
33
super.setTarget(target);
34     }
35     
36     public List JavaDoc<CtExpression<?>> getArguments() {
37         return arguments;
38     }
39
40     public CtExecutableReference<T> getExecutable() {
41         return executable;
42     }
43
44     public List JavaDoc<CtExpression<Integer JavaDoc>> getIndexExpressions() {
45         return indexExpressions;
46     }
47
48     public void insertAfter(CtStatement statement) {
49         CtStatementImpl.insertAfter(this,statement);
50     }
51
52     public void insertBefore(CtStatement statement) {
53         CtStatementImpl.insertBefore(this,statement);
54     }
55
56     public void insertAfter(CtStatementList statements) {
57         CtStatementImpl.insertAfter(this,statements);
58     }
59
60     public void insertBefore(CtStatementList statements) {
61         CtStatementImpl.insertBefore(this,statements);
62     }
63
64     public void replace(CtElement element) {
65         if(element instanceof CtStatementList) {
66             CtStatementImpl.replace(this,(CtStatementList)element);
67         } else {
68             super.replace(element);
69         }
70     }
71
72     public boolean isArrayOperation() {
73         return indexExpressions.size() > 0;
74     };
75
76     public void setArguments(List JavaDoc<CtExpression<?>> arguments) {
77         this.arguments = arguments;
78     }
79
80     public void setExecutable(CtExecutableReference<T> executable) {
81         this.executable = executable;
82     }
83
84     public void setIndexExpressions(List JavaDoc<CtExpression<Integer JavaDoc>> indexExpressions) {
85         this.indexExpressions = indexExpressions;
86     }
87
88     String JavaDoc label;
89
90     public String JavaDoc getLabel() {
91         return label;
92     }
93
94     public void setLabel(String JavaDoc label) {
95         this.label = label;
96     }
97
98 }
99
Popular Tags