View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.mapping.xml;
9   
10  /**
11   * The 'class' element is used to store information about mapping
12   * of a class.
13   *  
14   * 
15   * @version $Revision$ $Date$
16   */
17  @SuppressWarnings("serial")
18  public class ClassMapping implements java.io.Serializable {
19  
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Specifies the fully qualified package name of the Java
27       * object needed to be mapped.
28       *  
29       */
30      private java.lang.String _name;
31  
32      /**
33       * An optional attribute to specify the extension relationship 
34       *  between objects. Used only if mapping of the another object
35       * 
36       *  is provided.
37       *  
38       */
39      private java.lang.Object _extends;
40  
41      /**
42       * An optional attribute to specify that one object depends on 
43       *  another object.
44       *  
45       */
46      private java.lang.Object _depends;
47  
48      /**
49       * An optional attribute for specifying the unique
50       * identificator 
51       *  of the object within the persistence storage. 
52       *  
53       */
54      private java.util.List<java.lang.String> _identity;
55  
56      /**
57       * Field _access.
58       */
59      private org.exolab.castor.mapping.xml.types.ClassMappingAccessType _access = org.exolab.castor.mapping.xml.types.ClassMappingAccessType.fromValue("shared");
60  
61      /**
62       * Field _keyGenerator.
63       */
64      private java.lang.String _keyGenerator;
65  
66      /**
67       * Specifies whether Castor should use reflection to establish
68       * XML data 
69       *  binding information at startup time for those fields that
70       * are not
71       *  mapped explicitly.
72       *  
73       */
74      private boolean _autoComplete = false;
75  
76      /**
77       * keeps track of state for field: _autoComplete
78       */
79      private boolean _has_autoComplete;
80  
81      /**
82       * Field _verifyConstructable.
83       */
84      private boolean _verifyConstructable = true;
85  
86      /**
87       * keeps track of state for field: _verifyConstructable
88       */
89      private boolean _has_verifyConstructable;
90  
91      /**
92       * If set to the name of a mapped field, this field will be
93       * used for check 
94       *  on object modifications during transactions (Castor JDO
95       * only).
96       *  
97       */
98      private java.lang.String _version;
99  
100     /**
101      * Field _description.
102      */
103     private java.lang.String _description;
104 
105     /**
106      * Field _cacheTypeMapping.
107      */
108     private org.exolab.castor.mapping.xml.CacheTypeMapping _cacheTypeMapping;
109 
110     /**
111      * The 'map-to' element is used for specifying the name of the
112      * item 
113      *  that should be associated with the given Java object.
114      *  
115      */
116     private org.exolab.castor.mapping.xml.MapTo _mapTo;
117 
118     /**
119      * Field _namedQueryList.
120      */
121     private java.util.List<org.exolab.castor.mapping.xml.NamedQuery> _namedQueryList;
122 
123     /**
124      * Field _namedNativeQueryList.
125      */
126     private java.util.List<org.exolab.castor.mapping.xml.NamedNativeQuery> _namedNativeQueryList;
127 
128     /**
129      * Field _classChoice.
130      */
131     private org.exolab.castor.mapping.xml.ClassChoice _classChoice;
132 
133 
134       //----------------/
135      //- Constructors -/
136     //----------------/
137 
138     public ClassMapping() {
139         super();
140         this._identity = new java.util.ArrayList<java.lang.String>();
141         setAccess(org.exolab.castor.mapping.xml.types.ClassMappingAccessType.fromValue("shared"));
142         this._namedQueryList = new java.util.ArrayList<org.exolab.castor.mapping.xml.NamedQuery>();
143         this._namedNativeQueryList = new java.util.ArrayList<org.exolab.castor.mapping.xml.NamedNativeQuery>();
144     }
145 
146 
147       //-----------/
148      //- Methods -/
149     //-----------/
150 
151     /**
152      * 
153      * 
154      * @param vIdentity
155      * @throws java.lang.IndexOutOfBoundsException if the index
156      * given is outside the bounds of the collection
157      */
158     public void addIdentity(
159             final java.lang.String vIdentity)
160     throws java.lang.IndexOutOfBoundsException {
161         this._identity.add(vIdentity);
162     }
163 
164     /**
165      * 
166      * 
167      * @param index
168      * @param vIdentity
169      * @throws java.lang.IndexOutOfBoundsException if the index
170      * given is outside the bounds of the collection
171      */
172     public void addIdentity(
173             final int index,
174             final java.lang.String vIdentity)
175     throws java.lang.IndexOutOfBoundsException {
176         this._identity.add(index, vIdentity);
177     }
178 
179     /**
180      * 
181      * 
182      * @param vNamedNativeQuery
183      * @throws java.lang.IndexOutOfBoundsException if the index
184      * given is outside the bounds of the collection
185      */
186     public void addNamedNativeQuery(
187             final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
188     throws java.lang.IndexOutOfBoundsException {
189         this._namedNativeQueryList.add(vNamedNativeQuery);
190     }
191 
192     /**
193      * 
194      * 
195      * @param index
196      * @param vNamedNativeQuery
197      * @throws java.lang.IndexOutOfBoundsException if the index
198      * given is outside the bounds of the collection
199      */
200     public void addNamedNativeQuery(
201             final int index,
202             final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
203     throws java.lang.IndexOutOfBoundsException {
204         this._namedNativeQueryList.add(index, vNamedNativeQuery);
205     }
206 
207     /**
208      * 
209      * 
210      * @param vNamedQuery
211      * @throws java.lang.IndexOutOfBoundsException if the index
212      * given is outside the bounds of the collection
213      */
214     public void addNamedQuery(
215             final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
216     throws java.lang.IndexOutOfBoundsException {
217         this._namedQueryList.add(vNamedQuery);
218     }
219 
220     /**
221      * 
222      * 
223      * @param index
224      * @param vNamedQuery
225      * @throws java.lang.IndexOutOfBoundsException if the index
226      * given is outside the bounds of the collection
227      */
228     public void addNamedQuery(
229             final int index,
230             final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
231     throws java.lang.IndexOutOfBoundsException {
232         this._namedQueryList.add(index, vNamedQuery);
233     }
234 
235     /**
236      */
237     public void deleteAutoComplete(
238     ) {
239         this._has_autoComplete= false;
240     }
241 
242     /**
243      */
244     public void deleteVerifyConstructable(
245     ) {
246         this._has_verifyConstructable= false;
247     }
248 
249     /**
250      * Method enumerateIdentity.
251      * 
252      * @return an Enumeration over all possible elements of this
253      * collection
254      */
255     public java.util.Enumeration<? extends java.lang.String> enumerateIdentity(
256     ) {
257         return java.util.Collections.enumeration(this._identity);
258     }
259 
260     /**
261      * Method enumerateNamedNativeQuery.
262      * 
263      * @return an Enumeration over all possible elements of this
264      * collection
265      */
266     public java.util.Enumeration<? extends org.exolab.castor.mapping.xml.NamedNativeQuery> enumerateNamedNativeQuery(
267     ) {
268         return java.util.Collections.enumeration(this._namedNativeQueryList);
269     }
270 
271     /**
272      * Method enumerateNamedQuery.
273      * 
274      * @return an Enumeration over all possible elements of this
275      * collection
276      */
277     public java.util.Enumeration<? extends org.exolab.castor.mapping.xml.NamedQuery> enumerateNamedQuery(
278     ) {
279         return java.util.Collections.enumeration(this._namedQueryList);
280     }
281 
282     /**
283      * Returns the value of field 'access'.
284      * 
285      * @return the value of field 'Access'.
286      */
287     public org.exolab.castor.mapping.xml.types.ClassMappingAccessType getAccess(
288     ) {
289         return this._access;
290     }
291 
292     /**
293      * Returns the value of field 'autoComplete'. The field
294      * 'autoComplete' has the following description: Specifies
295      * whether Castor should use reflection to establish XML data 
296      *  binding information at startup time for those fields that
297      * are not
298      *  mapped explicitly.
299      *  
300      * 
301      * @return the value of field 'AutoComplete'.
302      */
303     public boolean getAutoComplete(
304     ) {
305         return this._autoComplete;
306     }
307 
308     /**
309      * Returns the value of field 'cacheTypeMapping'.
310      * 
311      * @return the value of field 'CacheTypeMapping'.
312      */
313     public org.exolab.castor.mapping.xml.CacheTypeMapping getCacheTypeMapping(
314     ) {
315         return this._cacheTypeMapping;
316     }
317 
318     /**
319      * Returns the value of field 'classChoice'.
320      * 
321      * @return the value of field 'ClassChoice'.
322      */
323     public org.exolab.castor.mapping.xml.ClassChoice getClassChoice(
324     ) {
325         return this._classChoice;
326     }
327 
328     /**
329      * Returns the value of field 'depends'. The field 'depends'
330      * has the following description: An optional attribute to
331      * specify that one object depends on 
332      *  another object.
333      *  
334      * 
335      * @return the value of field 'Depends'.
336      */
337     public java.lang.Object getDepends(
338     ) {
339         return this._depends;
340     }
341 
342     /**
343      * Returns the value of field 'description'.
344      * 
345      * @return the value of field 'Description'.
346      */
347     public java.lang.String getDescription(
348     ) {
349         return this._description;
350     }
351 
352     /**
353      * Returns the value of field 'extends'. The field 'extends'
354      * has the following description: An optional attribute to
355      * specify the extension relationship 
356      *  between objects. Used only if mapping of the another object
357      * 
358      *  is provided.
359      *  
360      * 
361      * @return the value of field 'Extends'.
362      */
363     public java.lang.Object getExtends(
364     ) {
365         return this._extends;
366     }
367 
368     /**
369      * Method getIdentity.
370      * 
371      * @param index
372      * @throws java.lang.IndexOutOfBoundsException if the index
373      * given is outside the bounds of the collection
374      * @return the value of the java.lang.String at the given index
375      */
376     public java.lang.String getIdentity(
377             final int index)
378     throws java.lang.IndexOutOfBoundsException {
379         // check bounds for index
380         if (index < 0 || index >= this._identity.size()) {
381             throw new IndexOutOfBoundsException("getIdentity: Index value '" + index + "' not in range [0.." + (this._identity.size() - 1) + "]");
382         }
383 
384         return (java.lang.String) _identity.get(index);
385     }
386 
387     /**
388      * Method getIdentity.Returns the contents of the collection in
389      * an Array.  <p>Note:  Just in case the collection contents
390      * are changing in another thread, we pass a 0-length Array of
391      * the correct type into the API call.  This way we <i>know</i>
392      * that the Array returned is of exactly the correct length.
393      * 
394      * @return this collection as an Array
395      */
396     public java.lang.String[] getIdentity(
397     ) {
398         java.lang.String[] array = new java.lang.String[0];
399         return (java.lang.String[]) this._identity.toArray(array);
400     }
401 
402     /**
403      * Method getIdentityCount.
404      * 
405      * @return the size of this collection
406      */
407     public int getIdentityCount(
408     ) {
409         return this._identity.size();
410     }
411 
412     /**
413      * Returns the value of field 'keyGenerator'.
414      * 
415      * @return the value of field 'KeyGenerator'.
416      */
417     public java.lang.String getKeyGenerator(
418     ) {
419         return this._keyGenerator;
420     }
421 
422     /**
423      * Returns the value of field 'mapTo'. The field 'mapTo' has
424      * the following description: The 'map-to' element is used for
425      * specifying the name of the item 
426      *  that should be associated with the given Java object.
427      *  
428      * 
429      * @return the value of field 'MapTo'.
430      */
431     public org.exolab.castor.mapping.xml.MapTo getMapTo(
432     ) {
433         return this._mapTo;
434     }
435 
436     /**
437      * Returns the value of field 'name'. The field 'name' has the
438      * following description: Specifies the fully qualified package
439      * name of the Java object needed to be mapped.
440      *  
441      * 
442      * @return the value of field 'Name'.
443      */
444     public java.lang.String getName(
445     ) {
446         return this._name;
447     }
448 
449     /**
450      * Method getNamedNativeQuery.
451      * 
452      * @param index
453      * @throws java.lang.IndexOutOfBoundsException if the index
454      * given is outside the bounds of the collection
455      * @return the value of the
456      * org.exolab.castor.mapping.xml.NamedNativeQuery at the given
457      * index
458      */
459     public org.exolab.castor.mapping.xml.NamedNativeQuery getNamedNativeQuery(
460             final int index)
461     throws java.lang.IndexOutOfBoundsException {
462         // check bounds for index
463         if (index < 0 || index >= this._namedNativeQueryList.size()) {
464             throw new IndexOutOfBoundsException("getNamedNativeQuery: Index value '" + index + "' not in range [0.." + (this._namedNativeQueryList.size() - 1) + "]");
465         }
466 
467         return (org.exolab.castor.mapping.xml.NamedNativeQuery) _namedNativeQueryList.get(index);
468     }
469 
470     /**
471      * Method getNamedNativeQuery.Returns the contents of the
472      * collection in an Array.  <p>Note:  Just in case the
473      * collection contents are changing in another thread, we pass
474      * a 0-length Array of the correct type into the API call. 
475      * This way we <i>know</i> that the Array returned is of
476      * exactly the correct length.
477      * 
478      * @return this collection as an Array
479      */
480     public org.exolab.castor.mapping.xml.NamedNativeQuery[] getNamedNativeQuery(
481     ) {
482         org.exolab.castor.mapping.xml.NamedNativeQuery[] array = new org.exolab.castor.mapping.xml.NamedNativeQuery[0];
483         return (org.exolab.castor.mapping.xml.NamedNativeQuery[]) this._namedNativeQueryList.toArray(array);
484     }
485 
486     /**
487      * Method getNamedNativeQueryCount.
488      * 
489      * @return the size of this collection
490      */
491     public int getNamedNativeQueryCount(
492     ) {
493         return this._namedNativeQueryList.size();
494     }
495 
496     /**
497      * Method getNamedQuery.
498      * 
499      * @param index
500      * @throws java.lang.IndexOutOfBoundsException if the index
501      * given is outside the bounds of the collection
502      * @return the value of the
503      * org.exolab.castor.mapping.xml.NamedQuery at the given index
504      */
505     public org.exolab.castor.mapping.xml.NamedQuery getNamedQuery(
506             final int index)
507     throws java.lang.IndexOutOfBoundsException {
508         // check bounds for index
509         if (index < 0 || index >= this._namedQueryList.size()) {
510             throw new IndexOutOfBoundsException("getNamedQuery: Index value '" + index + "' not in range [0.." + (this._namedQueryList.size() - 1) + "]");
511         }
512 
513         return (org.exolab.castor.mapping.xml.NamedQuery) _namedQueryList.get(index);
514     }
515 
516     /**
517      * Method getNamedQuery.Returns the contents of the collection
518      * in an Array.  <p>Note:  Just in case the collection contents
519      * are changing in another thread, we pass a 0-length Array of
520      * the correct type into the API call.  This way we <i>know</i>
521      * that the Array returned is of exactly the correct length.
522      * 
523      * @return this collection as an Array
524      */
525     public org.exolab.castor.mapping.xml.NamedQuery[] getNamedQuery(
526     ) {
527         org.exolab.castor.mapping.xml.NamedQuery[] array = new org.exolab.castor.mapping.xml.NamedQuery[0];
528         return (org.exolab.castor.mapping.xml.NamedQuery[]) this._namedQueryList.toArray(array);
529     }
530 
531     /**
532      * Method getNamedQueryCount.
533      * 
534      * @return the size of this collection
535      */
536     public int getNamedQueryCount(
537     ) {
538         return this._namedQueryList.size();
539     }
540 
541     /**
542      * Returns the value of field 'verifyConstructable'.
543      * 
544      * @return the value of field 'VerifyConstructable'.
545      */
546     public boolean getVerifyConstructable(
547     ) {
548         return this._verifyConstructable;
549     }
550 
551     /**
552      * Returns the value of field 'version'. The field 'version'
553      * has the following description: If set to the name of a
554      * mapped field, this field will be used for check 
555      *  on object modifications during transactions (Castor JDO
556      * only).
557      *  
558      * 
559      * @return the value of field 'Version'.
560      */
561     public java.lang.String getVersion(
562     ) {
563         return this._version;
564     }
565 
566     /**
567      * Method hasAutoComplete.
568      * 
569      * @return true if at least one AutoComplete has been added
570      */
571     public boolean hasAutoComplete(
572     ) {
573         return this._has_autoComplete;
574     }
575 
576     /**
577      * Method hasVerifyConstructable.
578      * 
579      * @return true if at least one VerifyConstructable has been
580      * added
581      */
582     public boolean hasVerifyConstructable(
583     ) {
584         return this._has_verifyConstructable;
585     }
586 
587     /**
588      * Returns the value of field 'autoComplete'. The field
589      * 'autoComplete' has the following description: Specifies
590      * whether Castor should use reflection to establish XML data 
591      *  binding information at startup time for those fields that
592      * are not
593      *  mapped explicitly.
594      *  
595      * 
596      * @return the value of field 'AutoComplete'.
597      */
598     public boolean isAutoComplete(
599     ) {
600         return this._autoComplete;
601     }
602 
603     /**
604      * Method isValid.
605      * 
606      * @return true if this object is valid according to the schema
607      */
608     public boolean isValid(
609     ) {
610         try {
611             validate();
612         } catch (org.exolab.castor.xml.ValidationException vex) {
613             return false;
614         }
615         return true;
616     }
617 
618     /**
619      * Returns the value of field 'verifyConstructable'.
620      * 
621      * @return the value of field 'VerifyConstructable'.
622      */
623     public boolean isVerifyConstructable(
624     ) {
625         return this._verifyConstructable;
626     }
627 
628     /**
629      * Method iterateIdentity.
630      * 
631      * @return an Iterator over all possible elements in this
632      * collection
633      */
634     public java.util.Iterator<? extends java.lang.String> iterateIdentity(
635     ) {
636         return this._identity.iterator();
637     }
638 
639     /**
640      * Method iterateNamedNativeQuery.
641      * 
642      * @return an Iterator over all possible elements in this
643      * collection
644      */
645     public java.util.Iterator<? extends org.exolab.castor.mapping.xml.NamedNativeQuery> iterateNamedNativeQuery(
646     ) {
647         return this._namedNativeQueryList.iterator();
648     }
649 
650     /**
651      * Method iterateNamedQuery.
652      * 
653      * @return an Iterator over all possible elements in this
654      * collection
655      */
656     public java.util.Iterator<? extends org.exolab.castor.mapping.xml.NamedQuery> iterateNamedQuery(
657     ) {
658         return this._namedQueryList.iterator();
659     }
660 
661     /**
662      * 
663      * 
664      * @param out
665      * @throws org.exolab.castor.xml.MarshalException if object is
666      * null or if any SAXException is thrown during marshaling
667      * @throws org.exolab.castor.xml.ValidationException if this
668      * object is an invalid instance according to the schema
669      */
670     public void marshal(
671             final java.io.Writer out)
672     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
673         org.exolab.castor.xml.Marshaller.marshal(this, out);
674     }
675 
676     /**
677      * 
678      * 
679      * @param handler
680      * @throws java.io.IOException if an IOException occurs during
681      * marshaling
682      * @throws org.exolab.castor.xml.ValidationException if this
683      * object is an invalid instance according to the schema
684      * @throws org.exolab.castor.xml.MarshalException if object is
685      * null or if any SAXException is thrown during marshaling
686      */
687     public void marshal(
688             final org.xml.sax.ContentHandler handler)
689     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
690         org.exolab.castor.xml.Marshaller.marshal(this, handler);
691     }
692 
693     /**
694      */
695     public void removeAllIdentity(
696     ) {
697         this._identity.clear();
698     }
699 
700     /**
701      */
702     public void removeAllNamedNativeQuery(
703     ) {
704         this._namedNativeQueryList.clear();
705     }
706 
707     /**
708      */
709     public void removeAllNamedQuery(
710     ) {
711         this._namedQueryList.clear();
712     }
713 
714     /**
715      * Method removeIdentity.
716      * 
717      * @param vIdentity
718      * @return true if the object was removed from the collection.
719      */
720     public boolean removeIdentity(
721             final java.lang.String vIdentity) {
722         boolean removed = _identity.remove(vIdentity);
723         return removed;
724     }
725 
726     /**
727      * Method removeIdentityAt.
728      * 
729      * @param index
730      * @return the element removed from the collection
731      */
732     public java.lang.String removeIdentityAt(
733             final int index) {
734         java.lang.Object obj = this._identity.remove(index);
735         return (java.lang.String) obj;
736     }
737 
738     /**
739      * Method removeNamedNativeQuery.
740      * 
741      * @param vNamedNativeQuery
742      * @return true if the object was removed from the collection.
743      */
744     public boolean removeNamedNativeQuery(
745             final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery) {
746         boolean removed = _namedNativeQueryList.remove(vNamedNativeQuery);
747         return removed;
748     }
749 
750     /**
751      * Method removeNamedNativeQueryAt.
752      * 
753      * @param index
754      * @return the element removed from the collection
755      */
756     public org.exolab.castor.mapping.xml.NamedNativeQuery removeNamedNativeQueryAt(
757             final int index) {
758         java.lang.Object obj = this._namedNativeQueryList.remove(index);
759         return (org.exolab.castor.mapping.xml.NamedNativeQuery) obj;
760     }
761 
762     /**
763      * Method removeNamedQuery.
764      * 
765      * @param vNamedQuery
766      * @return true if the object was removed from the collection.
767      */
768     public boolean removeNamedQuery(
769             final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery) {
770         boolean removed = _namedQueryList.remove(vNamedQuery);
771         return removed;
772     }
773 
774     /**
775      * Method removeNamedQueryAt.
776      * 
777      * @param index
778      * @return the element removed from the collection
779      */
780     public org.exolab.castor.mapping.xml.NamedQuery removeNamedQueryAt(
781             final int index) {
782         java.lang.Object obj = this._namedQueryList.remove(index);
783         return (org.exolab.castor.mapping.xml.NamedQuery) obj;
784     }
785 
786     /**
787      * Sets the value of field 'access'.
788      * 
789      * @param access the value of field 'access'.
790      */
791     public void setAccess(
792             final org.exolab.castor.mapping.xml.types.ClassMappingAccessType access) {
793         this._access = access;
794     }
795 
796     /**
797      * Sets the value of field 'autoComplete'. The field
798      * 'autoComplete' has the following description: Specifies
799      * whether Castor should use reflection to establish XML data 
800      *  binding information at startup time for those fields that
801      * are not
802      *  mapped explicitly.
803      *  
804      * 
805      * @param autoComplete the value of field 'autoComplete'.
806      */
807     public void setAutoComplete(
808             final boolean autoComplete) {
809         this._autoComplete = autoComplete;
810         this._has_autoComplete = true;
811     }
812 
813     /**
814      * Sets the value of field 'cacheTypeMapping'.
815      * 
816      * @param cacheTypeMapping the value of field 'cacheTypeMapping'
817      */
818     public void setCacheTypeMapping(
819             final org.exolab.castor.mapping.xml.CacheTypeMapping cacheTypeMapping) {
820         this._cacheTypeMapping = cacheTypeMapping;
821     }
822 
823     /**
824      * Sets the value of field 'classChoice'.
825      * 
826      * @param classChoice the value of field 'classChoice'.
827      */
828     public void setClassChoice(
829             final org.exolab.castor.mapping.xml.ClassChoice classChoice) {
830         this._classChoice = classChoice;
831     }
832 
833     /**
834      * Sets the value of field 'depends'. The field 'depends' has
835      * the following description: An optional attribute to specify
836      * that one object depends on 
837      *  another object.
838      *  
839      * 
840      * @param depends the value of field 'depends'.
841      */
842     public void setDepends(
843             final java.lang.Object depends) {
844         this._depends = depends;
845     }
846 
847     /**
848      * Sets the value of field 'description'.
849      * 
850      * @param description the value of field 'description'.
851      */
852     public void setDescription(
853             final java.lang.String description) {
854         this._description = description;
855     }
856 
857     /**
858      * Sets the value of field 'extends'. The field 'extends' has
859      * the following description: An optional attribute to specify
860      * the extension relationship 
861      *  between objects. Used only if mapping of the another object
862      * 
863      *  is provided.
864      *  
865      * 
866      * @param _extends
867      * @param extends the value of field 'extends'.
868      */
869     public void setExtends(
870             final java.lang.Object _extends) {
871         this._extends = _extends;
872     }
873 
874     /**
875      * 
876      * 
877      * @param index
878      * @param vIdentity
879      * @throws java.lang.IndexOutOfBoundsException if the index
880      * given is outside the bounds of the collection
881      */
882     public void setIdentity(
883             final int index,
884             final java.lang.String vIdentity)
885     throws java.lang.IndexOutOfBoundsException {
886         // check bounds for index
887         if (index < 0 || index >= this._identity.size()) {
888             throw new IndexOutOfBoundsException("setIdentity: Index value '" + index + "' not in range [0.." + (this._identity.size() - 1) + "]");
889         }
890 
891         this._identity.set(index, vIdentity);
892     }
893 
894     /**
895      * 
896      * 
897      * @param vIdentityArray
898      */
899     public void setIdentity(
900             final java.lang.String[] vIdentityArray) {
901         //-- copy array
902         _identity.clear();
903 
904         for (int i = 0; i < vIdentityArray.length; i++) {
905                 this._identity.add(vIdentityArray[i]);
906         }
907     }
908 
909     /**
910      * Sets the value of field 'keyGenerator'.
911      * 
912      * @param keyGenerator the value of field 'keyGenerator'.
913      */
914     public void setKeyGenerator(
915             final java.lang.String keyGenerator) {
916         this._keyGenerator = keyGenerator;
917     }
918 
919     /**
920      * Sets the value of field 'mapTo'. The field 'mapTo' has the
921      * following description: The 'map-to' element is used for
922      * specifying the name of the item 
923      *  that should be associated with the given Java object.
924      *  
925      * 
926      * @param mapTo the value of field 'mapTo'.
927      */
928     public void setMapTo(
929             final org.exolab.castor.mapping.xml.MapTo mapTo) {
930         this._mapTo = mapTo;
931     }
932 
933     /**
934      * Sets the value of field 'name'. The field 'name' has the
935      * following description: Specifies the fully qualified package
936      * name of the Java object needed to be mapped.
937      *  
938      * 
939      * @param name the value of field 'name'.
940      */
941     public void setName(
942             final java.lang.String name) {
943         this._name = name;
944     }
945 
946     /**
947      * 
948      * 
949      * @param index
950      * @param vNamedNativeQuery
951      * @throws java.lang.IndexOutOfBoundsException if the index
952      * given is outside the bounds of the collection
953      */
954     public void setNamedNativeQuery(
955             final int index,
956             final org.exolab.castor.mapping.xml.NamedNativeQuery vNamedNativeQuery)
957     throws java.lang.IndexOutOfBoundsException {
958         // check bounds for index
959         if (index < 0 || index >= this._namedNativeQueryList.size()) {
960             throw new IndexOutOfBoundsException("setNamedNativeQuery: Index value '" + index + "' not in range [0.." + (this._namedNativeQueryList.size() - 1) + "]");
961         }
962 
963         this._namedNativeQueryList.set(index, vNamedNativeQuery);
964     }
965 
966     /**
967      * 
968      * 
969      * @param vNamedNativeQueryArray
970      */
971     public void setNamedNativeQuery(
972             final org.exolab.castor.mapping.xml.NamedNativeQuery[] vNamedNativeQueryArray) {
973         //-- copy array
974         _namedNativeQueryList.clear();
975 
976         for (int i = 0; i < vNamedNativeQueryArray.length; i++) {
977                 this._namedNativeQueryList.add(vNamedNativeQueryArray[i]);
978         }
979     }
980 
981     /**
982      * 
983      * 
984      * @param index
985      * @param vNamedQuery
986      * @throws java.lang.IndexOutOfBoundsException if the index
987      * given is outside the bounds of the collection
988      */
989     public void setNamedQuery(
990             final int index,
991             final org.exolab.castor.mapping.xml.NamedQuery vNamedQuery)
992     throws java.lang.IndexOutOfBoundsException {
993         // check bounds for index
994         if (index < 0 || index >= this._namedQueryList.size()) {
995             throw new IndexOutOfBoundsException("setNamedQuery: Index value '" + index + "' not in range [0.." + (this._namedQueryList.size() - 1) + "]");
996         }
997 
998         this._namedQueryList.set(index, vNamedQuery);
999     }
1000 
1001     /**
1002      * 
1003      * 
1004      * @param vNamedQueryArray
1005      */
1006     public void setNamedQuery(
1007             final org.exolab.castor.mapping.xml.NamedQuery[] vNamedQueryArray) {
1008         //-- copy array
1009         _namedQueryList.clear();
1010 
1011         for (int i = 0; i < vNamedQueryArray.length; i++) {
1012                 this._namedQueryList.add(vNamedQueryArray[i]);
1013         }
1014     }
1015 
1016     /**
1017      * Sets the value of field 'verifyConstructable'.
1018      * 
1019      * @param verifyConstructable the value of field
1020      * 'verifyConstructable'.
1021      */
1022     public void setVerifyConstructable(
1023             final boolean verifyConstructable) {
1024         this._verifyConstructable = verifyConstructable;
1025         this._has_verifyConstructable = true;
1026     }
1027 
1028     /**
1029      * Sets the value of field 'version'. The field 'version' has
1030      * the following description: If set to the name of a mapped
1031      * field, this field will be used for check 
1032      *  on object modifications during transactions (Castor JDO
1033      * only).
1034      *  
1035      * 
1036      * @param version the value of field 'version'.
1037      */
1038     public void setVersion(
1039             final java.lang.String version) {
1040         this._version = version;
1041     }
1042 
1043     /**
1044      * Method unmarshal.
1045      * 
1046      * @param reader
1047      * @throws org.exolab.castor.xml.MarshalException if object is
1048      * null or if any SAXException is thrown during marshaling
1049      * @throws org.exolab.castor.xml.ValidationException if this
1050      * object is an invalid instance according to the schema
1051      * @return the unmarshaled
1052      * org.exolab.castor.mapping.xml.ClassMapping
1053      */
1054     public static org.exolab.castor.mapping.xml.ClassMapping unmarshal(
1055             final java.io.Reader reader)
1056     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1057         return (org.exolab.castor.mapping.xml.ClassMapping) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.ClassMapping.class, reader);
1058     }
1059 
1060     /**
1061      * 
1062      * 
1063      * @throws org.exolab.castor.xml.ValidationException if this
1064      * object is an invalid instance according to the schema
1065      */
1066     public void validate(
1067     )
1068     throws org.exolab.castor.xml.ValidationException {
1069         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1070         validator.validate(this);
1071     }
1072 
1073 }