KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > reference > CtExecutableReference


1 package spoon.reflect.reference;
2
3 import java.lang.reflect.Constructor JavaDoc;
4 import java.lang.reflect.Method JavaDoc;
5 import java.util.List JavaDoc;
6
7 import spoon.reflect.declaration.CtExecutable;
8
9 /**
10  * This interface defines a reference to a
11  * {@link spoon.reflect.declaration.CtExecutable}. It can be a
12  * {@link spoon.reflect.declaration.CtMethod} or a
13  * {@link spoon.reflect.declaration.CtConstructor}.
14  */

15 public interface CtExecutableReference<T> extends CtReference,
16         CtGenericElementReference, CtModifiableReference {
17
18     /**
19      * Gets the runtime method that corresponds to an executable reference if
20      * any.
21      *
22      * @return the method (null if not found)
23      */

24     Method JavaDoc getActualMethod();
25
26     /**
27      * Gets the runtime constructor that corresponds to an executable reference
28      * if any.
29      *
30      * @return the constructor (null if not found)
31      */

32     Constructor JavaDoc getActualConstructor();
33
34     CtExecutable<T> getDeclaration();
35
36     /**
37      * Gets the reference to the type that declares this executable.
38      */

39     CtTypeReference<?> getDeclaringType();
40
41     /**
42      * Gets the list of the executable's parameter types.
43      */

44     List JavaDoc<CtTypeReference<?>> getParameterTypes();
45
46     /**
47      * Gets the type of the executable.
48      */

49     CtTypeReference<T> getType();
50
51     /**
52      * Returns <code>true</code> if this executable overloads the given
53      * executable.
54      */

55     boolean isOverloading(CtExecutableReference<?> executable);
56
57     /**
58      * Returns the executable overloaded by this one, if exists (null
59      * otherwise).
60      */

61     CtExecutableReference<?> getOverloadedExecutable();
62
63     /**
64      * Gets an overloading executable for this executable from a given subtype,
65      * if exists.
66      *
67      * @param <S>
68      * subtype of T
69      * @param subType
70      * starting bottom type to find an overloading executable
71      * (subtypes are not tested)
72      * @return the first found (most concrete) executable that overloads this
73      * executable (null if none found)
74      */

75     <S extends T> CtExecutableReference<S> getOverloadingExecutable(
76             CtTypeReference<?> subType);
77
78     /**
79      * Tells if the referenced executable is static.
80      */

81     boolean isStatic();
82
83     /**
84      * Sets the declaring type.
85      */

86     void setDeclaringType(CtTypeReference<?> declaringType);
87
88     /**
89      * Sets the list of the executable's parameters types.
90      */

91     void setParameterTypes(List JavaDoc<CtTypeReference<?>> parameterTypes);
92
93     /**
94      * Sets this executable reference to be static or not.
95      */

96     void setStatic(boolean b);
97
98     /**
99      * Sets the type of the variable.
100      */

101     void setType(CtTypeReference<T> type);
102
103     /**
104      * Tells if the referenced executable is final.
105      */

106     boolean isFinal();
107 }
108
Popular Tags