KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > naming > api > PNameGetter


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.naming.api;
25
26 import org.objectweb.jorm.api.PException;
27 import org.objectweb.jorm.api.PExceptionIO;
28 import org.objectweb.jorm.type.api.PExceptionTyping;
29
30 import java.util.Date JavaDoc;
31 import java.math.BigDecimal JavaDoc;
32 import java.math.BigInteger JavaDoc;
33
34 /**
35  * The <b>PNameGetter</b> interface defines a generic accessor to be used by
36  * persistent bindings to access fields of composite names it manages.
37  * @author P. Dechamboux
38  */

39 public interface PNameGetter {
40     /**
41      * It retrieves the value of a byte field.
42      * @param fn A String containing the name of the field.
43      * @param ctxt A context used by PNameGetter to extract the related data.
44      * @return The byte value of the field as stored within the composite
45      * name.
46      * @exception PExceptionTyping There is no field with this name and
47      * this type within this composite name.
48      * @exception PExceptionIO It is raised when a problem occurs while
49      * potentially accessing the DSI.
50      */

51     byte pngetByteField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
52
53     /**
54      * It retrieves the value of a Byte field.
55      * @param fn A String containing the name of the field.
56      * @param ctxt A context used by PNameGetter to extract the related data.
57      * @return The Byte value of the field as stored within the composite
58      * name.
59      * @exception PExceptionTyping There is no field with this name and
60      * this type within this composite name.
61      * @exception PExceptionIO It is raised when a problem occurs while
62      * potentially accessing the DSI.
63      */

64     Byte JavaDoc pngetObyteField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
65
66     /**
67      * It retrieves the value of a char field.
68      * @param fn A String containing the name of the field.
69      * @param ctxt A context used by PNameGetter to extract the related data.
70      * @return The char value of the field as stored within the composite
71      * name.
72      * @exception PExceptionTyping There is no field with this name and
73      * this type within this composite name.
74      * @exception PExceptionIO It is raised when a problem occurs while
75      * potentially accessing the DSI.
76      */

77     char pngetCharField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
78
79     /**
80      * It retrieves the value of a Character field.
81      * @param fn A String containing the name of the field.
82      * @param ctxt A context used by PNameGetter to extract the related data.
83      * @return The Character value of the field as stored within the composite
84      * name.
85      * @exception PExceptionTyping There is no field with this name and
86      * this type within this composite name.
87      * @exception PExceptionIO It is raised when a problem occurs while
88      * potentially accessing the DSI.
89      */

90     Character JavaDoc pngetOcharField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
91
92     /**
93      * It retrieves the value of a short field.
94      * @param fn A String containing the name of the field.
95      * @param ctxt A context used by PNameGetter to extract the related data.
96      * In in the case of RDB, it can be the result set.
97      * @return The short value of the field as stored within the composite
98      * name.
99      * @exception PExceptionTyping There is no field with this name and
100      * this type within this composite name.
101      * @exception PExceptionIO It is raised when a problem occurs while
102      * potentially accessing the DSI.
103      */

104     short pngetShortField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
105
106     /**
107      * It retrieves the value of a Short field.
108      * @param fn A String containing the name of the field.
109      * @param ctxt A context used by PNameGetter to extract the related data.
110      * @return The Short value of the field as stored within the composite
111      * name.
112      * @exception PExceptionTyping There is no field with this name and
113      * this type within this composite name.
114      * @exception PExceptionIO It is raised when a problem occurs while
115      * potentially accessing the DSI.
116      */

117     Short JavaDoc pngetOshortField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
118
119     /**
120      * It retrieves the value of an int field.
121      * @param fn A String containing the name of the field.
122      * @param ctxt A context used by PNameGetter to extract the related data.
123      * @return The int value of the field as stored within the composite
124      * name.
125      * @exception PExceptionTyping There is no field with this name and
126      * this type within this composite name.
127      * @exception PExceptionIO It is raised when a problem occurs while
128      * potentially accessing the DSI.
129      */

130     int pngetIntField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
131
132     /**
133      * It retrieves the value of an Integer field.
134      * @param fn A String containing the name of the field.
135      * @param ctxt A context used by PNameGetter to extract the related data.
136      * @return The Integer value of the field as stored within the composite
137      * name.
138      * @exception PExceptionTyping There is no field with this name and
139      * this type within this composite name.
140      * @exception PExceptionIO It is raised when a problem occurs while
141      * potentially accessing the DSI.
142      */

143     Integer JavaDoc pngetOintField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
144
145     /**
146      * It retrieves the value of a long field.
147      * @param ctxt A context used by PNameGetter to extract the related data.
148      * @param fn A String containing the name of the field.
149      * @return The long value of the field as stored within the composite
150      * name.
151      * @exception PExceptionTyping There is no field with this name and
152      * this type within this composite name.
153      * @exception PExceptionIO It is raised when a problem occurs while
154      * potentially accessing the DSI.
155      */

156     long pngetLongField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
157
158     /**
159      * It retrieves the value of a Long field.
160      * @param fn A String containing the name of the field.
161      * @param ctxt A context used by PNameGetter to extract the related data.
162      * @return The Long value of the field as stored within the composite
163      * name.
164      * @exception PExceptionTyping There is no field with this name and
165      * this type within this composite name.
166      * @exception PExceptionIO It is raised when a problem occurs while
167      * potentially accessing the DSI.
168      */

169     Long JavaDoc pngetOlongField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
170
171     /**
172      * It retrieves the value of a string field.
173      * @param ctxt A context used by PNameGetter to extract the related data.
174      * @param fn A String containing the name of the field.
175      * @return The java.lang.String value of the field as stored within the
176      * composite name.
177      * @exception PExceptionTyping There is no field with this name and
178      * this type within this composite name.
179      * @exception PExceptionIO It is raised when a problem occurs while
180      * potentially accessing the DSI.
181      */

182     String JavaDoc pngetStringField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
183
184     /**
185      * It retrieves the value of a byte[] field.
186      * @param ctxt A context used by PNameGetter to extract the related data.
187      * @param fn A String containing the name of the field.
188      * @return The byte[] value of the field as stored within the
189      * composite name.
190      * @exception PExceptionTyping There is no field with this name and
191      * this type within this composite name.
192      * @exception PExceptionIO It is raised when a problem occurs while
193      * potentially accessing the DSI.
194      */

195     byte[] pngetByteArrayField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
196
197     /**
198      * It retrieves the value of a char[] field.
199      * @param ctxt A context used by PNameGetter to extract the related data.
200      * @param fn A String containing the name of the field.
201      * @return The char[] value of the field as stored within the
202      * composite name.
203      * @exception PExceptionTyping There is no field with this name and
204      * this type within this composite name.
205      * @exception PExceptionIO It is raised when a problem occurs while
206      * potentially accessing the DSI.
207      */

208     char[] pngetCharArrayField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
209
210     /**
211      * It retrieves the value of a date field.
212      * @param fn A String containing the name of the field.
213      * @param ctxt A context used by PNameGetter to extract the related data.
214      * @return The java.util.Date value of the field as stored within the
215      * composite name.
216      * @exception PExceptionTyping There is no field with this name and
217      * this type within this composite name.
218      * @exception PExceptionIO It is raised when a problem occurs while
219      * potentially accessing the DSI.
220      */

221     Date JavaDoc pngetDateField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
222
223     /**
224      * It retrieves the value of a BigInteger field.
225      * @param fn A String containing the name of the field.
226      * @param ctxt A context used by PNameGetter to extract the related data.
227      * @return The java.math.BigInteger value of the field as stored within the
228      * composite name.
229      * @exception PExceptionTyping There is no field with this name and
230      * this type within this composite name.
231      * @exception PExceptionIO It is raised when a problem occurs while
232      * potentially accessing the DSI.
233      */

234     BigInteger JavaDoc pngetBigIntegerField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
235
236     /**
237      * It retrieves the value of a BigDecimal field.
238      * @param fn A String containing the name of the field.
239      * @param ctxt A context used by PNameGetter to extract the related data.
240      * @return The java.math.BigDecimal value of the field as stored within the
241      * composite name.
242      * @exception PExceptionTyping There is no field with this name and
243      * this type within this composite name.
244      * @exception PExceptionIO It is raised when a problem occurs while
245      * potentially accessing the DSI.
246      */

247     BigDecimal JavaDoc pngetBigDecimalField(String JavaDoc fn, Object JavaDoc ctxt) throws PException;
248 }
249
Popular Tags