KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > commonj > sdo > DataObject


1 /**
2  * <copyright>
3  *
4  * Service Data Objects
5  * Version 1.0
6  * Licensed Materials - Property of BEA and IBM
7  *
8  * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2003. All rights reserved.
9  *
10  * </copyright>
11  *
12  * $Id: DataObject.java,v 1.1 2004/03/26 15:24:15 marcelop Exp $
13  */

14 package commonj.sdo;
15
16 import java.io.Serializable JavaDoc;
17 import java.math.BigDecimal JavaDoc;
18 import java.math.BigInteger JavaDoc;
19 import java.util.Date JavaDoc;
20 import java.util.List JavaDoc;
21
22 /**
23  * A data object is a representation of some structured data.
24  * It is the fundamental component in the SDO (Service Data Objects) package.
25  * Data objects support reflection, path-based accesss, convenience creation and deletion methods,
26  * and the ability to be part of a {@link DataGraph data graph}.
27  * <p>
28  * Each data object holds its data as a series of {@link Property properties}.
29  * Properties can be accessed by name, property index, or using the property meta object itself.
30  * A data object can also contain references to other data objects, through reference-type properties.
31  * <p>
32  * A data object has a series of convenience accessors for its properties.
33  * These methods either use a path (String),
34  * a property index,
35  * or the {@link Property property's meta object} itself, to identify the property.
36  * Some examples of the path-based accessors are as follows:
37  *<pre>
38  * DataObject company = ...;
39  * company.get("name"); is the same as company.get(company.getType().getProperty("name"))
40  * company.set("name", "acme");
41  * company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
42  * .n indexes from 0 ... implies the name property of the first department
43  * company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department
44  * company.get("department[number=123]") returns the first department where number=123
45  * company.get("..") returns the containing data object
46  * company.get("/") returns the root containing data object
47  *</pre>
48  * <p> There are general accessors for properties, i.e., {@link #get(Property) get} and {@link #set(Property, Object) set},
49  * as well as specific accessors for the primitive types and commonly used data types like
50  * String, Date, List, BigInteger, and BigDecimal.
51  */

