KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > code > CtBlock


1 package spoon.reflect.code;
2
3 import java.util.List JavaDoc;
4
5 import spoon.reflect.visitor.Filter;
6 import spoon.template.TemplateParameter;
7
8 /**
9  * This code element represents a block of code, that is to say a list of
10  * statements enclosed in curly brackets. When the context calls for a return
11  * value, the block should contain a return statement as a lastly reachable
12  * statement. The returned type is given by <code>R</code>.
13  */

14 public interface CtBlock<R> extends CtStatement, TemplateParameter<R> {
15
16     /**
17      * Inserts the given statement at the begining of the block.
18      */

19     void insertBegin(CtStatement statement);
20
21     /**
22      * Inserts the given statement list at the begining of the block.
23      */

24     void insertBegin(CtStatementList<?> statements);
25
26     /**
27      * Inserts the given statement at the end of the block.
28      */

29     void insertEnd(CtStatement statement);
30
31     /**
32      * Inserts the given statements at the end of the block.
33      */

34     void insertEnd(CtStatementList<?> statements);
35
36     /**
37      * Inserts the given statement before a set of insertion points given by a
38      * filter.
39      */

40     void insertBefore(Filter<? extends CtStatement> insertionPoints,
41             CtStatement statement);
42
43     /**
44      * Inserts the given statement list before a set of insertion points given
45      * by a filter.
46      */

47     void insertBefore(Filter<? extends CtStatement> insertionPoints,
48             CtStatementList<?> statements);
49
50     /**
51      * Inserts the given statement after a set of insertion points given by a
52      * filter.
53      */

54     void insertAfter(Filter<? extends CtStatement> insertionPoints,
55             CtStatement statement);
56
57     /**
58      * Inserts the given statement list after a set of insertion points given by
59      * a filter.
60      */

61     void insertAfter(Filter<? extends CtStatement> insertionPoints,
62             CtStatementList<?> statements);
63
64     /**
65      * Returns the statements enclosed by this block.
66      */

67     List JavaDoc<CtStatement> getStatements();
68
69     /**
70      * Sets the statements enclosed by this block.
71      */

72     void setStatements(List JavaDoc<CtStatement> statements);
73
74 }
75
Popular Tags