KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > declaration > CtType


1 package spoon.reflect.declaration;
2
3 import java.util.Set JavaDoc;
4
5 import spoon.reflect.reference.CtTypeReference;
6
7 /**
8  * This abstract element defines a super-type for classes and interfaces, which
9  * can declare methods.
10  */

11 public interface CtType<T> extends CtSimpleType<T>, CtGenericElement {
12
13     /**
14      * Return all the accessible methods for this type (the recursion stops when
15      * the super-type is not in the model).
16      */

17     Set JavaDoc<CtMethod<?>> getAllMethods();
18
19     /**
20      * Gets a method from its return type, name, and parameter types.
21      *
22      * @return null if does not exit
23      */

24     <R> CtMethod<R> getMethod(CtTypeReference<R> returnType, String JavaDoc name,
25             CtTypeReference<?>... parameterTypes);
26
27     /**
28      * Gets a method from its name and parameter types.
29      *
30      * @return null if does not exit
31      */

32     CtMethod<?> getMethod(String JavaDoc name, CtTypeReference<?>... parameterTypes);
33
34     /**
35      * Returns the methods that are directly declared by this class or
36      * interface.
37      */

38     Set JavaDoc<CtMethod<?>> getMethods();
39
40     /**
41      * Returns the interface types directly implemented by this class or
42      * extended by this interface.
43      */

44     Set JavaDoc<CtTypeReference<?>> getSuperInterfaces();
45
46     /**
47      * Sets the methods of this type.
48      */

49     void setMethods(Set JavaDoc<CtMethod<?>> methods);
50
51     /**
52      * Sets the super interfaces of this type.
53      */

54     void setSuperInterfaces(Set JavaDoc<CtTypeReference<?>> interfaces);
55
56     /**
57      * Tells if this type is a subtype of the given type.
58      */

59     boolean isSubtypeOf(CtTypeReference<?> type);
60
61 }
Popular Tags