KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > enhancer > meta > ExtendedJDOMetaData


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 //ExtendedJDOMetaData - Java Source
25

26
27 //***************** package ***********************************************
28

29 package com.sun.jdo.api.persistence.enhancer.meta;
30
31
32 //***************** import ************************************************
33

34
35 //#########################################################################
36
/**
37  * Provides extended JDO meta information for byte-code enhancement.
38  */

39 //#########################################################################
40

41 public interface ExtendedJDOMetaData
42        extends JDOMetaData
43 {
44     /**
45      * The JDO field flags.
46      */

47     int CHECK_READ = 0x01;
48     int MEDIATE_READ = 0x02;
49     int CHECK_WRITE = 0x04;
50     int MEDIATE_WRITE = 0x08;
51     int SERIALIZABLE = 0x10;
52
53     /**********************************************************************
54      * Gets all known classnames.
55      *
56      * @return All known classnames.
57      *********************************************************************/

58
59     public String JavaDoc [] getKnownClasses ()
60                      throws JDOMetaDataUserException,
61                             JDOMetaDataFatalError;
62
63
64     /**********************************************************************
65      * Gets all known fieldnames of a class.
66      *
67      * @param classname The classname.
68      *
69      * @return All known fieldnames.
70      *********************************************************************/

71
72     public String JavaDoc [] getKnownFields (String JavaDoc classname)
73                      throws JDOMetaDataUserException,
74                             JDOMetaDataFatalError;
75
76
77     /**********************************************************************
78      * Gets the type of a field.
79      *
80      * @param classname The classname.
81      * @param fieldname The fieldname.
82      *
83      * @return The type of the field.
84      *********************************************************************/

85
86     public String JavaDoc getFieldType (String JavaDoc classname,
87                                 String JavaDoc fieldname)
88                   throws JDOMetaDataUserException,
89                          JDOMetaDataFatalError;
90
91
92     /**********************************************************************
93      * Gets the modifiers of a class. The return value is a constant of the
94      * <code>java.lang.reflect.Modifier</code> class.
95      *
96      * @param classname The classname.
97      *
98      * @return The modifiers.
99      *
100      * @see java.lang.reflect.Modifier
101      *********************************************************************/

102
103     public int getClassModifiers (String JavaDoc classname)
104                throws JDOMetaDataUserException,
105                       JDOMetaDataFatalError;
106
107
108     /**********************************************************************
109      * Gets the modifiers of a field. The return value is a constant of the
110      * <code>java.lang.reflect.Modifier</code> class.
111      *
112      * @param classname The classname.
113      * @param fieldname The fieldname.
114      *
115      * @return The modifiers.
116      *
117      * @see java.lang.reflect.Modifier
118      *********************************************************************/

119
120     public int getFieldModifiers (String JavaDoc classname,
121                                   String JavaDoc fieldname)
122                throws JDOMetaDataUserException,
123                       JDOMetaDataFatalError;
124
125
126     /**********************************************************************
127      * Returns the name of the key class of a class.
128      * <P>
129      * The following holds:
130      * (String s = getKeyClass(classPath)) != null
131      * ==> !isPersistenceCapableClass(s)
132      * && isPersistenceCapableClass(classPath)
133      * @param classPath the non-null JVM-qualified name of the class
134      * @return the name of the key class or null if there is none
135      * @see #isPersistenceCapableClass(String)
136      *********************************************************************/

137
138     public String JavaDoc getKeyClass(String JavaDoc classPath)
139         throws JDOMetaDataUserException, JDOMetaDataFatalError;
140
141
142     /**********************************************************************
143      * Returns whether a field of a class is known to be non-managed.
144      * <P>
145      * This method differs from isManagedField() in that a field may or
146      * may not be managed if its not known as non-managed.
147      * The following holds (not vice versa!):
148      * isKnownNonManagedField(classPath, fieldName)
149      * ==> !isManagedField(classPath, fieldName)
150      * <P>
151      * This method doesn't require the field having been declared by
152      * declareField().
153      * @param classPath the non-null JVM-qualified name of the class
154      * @param fieldName the non-null name of the field
155      * @param fieldSig the non-null type signature of the field
156      * @return true if this field is known to be non-managed; otherwise false
157      * @see #isManagedField(String, String)
158      * @see #declareField(String, String, String)
159      *********************************************************************/

160
161     public boolean isKnownNonManagedField(String JavaDoc classPath,
162                                    String JavaDoc fieldName,
163                                    String JavaDoc fieldSig)
164         throws JDOMetaDataUserException, JDOMetaDataFatalError;
165
166
167    /**********************************************************************
168      * Returns whether a field of a class is transient transactional
169      * or persistent.
170      * <P>
171      * A managed field must not be known as non-managed and must be either
172      * transient transactional or persistent. The following holds:
173      * isManagedField(classPath, fieldName)
174      * ==> !isKnownNonManagedField(classPath, fieldName)
175      * && (isPersistentField(classPath, fieldName)
176      * ^ isTransactionalField(classPath, fieldName))
177      * <P>
178      * This method requires the field having been declared by declareField().
179      * @param classPath the non-null JVM-qualified name of the class
180      * @param fieldName the non-null name of the field
181      * @return true if this field is managed; otherwise false
182      * @see #isKnownNonManagedField(String, String)
183      * @see #isPersistentField(String, String)
184      * @see #isTransientField(String, String)
185      * @see #isPersistenceCapableClass(String)
186      *********************************************************************/

187
188     public boolean isManagedField(String JavaDoc classPath, String JavaDoc fieldName)
189         throws JDOMetaDataUserException, JDOMetaDataFatalError;
190
191
192     /**********************************************************************
193      * Returns whether a field of a class is key.
194      * <P>
195      * A key field must be persistent.
196      * The following holds:
197      * isKeyField(classPath, fieldName)
198      * ==> isPersistentField(classPath, fieldName)
199      * && !isDefaultFetchGroupField(classPath, fieldName)
200      * <P>
201      * This method requires the field having been declared by declareField().
202      * @param classPath the non-null JVM-qualified name of the class
203      * @param fieldName the non-null name of the field
204      * @return true if this field is key; otherwise false
205      * @see #isPersistentField(String, String)
206      * @see #declareField(String, String, String)
207      *********************************************************************/

208
209     public boolean isKeyField(String JavaDoc classPath, String JavaDoc fieldName)
210         throws JDOMetaDataUserException, JDOMetaDataFatalError;
211
212
213     /**********************************************************************
214      * Returns the field flags for a declared field of a class.
215      * <P>
216      * The following holds for the field flags:
217      * int f = getFieldFlags(classPath, fieldName);
218      *
219      * !isManagedField(classPath, fieldName)
220      * ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) &&
221      * (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0)
222      *
223      * isTransientField(classPath, fieldName)
224      * ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) &&
225      * (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE == 0)
226      *
227      * isKeyField(classPath, fieldName)
228      * ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) &&
229      * (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE != 0)
230      *
231      * isDefaultFetchGroupField(classPath, fieldName)
232      * ==> (f & CHECK_READ != 0) && (f & MEDIATE_READ != 0) &&
233      * (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0)
234      *
235      * isPersistentField(classPath, fieldName)
236      * && isKeyField(classPath, fieldName)
237      * && isDefaultFetchGroupField(classPath, fieldName)
238      * ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) &&
239      * (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE != 0)
240      * <P>
241      * This method requires the field having been declared by declareField().
242      * @param classPath the non-null JVM-qualified name of the class
243      * @param fieldName the non-null name of the field
244      * @return the field flags for this field
245      * @see #declareField(String, String, String)
246      *********************************************************************/

247
248     public int getFieldFlags(String JavaDoc classPath, String JavaDoc fieldName)
249         throws JDOMetaDataUserException, JDOMetaDataFatalError;
250
251     
252     /**********************************************************************
253      * Returns the field flags for some declared, managed fields of a class.
254      * <P>
255      * This method requires all fields having been declared by declareField().
256      * @param classPath the non-null JVM-qualified name of the class
257      * @param fieldNames the non-null array of names of the declared fields
258      * @return the field flags for the fields
259      * @see #declareField(String, String, String)
260      *********************************************************************/

261
262     public int[] getFieldFlags(String JavaDoc classPath, String JavaDoc[] fieldNames)
263         throws JDOMetaDataUserException, JDOMetaDataFatalError;
264
265
266     /**********************************************************************
267      * Gets the type of some fields.
268      *
269      * @param classname The classname.
270      * @param fieldnames The fieldnames.
271      * @return The type of the fields.
272      *********************************************************************/

273
274     public String JavaDoc[] getFieldType(String JavaDoc classname,
275                           String JavaDoc[] fieldnames)
276         throws JDOMetaDataUserException, JDOMetaDataFatalError;
277
278
279     /**********************************************************************
280      * Returns the unique field index of some declared, managed fields of a
281      * class.
282      * <P>
283      * This method requires all fields having been declared by declareField().
284      * @param classPath the non-null JVM-qualified name of the class
285      * @param fieldNames the non-null array of names of the declared fields
286      * @return the non-negative, unique field indices
287      * @see #declareField(String, String, String)
288      *********************************************************************/

289
290     public int[] getFieldNo(String JavaDoc classPath, String JavaDoc[] fieldNames)
291         throws JDOMetaDataUserException, JDOMetaDataFatalError;
292
293
294     /**********************************************************************
295      * Returns an array of field names of all key fields of a class.
296      * <P>
297      * This method requires all fields having been declared by declareField().
298      * @param classPath the non-null JVM-qualified name of the class
299      * @return an array of all declared key fields of a class
300      * @see #declareField(String, String, String)
301      *********************************************************************/

302
303     public String JavaDoc[] getKeyFields(String JavaDoc classPath)
304         throws JDOMetaDataUserException, JDOMetaDataFatalError;
305
306
307     /**********************************************************************
308      * Returns the name of the persistence-capable superclass of a class.
309      * <P>
310      * The following holds:
311      * (String s = getPersistenceCapableSuperClass(classPath)) != null
312      * ==> isPersistenceCapableClass(classPath)
313      * && !isPersistenceCapableRootClass(classPath)
314      * @param classPath the non-null JVM-qualified name of the class
315      * @return the name of the PC superclass or null if there is none
316      * @see #isPersistenceCapableClass(String)
317      * @see #getPersistenceCapableRootClass(String)
318      *********************************************************************/

319
320     public String JavaDoc getPersistenceCapableSuperClass(String JavaDoc classPath)
321         throws JDOMetaDataUserException, JDOMetaDataFatalError;
322
323
324     /**********************************************************************
325      * Returns the name of the key class of the next persistence-capable
326      * superclass that defines one.
327      * <P>
328      * The following holds:
329      * (String s = getSuperKeyClass(classPath)) != null
330      * ==> !isPersistenceCapableClass(s)
331      * && isPersistenceCapableClass(classPath)
332      * && !isPersistenceCapableRootClass(classPath)
333      * @param classPath the non-null JVM-qualified name of the class
334      * @return the name of the key class or null if there is none
335      * @see #getKeyClass(String)
336      * @see #getPersistenceCapableSuperClass(String)
337      *********************************************************************/

338
339     public String JavaDoc getSuperKeyClass(String JavaDoc classPath)
340         throws JDOMetaDataUserException, JDOMetaDataFatalError;
341
342 } //ExtendedJDOMetaData
343

344
345 //ExtendedJDOMetaData - Java Source End
346
Popular Tags