KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > metainfo > api > Package


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.metainfo.api;
25
26 import java.util.Iterator JavaDoc;
27 import java.util.Collection JavaDoc;
28
29 /**
30  * Package object defines an object able to gather a set of classes.
31  * It is a similar approach to the package keyword from java.
32  * @author X. Spengler
33  */

34 public interface Package extends MetaObject {
35     /**
36      * Returns the name of the schema.
37      * @return the string representation of the name of the schema.
38      * Null is returned if there is no schema name else a not empty
39      * dotted string.
40      */

41     String JavaDoc getName();
42
43     /**
44      * Returns a Class created with a class name.
45      * @param className the string representation of the class name
46      * @return a Class corresponding to its name. If the Class does
47      * not exist, null is returned.
48      */

49     Class JavaDoc getClass(String JavaDoc className);
50
51     /**
52      * Returns a new Class created with a class name.
53      * The MetaObject is added to the list of classes managed by the current
54      * schema. An isAbstract boolean is defined to know if the current class
55      * is an abstract class or not.
56      * @param className the string representation of the class name
57      * @return a Class corresponding to the created class and
58      * registered, or an existing one if already defined
59      */

60     Class JavaDoc createClass(String JavaDoc className);
61
62     /**
63      * Adds an existing Class to the current Package
64      * @param aClass the Class object to add
65      */

66     void addClass(Class JavaDoc aClass);
67
68     /**
69      * Adds an existing CompositeName to the current Package
70      * @param composite the CompositeName object to add
71      */

72     void addCompositeName(CompositeName composite);
73
74     /**
75      * Allows to know all the registered classes into the current schema.
76      * This method returns an iterator on Class object.
77      * @return an iterator for Class object. If there is no class, an empty
78      * iterator is returned.
79      */

80     Collection JavaDoc getClasses();
81
82     /**
83      * Allows to know all the registered classes into the current schema.
84      * This method returns an iterator on Class object.
85      * @return an iterator for Class object. If there is no class, an empty
86      * iterator is returned.
87      */

88     Collection JavaDoc getCompositeNames();
89
90     /**
91      * Returns a compositename identified with its name.
92      * @param cn_Name the string representation of the name of the composite name.
93      * @return a compositename corresponding to its name. If the
94      * compositename does not exist, null is returned.
95      */

96     CompositeName getCompositeName(String JavaDoc cn_Name);
97
98     /**
99      * Returns a new compositename identified by its name.
100      * The MetaObject is added to the list of compositename classes managed by the
101      * current schema. If the compositename already exists, it is returned.
102      * @param CN_Name the string representation of the name of the compositename
103      * @return a compositename corresponding to the created compositename
104      * and registered, or an existing one if already
105      * defined
106      */

107     CompositeName createCompositeName(String JavaDoc CN_Name);
108
109     /**
110      * Allows to know all the registered compositename into the current schema.
111      * This method returns an iterator on compositename object.
112      * @return an iterator for compositename object. If there is no class, an empty
113      * iterator is returned.
114      */

115     Iterator JavaDoc iterateCompositeName();
116 }
117
Popular Tags