52 public interface DataObject extends Serializable JavaDoc
53 {
54   /**
55    * Returns the value of a property of either this object or an object reachable from it, as identified by the
56    * specified path.
57    * @param path the path to a valid object and property.
58    * @return the value of the specified property.
59    * @see #get(Property)
60    */

61   Object JavaDoc get(String JavaDoc path);
62
63   /**
64    * Sets a property of either this object or an object reachable from it, as identified by the specified path,
65    * to the specified value.
66    * @param path the path to a valid object and property.
67    * @param value the new value for the property.
68    * @see #set(Property, Object)
69    */

70   void set(String JavaDoc path, Object JavaDoc value);
71
72   /**
73    * Returns whether a property of either this object or an object reachable from it, as identified by the specified path,
74    * is considered to be set.
75    * @param path the path to a valid object and property.
76    * @see #isSet(Property)
77    */

78   boolean isSet(String JavaDoc path);
79
80   /**
81    * Unsets a property of either this object or an object reachable from it, as identified by the specified path.
82    * @param path the path to a valid object and property.
83    * @see #unset(Property)
84    */

85   void unset(String JavaDoc path);
86
87   /**
88    * Returns the value of a <code>boolean</code> property identified by the specified path.
89    * @param path the path to a valid object and property.
90    * @return the <code>boolean</code> value of the specified property.
91    * @see #get(String)
92    */

93   boolean getBoolean(String JavaDoc path);
94
95   /**
96    * Returns the value of a <code>byte</code> property identified by the specified path.
97    * @param path the path to a valid object and property.
98    * @return the <code>byte</code> value of the specified property.
99    * @see #get(String)
100    */

101   byte getByte(String JavaDoc path);
102
103   /**
104    * Returns the value of a <code>char</code> property identified by the specified path.
105    * @param path the path to a valid object and property.
106    * @return the <code>char</code> value of the specified property.
107    * @see #get(String)
108    */

109   char getChar(String JavaDoc path);
110
111   /**
112    * Returns the value of a <code>double</code> property identified by the specified path.
113    * @param path the path to a valid object and property.
114    * @return the <code>double</code> value of the specified property.
115    * @see #get(String)
116    */

117   double getDouble(String JavaDoc path);
118
119   /**
120    * Returns the value of a <code>float</code> property identified by the specified path.
121    * @param path the path to a valid object and property.
122    * @return the <code>float</code> value of the specified property.
123    * @see #get(String)
124    */

125   float getFloat(String JavaDoc path);
126
127   /**
128    * Returns the value of a <code>int</code> property identified by the specified path.
129    * @param path the path to a valid object and property.
130    * @return the <code>int</code> value of the specified property.
131    * @see #get(String)
132    */

133   int getInt(String JavaDoc path);
134
135   /**
136    * Returns the value of a <code>long</code> property identified by the specified path.
137    * @param path the path to a valid object and property.
138    * @return the <code>long</code> value of the specified property.
139    * @see #get(String)
140    */

141   long getLong(String JavaDoc path);
142
143   /**
144    * Returns the value of a <code>short</code> property identified by the specified path.
145    * @param path the path to a valid object and property.
146    * @return the <code>short</code> value of the specified property.
147    * @see #get(String)
148    */

149   short getShort(String JavaDoc path);
150
151   /**
152    * Returns the value of a <code>byte[]</code> property identified by the specified path.
153    * @param path the path to a valid object and property.
154    * @return the <code>byte[]</code> value of the specified property.
155    * @see #get(String)
156    */

157   byte[] getBytes(String JavaDoc path);
158
159   /**
160    * Returns the value of a <code>BigDecimal</code> property identified by the specified path.
161    * @param path the path to a valid object and property.
162    * @return the <code>BigDecimal</code> value of the specified property.
163    * @see #get(String)
164    */

165   BigDecimal JavaDoc getBigDecimal(String JavaDoc path);
166
167   /**
168    * Returns the value of a <code>BigInteger</code> property identified by the specified path.
169    * @param path the path to a valid object and property.
170    * @return the <code>BigInteger</code> value of the specified property.
171    * @see #get(String)
172    */

173   BigInteger JavaDoc getBigInteger(String JavaDoc path);
174
175   /**
176    * Returns the value of a <code>DataObject</code> property identified by the specified path.
177    * @param path the path to a valid object and property.
178    * @return the <code>DataObject</code> value of the specified property.
179    * @see #get(String)
180    */

181   DataObject getDataObject(String JavaDoc path);
182
183   /**
184    * Returns the value of a <code>Date</code> property identified by the specified path.
185    * @param path the path to a valid object and property.
186    * @return the <code>Date</code> value of the specified property.
187    * @see #get(String)
188    */

189   Date JavaDoc getDate(String JavaDoc path);
190
191   /**
192    * Returns the value of a <code>String</code> property identified by the specified path.
193    * @param path the path to a valid object and property.
194    * @return the <code>String</code> value of the specified property.
195    * @see #get(String)
196    */

197   String JavaDoc getString(String JavaDoc path);
198
199   /**
200    * Returns the value of a <code>List</code> property identified by the specified path.
201    * @param path the path to a valid object and property.
202    * @return the <code>List</code> value of the specified property.
203    * @see #get(String)
204    */

205   List JavaDoc getList(String JavaDoc path);
206
207   /**
208    * Returns the value of a <code>Sequence</code> property identified by the specified path.
209    * @param path the path to a valid object and property.
210    * @return the <code>DataSequence</code> value of the specified property.
211    * @see #get(String)
212    */

213   Sequence getSequence(String JavaDoc path);
214
215   /**
216    * Sets the value of a <code>boolean</code> property identified by the specified path, to the specified value.
217    * @param path the path to a valid object and property.
218    * @param value the new value for the property.
219    * @see #set(String, Object)
220    */

221   void setBoolean(String JavaDoc path, boolean value);
222
223   /**
224    * Sets the value of a <code>byte</code> property identified by the specified path, to the specified value.
225    * @param path the path to a valid object and property.
226    * @param value the new value for the property.
227    * @see #set(String, Object)
228    */

229   void setByte(String JavaDoc path, byte value);
230
231   /**
232    * Sets the value of a <code>char</code> property identified by the specified path, to the specified value.
233    * @param path the path to a valid object and property.
234    * @param value the new value for the property.
235    * @see #set(String, Object)
236    */

237   void setChar(String JavaDoc path, char value);
238
239   /**
240    * Sets the value of a <code>double</code> property identified by the specified path, to the specified value.
241    * @param path the path to a valid object and property.
242    * @param value the new value for the property.
243    * @see #set(String, Object)
244    */

245   void setDouble(String JavaDoc path, double value);
246
247   /**
248    * Sets the value of a <code>float</code> property identified by the specified path, to the specified value.
249    * @param path the path to a valid object and property.
250    * @param value the new value for the property.
251    * @see #set(String, Object)
252    */

253   void setFloat(String JavaDoc path, float value);
254
255   /**
256    * Sets the value of a <code>int</code> property identified by the specified path, to the specified value.
257    * @param path the path to a valid object and property.
258    * @param value the new value for the property.
259    * @see #set(String, Object)
260    */

261   void setInt(String JavaDoc path, int value);
262
263   /**
264    * Sets the value of a <code>long</code> property identified by the specified path, to the specified value.
265    * @param path the path to a valid object and property.
266    * @param value the new value for the property.
267    * @see #set(String, Object)
268    */

269   void setLong(String JavaDoc path, long value);
270
271   /**
272    * Sets the value of a <code>short</code> property identified by the specified path, to the specified value.
273    * @param path the path to a valid object and property.
274    * @param value the new value for the property.
275    * @see #set(String, Object)
276    */

277   void setShort(String JavaDoc path, short value);
278
279   /**
280    * Sets the value of a <code>byte[]</code> property identified by the specified path, to the specified value.
281    * @param path the path to a valid object and property.
282    * @param value the new value for the property.
283    * @see #set(String, Object)
284    */

285   void setBytes(String JavaDoc path, byte[] value);
286
287   /**
288    * Sets the value of a <code>BigDecimal</code> property identified by the specified path, to the specified value.
289    * @param path the path to a valid object and property.
290    * @param value the new value for the property.
291    * @see #set(String, Object)
292    */

293   void setBigDecimal(String JavaDoc path, BigDecimal JavaDoc value);
294
295   /**
296    * Sets the value of a <code>BigInteger</code> property identified by the specified path, to the specified value.
297    * @param path the path to a valid object and property.
298    * @param value the new value for the property.
299    * @see #set(String, Object)
300    */

301   void setBigInteger(String JavaDoc path, BigInteger JavaDoc value);
302
303   /**
304    * Sets the value of a <code>DataObject</code> property identified by the specified path, to the specified value.
305    * @param path the path to a valid object and property.
306    * @param value the new value for the property.
307    * @see #set(String, Object)
308    */

309   void setDataObject(String JavaDoc path, DataObject value);
310
311   /**
312    * Sets the value of a <code>Date</code> property identified by the specified path, to the specified value.
313    * @param path the path to a valid object and property.
314    * @param value the new value for the property.
315    * @see #set(String, Object)
316    */

317   void setDate(String JavaDoc path, Date JavaDoc value);
318
319   /**
320    * Sets the value of a <code>String</code> property identified by the specified path, to the specified value.
321    * @param path the path to a valid object and property.
322    * @param value the new value for the property.
323    * @see #set(String, Object)
324    */

325   void setString(String JavaDoc path, String JavaDoc value);
326
327   /**
328    * Sets the value of a <code>List</code> property identified by the specified path, to the specified value.
329    * @param path the path to a valid object and property.
330    * @param value the new value for the property.
331    * @see #set(String, Object)
332    */

333   void setList(String JavaDoc path, List JavaDoc value);
334
335   /**
336    * Returns the value of the property at the specified index in {@link Type#getProperties property list}
337    * of this object's {@link Type type}.
338    * @param propertyIndex the index of the property.
339    * @return the value of the specified property.
340    * @see #get(Property)
341    */

342   Object JavaDoc get(int propertyIndex);
343
344   /**
345    * Sets the property at the specified index in {@link Type#getProperties property list} of this object's
346    * {@link Type type}, to the specified value.
347    * @param propertyIndex the index of the property.
348    * @param value the new value for the property.
349    * @see #set(Property, Object)
350    */

351   void set(int propertyIndex, Object JavaDoc value);
352
353   /**
354    * Returns whether the the property at the specified index in {@link Type#getProperties property list} of this object's
355    * {@link Type type}, is considered to be set.
356    * @param propertyIndex the index of the property.
357    * @return whether the specified property is set.
358    * @see #isSet(Property)
359    */

360   boolean isSet(int propertyIndex);
361
362   /**
363    * Unsets the property at the specified index in {@link Type#getProperties property list} of this object's {@link Type type}.
364    * @param propertyIndex the index of the property.
365    * @see #unset(Property)
366    */

367   void unset(int propertyIndex);
368
369   /**
370    * Returns the value of a <code>boolean</code> property identified by the specified property index.
371    * @param propertyIndex the index of the property.
372    * @return the <code>boolean</code> value of the specified property.
373    * @see #get(int)
374    */

375   boolean getBoolean(int propertyIndex);
376
377   /**
378    * Returns the value of a <code>byte</code> property identified by the specified property index.
379    * @param propertyIndex the index of the property.
380    * @return the <code>byte</code> value of the specified property.
381    * @see #get(int)
382    */

383   byte getByte(int propertyIndex);
384
385   /**
386    * Returns the value of a <code>char</code> property identified by the specified property index.
387    * @param propertyIndex the index of the property.
388    * @return the <code>char</code> value of the specified property.
389    * @see #get(int)
390    */

391   char getChar(int propertyIndex);
392
393   /**
394    * Returns the value of a <code>double</code> property identified by the specified property index.
395    * @param propertyIndex the index of the property.
396    * @return the <code>double</code> value of the specified property.
397    * @see #get(int)
398    */

399   double getDouble(int propertyIndex);
400
401   /**
402    * Returns the value of a <code>float</code> property identified by the specified property index.
403    * @param propertyIndex the index of the property.
404    * @return the <code>float</code> value of the specified property.
405    * @see #get(int)
406    */

407   float getFloat(int propertyIndex);
408
409   /**
410    * Returns the value of a <code>int</code> property identified by the specified property index.
411    * @param propertyIndex the index of the property.
412    * @return the <code>int</code> value of the specified property.
413    * @see #get(int)
414    */

415   int getInt(int propertyIndex);
416
417   /**
418    * Returns the value of a <code>long</code> property identified by the specified property index.
419    * @param propertyIndex the index of the property.
420    * @return the <code>long</code> value of the specified property.
421    * @see #get(int)
422    */

423   long getLong(int propertyIndex);
424
425   /**
426    * Returns the value of a <code>short</code> property identified by the specified property index.
427    * @param propertyIndex the index of the property.
428    * @return the <code>short</code> value of the specified property.
429    * @see #get(int)
430    */

431   short getShort(int propertyIndex);
432
433   /**
434    * Returns the value of a <code>byte[]</code> property identified by the specified property index.
435    * @param propertyIndex the index of the property.
436    * @return the <code>byte[]</code> value of the specified property.
437    * @see #get(int)
438    */

439   byte[] getBytes(int propertyIndex);
440
441   /**
442    * Returns the value of a <code>BigDecimal</code> property identified by the specified property index.
443    * @param propertyIndex the index of the property.
444    * @return the <code>BigDecimal</code> value of the specified property.
445    * @see #get(int)
446    */

447   BigDecimal JavaDoc getBigDecimal(int propertyIndex);
448
449   /**
450    * Returns the value of a <code>BigInteger</code> property identified by the specified property index.
451    * @param propertyIndex the index of the property.
452    * @return the <code>BigInteger</code> value of the specified property.
453    * @see #get(int)
454    */

455   BigInteger JavaDoc getBigInteger(int propertyIndex);
456
457   /**
458    * Returns the value of a <code>DataObject</code> property identified by the specified property index.
459    * @param propertyIndex the index of the property.
460    * @return the <code>DataObject</code> value of the specified property.
461    * @see #get(int)
462    */

463   DataObject getDataObject(int propertyIndex);
464
465   /**
466    * Returns the value of a <code>Date</code> property identified by the specified property index.
467    * @param propertyIndex the index of the property.
468    * @return the <code>Date</code> value of the specified property.
469    * @see #get(int)
470    */

471   Date JavaDoc getDate(int propertyIndex);
472
473   /**
474    * Returns the value of a <code>String</code> property identified by the specified property index.
475    * @param propertyIndex the index of the property.
476    * @return the <code>String</code> value of the specified property.
477    * @see #get(int)
478    */

479   String JavaDoc getString(int propertyIndex);
480
481   /**
482    * Returns the value of a <code>List</code> property identified by the specified property index.
483    * @param propertyIndex the index of the property.
484    * @return the <code>List</code> value of the specified property.
485    * @see #get(int)
486    */

487   List JavaDoc getList(int propertyIndex);
488
489   /**
490    * Returns the value of a <code>Sequence</code> property identified by the specified property index.
491    * @param propertyIndex the index of the property.
492    * @return the <code>DataSequence</code> value of the specified property.
493    * @see #get(int)
494    */

495   Sequence getSequence(int propertyIndex);
496
497   /**
498    * Sets the value of a <code>boolean</code> property identified by the specified property index, to the specified value.
499    * @param propertyIndex the index of the property.
500    * @param value the new value for the property.
501    * @see #set(int, Object)
502    */

503   void setBoolean(int propertyIndex, boolean value);
504
505   /**
506    * Sets the value of a <code>byte</code> property identified by the specified property index, to the specified value.
507    * @param propertyIndex the index of the property.
508    * @param value the new value for the property.
509    * @see #set(int, Object)
510    */

511   void setByte(int propertyIndex, byte value);
512
513   /**
514    * Sets the value of a <code>char</code> property identified by the specified property index, to the specified value.
515    * @param propertyIndex the index of the property.
516    * @param value the new value for the property.
517    * @see #set(int, Object)
518    */

519   void setChar(int propertyIndex, char value);
520
521   /**
522    * Sets the value of a <code>double</code> property identified by the specified property index, to the specified value.
523    * @param propertyIndex the index of the property.
524    * @param value the new value for the property.
525    * @see #set(int, Object)
526    */

527   void setDouble(int propertyIndex, double value);
528
529   /**
530    * Sets the value of a <code>float</code> property identified by the specified property index, to the specified value.
531    * @param propertyIndex the index of the property.
532    * @param value the new value for the property.
533    * @see #set(int, Object)
534    */

535   void setFloat(int propertyIndex, float value);
536
537   /**
538    * Sets the value of a <code>int</code> property identified by the specified property index, to the specified value.
539    * @param propertyIndex the index of the property.
540    * @param value the new value for the property.
541    * @see #set(int, Object)
542    */

543   void setInt(int propertyIndex, int value);
544
545   /**
546    * Sets the value of a <code>long</code> property identified by the specified property index, to the specified value.
547    * @param propertyIndex the index of the property.
548    * @param value the new value for the property.
549    * @see #set(int, Object)
550    */

551   void setLong(int propertyIndex, long value);
552
553   /**
554    * Sets the value of a <code>short</code> property identified by the specified property index, to the specified value.
555    * @param propertyIndex the index of the property.
556    * @param value the new value for the property.
557    * @see #set(int, Object)
558    */

559   void setShort(int propertyIndex, short value);
560
561   /**
562    * Sets the value of a <code>byte[]</code> property identified by the specified property index, to the specified value.
563    * @param propertyIndex the index of the property.
564    * @param value the new value for the property.
565    * @see #set(int, Object)
566    */

567   void setBytes(int propertyIndex, byte[] value);
568
569   /**
570    * Sets the value of a <code>BigDecimal</code> property identified by the specified property index, to the specified value.
571    * @param propertyIndex the index of the property.
572    * @param value the new value for the property.
573    * @see #set(int, Object)
574    */

575   void setBigDecimal(int propertyIndex, BigDecimal JavaDoc value);
576
577   /**
578    * Sets the value of a <code>BigInteger</code> property identified by the specified property index, to the specified value.
579    * @param propertyIndex the index of the property.
580    * @param value the new value for the property.
581    * @see #set(int, Object)
582    */

583   void setBigInteger(int propertyIndex, BigInteger JavaDoc value);
584
585   /**
586    * Sets the value of a <code>DataObject</code> property identified by the specified property index, to the specified value.
587    * @param propertyIndex the index of the property.
588    * @param value the new value for the property.
589    * @see #set(int, Object)
590    */

591   void setDataObject(int propertyIndex, DataObject value);
592
593   /**
594    * Sets the value of a <code>Date</code> property identified by the specified property index, to the specified value.
595    * @param propertyIndex the index of the property.
596    * @param value the new value for the property.
597    * @see #set(int, Object)
598    */

599   void setDate(int propertyIndex, Date JavaDoc value);
600
601   /**
602    * Sets the value of a <code>String</code> property identified by the specified property index, to the specified value.
603    * @param propertyIndex the index of the property.
604    * @param value the new value for the property.
605    * @see #set(int, Object)
606    */

607   void setString(int propertyIndex, String JavaDoc value);
608
609   /**
610    * Sets the value of a <code>List</code> property identified by the specified property index, to the specified value.
611    * @param propertyIndex the index of the property.
612    * @param value the new value for the property.
613    * @see #set(int, Object)
614    */

615   void setList(int propertyIndex, List JavaDoc value);
616
617   /**
618    * Returns the value of the given property of this object.
619    * <p>
620    * If the property is {@link Property#isMany many-valued},
621    * the result will be a {@link java.util.List}
622    * and each object in the list will be {@link Type#isInstance an instance of}
623    * the property's {@link Property#getType type}.
624    * Otherwise the result will directly be an instance of the property's type.
625    * @param property the property of the value to fetch.
626    * @return the value of the given property of the object.
627    * @see #set(Property, Object)
628    * @see #unset(Property)
629    * @see #isSet(Property)
630    */

631   Object JavaDoc get(Property property);
632
633   /**
634    * Sets the value of the given property of the object to the new value.
635    * <p>
636    * If the property is {@link Property#isMany many-valued},
637    * the new value must be a {@link java.util.List}
638    * and each object in that list must be {@link Type#isInstance an instance of}
639    * the property's {@link Property#getType type};
640    * the existing contents are cleared and the contents of the new value are added.
641    * Otherwise the new value directly must be an instance of the property's type
642    * and it becomes the new value of the property of the object.
643    * @param property the property of the value to set.
644    * @param value the new value for the property.
645    * @see #unset(Property)
646    * @see #isSet(Property)
647    * @see #get(Property)
648    */

649   void set(Property property, Object JavaDoc value);
650
651   /**
652    * Returns whether the property of the object is considered to be set.
653    * <p>
654    * If the property is {@link Property#isMany many-valued},
655    * the value must be an {@link java.util.List}
656    * and the property is considered set if the list is not empty.
657    * Otherwise, the value of the property of the object
658    * is compared against the property's {@link Property#getDefault default value}.
659    * The property is considered set if it's not the same as the default.
660    * <p>
661    * This value can affect serialization, since defaults are typically omitted in a compact serialization.
662    * @param property the property in question.
663    * @return whether the property of the object is set.
664    * @see #set(Property, Object)
665    * @see #unset(Property)
666    * @see #get(Property)
667    */

668   boolean isSet(Property property);
669
670   /**
671    * Unsets the property of the object.
672    * <p>
673    * If the property is {@link Property#isMany many-valued},
674    * the value must be an {@link java.util.List}
675    * and that list is cleared.
676    * Otherwise,
677    * the value of the property of the object
678    * is set to the property's {@link Property#getDefault default value}.
679    * The property will no longer be considered {@link #isSet set}.
680    * @param property the property in question.
681    * @see #isSet(Property)
682    * @see #set(Property, Object)
683    * @see #get(Property)
684    */

685   void unset(Property property);
686
687   /**
688    * Returns the value of the specified <code>boolean</code> property.
689    * @param property the property to get.
690    * @return the <code>boolean</code> value of the specified property.
691    * @see #get(Property)
692    */

693   boolean getBoolean(Property property);
694
695   /**
696    * Returns the value of the specified <code>byte</code> property.
697    * @param property the property to get.
698    * @return the <code>byte</code> value of the specified property.
699    * @see #get(Property)
700    */

701   byte getByte(Property property);
702
703   /**
704    * Returns the value of the specified <code>char</code> property.
705    * @param property the property to get.
706    * @return the <code>char</code> value of the specified property.
707    * @see #get(Property)
708    */

709   char getChar(Property property);
710
711   /**
712    * Returns the value of the specified <code>double</code> property.
713    * @param property the property to get.
714    * @return the <code>double</code> value of the specified property.
715    * @see #get(Property)
716    */

717   double getDouble(Property property);
718
719   /**
720    * Returns the value of the specified <code>float</code> property.
721    * @param property the property to get.
722    * @return the <code>float</code> value of the specified property.
723    * @see #get(Property)
724    */

725   float getFloat(Property property);
726
727   /**
728    * Returns the value of the specified <code>int</code> property.
729    * @param property the property to get.
730    * @return the <code>int</code> value of the specified property.
731    * @see #get(Property)
732    */

733   int getInt(Property property);
734
735   /**
736    * Returns the value of the specified <code>long</code> property.
737    * @param property the property to get.
738    * @return the <code>long</code> value of the specified property.
739    * @see #get(Property)
740    */

741   long getLong(Property property);
742
743   /**
744    * Returns the value of the specified <code>short</code> property.
745    * @param property the property to get.
746    * @return the <code>short</code> value of the specified property.
747    * @see #get(Property)
748    */

749   short getShort(Property property);
750
751   /**
752    * Returns the value of the specified <code>byte[]</code> property.
753    * @param property the property to get.
754    * @return the <code>byte[]</code> value of the specified property.
755    * @see #get(Property)
756    */

757   byte[] getBytes(Property property);
758
759   /**
760    * Returns the value of the specified <code>BigDecimal</code> property.
761    * @param property the property to get.
762    * @return the <code>BigDecimal</code> value of the specified property.
763    * @see #get(Property)
764    */

765   BigDecimal JavaDoc getBigDecimal(Property property);
766
767   /**
768    * Returns the value of the specified <code>BigInteger</code> property.
769    * @param property the property to get.
770    * @return the <code>BigInteger</code> value of the specified property.
771    * @see #get(Property)
772    */

773   BigInteger JavaDoc getBigInteger(Property property);
774
775   /**
776    * Returns the value of the specified <code>DataObject</code> property.
777    * @param property the property to get.
778    * @return the <code>DataObject</code> value of the specified property.
779    * @see #get(Property)
780    */

781   DataObject getDataObject(Property property);
782
783   /**
784    * Returns the value of the specified <code>Date</code> property.
785    * @param property the property to get.
786    * @return the <code>Date</code> value of the specified property.
787    * @see #get(Property)
788    */

789   Date JavaDoc getDate(Property property);
790
791   /**
792    * Returns the value of the specified <code>String</code> property.
793    * @param property the property to get.
794    * @return the <code>String</code> value of the specified property.
795    * @see #get(Property)
796    */

797   String JavaDoc getString(Property property);
798
799   /**
800    * Returns the value of the specified <code>List</code> property.
801    * @param property the property to get.
802    * @return the <code>List</code> value of the specified property.
803    * @see #get(Property)
804    */

805   List JavaDoc getList(Property property);
806
807   /**
808    * Returns the value of the specified <code>Sequence</code> property.
809    * @param property the property to get.
810    * @return the <code>DataSequence</code> value of the specified property.
811    * @see #get(Property)
812    */

813   Sequence getSequence(Property property);
814
815   /**
816    * Sets the value of the specified <code>boolean</code> property, to the specified value.
817    * @param property the property to set.
818    * @param value the new value for the property.
819    * @see #set(Property, Object)
820    */

821   void setBoolean(Property property, boolean value);
822
823   /**
824    * Sets the value of the specified <code>byte</code> property, to the specified value.
825    * @param property the property to set.
826    * @param value the new value for the property.
827    * @see #set(Property, Object)
828    */

829   void setByte(Property property, byte value);
830
831   /**
832    * Sets the value of the specified <code>char</code> property, to the specified value.
833    * @param property the property to set.
834    * @param value the new value for the property.
835    * @see #set(Property, Object)
836    */

837   void setChar(Property property, char value);
838
839   /**
840    * Sets the value of the specified <code>double</code> property, to the specified value.
841    * @param property the property to set.
842    * @param value the new value for the property.
843    * @see #set(Property, Object)
844    */

845   void setDouble(Property property, double value);
846
847   /**
848    * Sets the value of the specified <code>float</code> property, to the specified value.
849    * @param property the property to set.
850    * @param value the new value for the property.
851    * @see #set(Property, Object)
852    */

853   void setFloat(Property property, float value);
854
855   /**
856    * Sets the value of the specified <code>int</code> property, to the specified value.
857    * @param property the property to set.
858    * @param value the new value for the property.
859    * @see #set(Property, Object)
860    */

861   void setInt(Property property, int value);
862
863   /**
864    * Sets the value of the specified <code>long</code> property, to the specified value.
865    * @param property the property to set.
866    * @param value the new value for the property.
867    * @see #set(Property, Object)
868    */

869   void setLong(Property property, long value);
870
871   /**
872    * Sets the value of the specified <code>short</code> property, to the specified value.
873    * @param property the property to set.
874    * @param value the new value for the property.
875    * @see #set(Property, Object)
876    */

877   void setShort(Property property, short value);
878
879   /**
880    * Sets the value of the specified <code>byte[]</code> property, to the specified value.
881    * @param property the property to set.
882    * @param value the new value for the property.
883    * @see #set(Property, Object)
884    */

885   void setBytes(Property property, byte[] value);
886
887   /**
888    * Sets the value of the specified <code>BigDecimal</code> property, to the specified value.
889    * @param property the property to set.
890    * @param value the new value for the property.
891    * @see #set(Property, Object)
892    */

893   void setBigDecimal(Property property, BigDecimal JavaDoc value);
894
895   /**
896    * Sets the value of the specified <code>BigInteger</code> property, to the specified value.
897    * @param property the property to set.
898    * @param value the new value for the property.
899    * @see #set(Property, Object)
900    */

901   void setBigInteger(Property property, BigInteger JavaDoc value);
902
903   /**
904    * Sets the value of the specified <code>DataObject</code> property, to the specified value.
905    * @param property the property to set.
906    * @param value the new value for the property.
907    * @see #set(Property, Object)
908    */

909   void setDataObject(Property property, DataObject value);
910
911   /**
912    * Sets the value of the specified <code>Date</code> property, to the specified value.
913    * @param property the property to set.
914    * @param value the new value for the property.
915    * @see #set(Property, Object)
916    */

917   void setDate(Property property, Date JavaDoc value);
918
919   /**
920    * Sets the value of the specified <code>String</code> property, to the specified value.
921    * @param property the property to set.
922    * @param value the new value for the property.
923    * @see #set(Property, Object)
924    */

925   void setString(Property property, String JavaDoc value);
926
927   /**
928    * Sets the value of the specified <code>List</code> property, to the specified value.
929    * @param property the property to set.
930    * @param value the new value for the property.
931    * @see #set(Property, Object)
932    */

933   void setList(Property property, List JavaDoc value);
934
935   /**
936    * Returns a new {@link DataObject data object} contained by this object using the specified property,
937    * which must be a {@link Property#isContainment containment property}.
938    * The type of the created object is the {@link Property#getType declared type} of the specified property.
939    * @param propertyName the name of the specified containment property.
940    * @return the created data object.
941    * @see #createDataObject(String, String, String)
942    */

943   DataObject createDataObject(String JavaDoc propertyName);
944
945   /**
946    * Returns a new {@link DataObject data object} contained by this object using the specified property,
947    * which must be a {@link Property#isContainment containment property}.
948    * The type of the created object is the {@link Property#getType declared type} of the specified property.
949    * @param propertyIndex the index of the specified containment property.
950    * @return the created data object.
951    * @see #createDataObject(int, String, String)
952    */

953   DataObject createDataObject(int propertyIndex);
954
955   /**
956    * Returns a new {@link DataObject data object} contained by this object using the specified property,
957    * which must be a {@link Property#isContainment containment property}.
958    * The type of the created object is the {@link Property#getType declared type} of the specified property.
959    * @param property the specified containment property.
960    * @return the created data object.
961    * @see #createDataObject(Property, Type)
962    */

963   DataObject createDataObject(Property property);
964
965   /**
966    * Returns a new {@link DataObject data object} contained by this object using the specified property,
967    * which must be a {@link Property#isContainment containment property}.
968    * The type of the created object is specified by the packageURI and typeName arguments.
969    * The specified type must be a compatible target for the property identified by propertyName.
970    * @param propertyName the name of the specified containment property.
971    * @param namespaceURI the namespace URI of the package containing the type of object to be created.
972    * @param typeName the name of a type in the specified package.
973    * @return the created data object.
974    * @see #createDataObject(String)
975    * @see DataGraph#getType
976    */

977   DataObject createDataObject(String JavaDoc propertyName, String JavaDoc namespaceURI, String JavaDoc typeName);
978
979   /**
980    * Returns a new {@link DataObject data object} contained by this object using the specified property,
981    * which must be a {@link Property#isContainment containment property}.
982    * The type of the created object is specified by the packageURI and typeName arguments.
983    * The specified type must be a compatible target for the property identified by propertyIndex.
984    * @param propertyIndex the index of the specified containment property.
985    * @param namespaceURI the namespace URI of the package containing the type of object to be created.
986    * @param typeName the name of a type in the specified package.
987    * @return the created data object.
988    * @see #createDataObject(int)
989    * @see DataGraph#getType
990    */

991   DataObject createDataObject(int propertyIndex, String JavaDoc namespaceURI, String JavaDoc typeName);
992
993   /**
994    * Returns a new {@link DataObject data object} contained by this object using the specified property,
995    * which must be of {@link Property#isContainment containment type}.
996    * The type of the created object is specified by the type argument,
997    * which must be a compatible target for the speicifed property.
998    * @param property a containment property of this object.
999    * @param type the type of object to be created.
1000   * @return the created data object.
1001   * @see #createDataObject(int)
1002   */

1003  DataObject createDataObject(Property property, Type type);
1004
1005  /**
1006   * Remove this object from its container and unset all its properties.
1007   */

1008  void delete();
1009
1010  /**
1011   * Returns the containing {@link DataObject data object}
1012   * or <code>null</code> if there is no container.
1013   * @return the containing data object or <code>null</code>.
1014   */

1015  DataObject getContainer();
1016
1017  /**
1018   * Return the Property of the {@link DataObject data object} containing this data object
1019   * or <code>null</code> if there is no container.
1020   * @return the property containing this data object.
1021   */

1022  Property getContainmentProperty();
1023
1024  /**
1025   * Returns the {@link DataGraph data graph} for this object or <code>null</code> if there isn't one.
1026   * @return the containing data graph or <code>null</code>.
1027   */

1028  DataGraph getDataGraph();
1029
1030  /**
1031   * Returns the data object's type.
1032   * <p>
1033   * The type defines the properties available for reflective access.
1034   * @return the type.
1035   */

1036  Type getType();
1037}
1038
Popular Tags