KickJava   Java API By Example, From Geeks To Geeks.

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


1 package spoon.reflect.declaration;
2
3 import java.util.List JavaDoc;
4 import java.util.Set JavaDoc;
5
6 import spoon.reflect.reference.CtTypeReference;
7
8 /**
9  * This abstract element represents the types that can be declared in a Java
10  * program.
11  *
12  * @param <T>
13  * the actual runtime type
14  */

15 public interface CtSimpleType<T> extends CtNamedElement {
16     /**
17      * The string separator in a Java innertype qualified name.
18      */

19     public static final String JavaDoc INNERTTYPE_SEPARATOR = "$";
20
21     /**
22      * Returns the actual runtime class if exists.
23      *
24      * @return the runtime class, null if is not accessible or does not exist
25      */

26     Class JavaDoc<T> getActualClass();
27
28     /**
29      * Returns the fields that are directly declared by this class or interface.
30      * Includes enum constants.
31      */

32 // List<CtField<?>> getAllFields();
33

34     /**
35      * Gets the type where this one is declared. If a declaring type is set, the
36      * package corresponds to the declaring type's package.
37      *
38      * @return declaring type or null
39      */

40     CtSimpleType<?> getDeclaringType();
41
42     /**
43      * Gets a field from its name.
44      *
45      * @return null if does not exit
46      */

47     CtField<?> getField(String JavaDoc name);
48
49     /**
50      * Returns the fields that are directly declared by this class or interface.
51      * Includes enum constants.
52      */

53     List JavaDoc<CtField<?>> getFields();
54
55     /**
56      * Gets a nested type from its name.
57      */

58     CtSimpleType<?> getNestedType(String JavaDoc name);
59
60     /**
61      * Returns the declarations of the nested classes and interfaces that are
62      * directly declared by this class or interface.
63      */

64     Set JavaDoc<CtSimpleType<?>> getNestedTypes();
65
66     /**
67      * Gets the package where this type is declared.
68      */

69     CtPackage getPackage();
70
71     /**
72      * Returns the fully qualified name of this type declaration.
73      */

74     String JavaDoc getQualifiedName();
75
76     CtTypeReference<T> getReference();
77
78     /**
79      * Returns true if this type is top-level (declared as the main type in a
80      * file).
81      */

82     boolean isTopLevel();
83
84     /**
85      * Sets the type's fields.
86      */

87     void setFields(List JavaDoc<CtField<?>> fields);
88
89     /**
90      * Sets some nested types.
91      */

92     void setNestedTypes(Set JavaDoc<CtSimpleType<?>> nestedTypes);
93
94 }
95
Popular Tags