KickJava   Java API By Example, From Geeks To Geeks.

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


1 package spoon.reflect.declaration;
2
3 import java.util.Set JavaDoc;
4
5 import spoon.reflect.reference.CtPackageReference;
6
7 /**
8  * This element defines a package declaration. The packages are represented by a
9  * tree.
10  */

11 public interface CtPackage extends CtNamedElement {
12
13     /**
14      * The separator for a string representation of a package.
15      */

16     public static final String JavaDoc PACKAGE_SEPARATOR = ".";
17
18     /**
19      * The name for the top level package (default is "unnamed package").
20      */

21     public static final String JavaDoc TOP_LEVEL_PACKAGE_NAME = "unnamed package";
22
23     /**
24      * Gets the declaring package of the current one.
25      */

26     CtPackage getDeclaringPackage();
27
28     /**
29      * Searches a child package by name.
30      *
31      * @param name
32      * the simple name of searched package
33      * @return the found package or null
34      */

35     CtPackage getPackage(String JavaDoc name);
36
37     /**
38      * Gets the set of included child packages.
39      */

40     Set JavaDoc<CtPackage> getPackages();
41
42     /**
43      * Returns the fully qualified name of this package. This is also known as
44      * the package's <i>canonical</i> name.
45      *
46      * @return the fully qualified name of this package, or the empty string if
47      * this is the unnamed package
48      */

49     String JavaDoc getQualifiedName();
50
51     /*
52      * (non-Javadoc)
53      *
54      * @see spoon.reflect.declaration.CtNamedElement#getReference()
55      */

56     CtPackageReference getReference();
57
58     /**
59      * Finds a top-level type by name.
60      *
61      * @return the found type or null
62      */

63     CtSimpleType<?> getType(String JavaDoc simpleName);
64
65     /**
66      * Returns the set of the top-level types in this package.
67      */

68     Set JavaDoc<CtSimpleType<?>> getTypes();
69
70     /**
71      * Sets the childs defined in this package
72      *
73      * @param pack
74      * new set of child packages
75      */

76     void setPackages(Set JavaDoc<CtPackage> pack);
77
78     /**
79      * Sets the types defined in the package.
80      *
81      * @param types
82      * new Set of types
83      */

84     void setTypes(Set JavaDoc<CtSimpleType<?>> types);
85 }
86
Popular Tags