9d192cfb4de4795fa2bc00153f4c42c12259ad0c
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / JSeqDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.JSeq;
15
16 /**
17  * Class JSeqDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class JSeqDescriptor extends
22         org.exolab.castor.xml.util.XMLClassDescriptorImpl
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _elementDefinition.
31    */
32   private boolean _elementDefinition;
33
34   /**
35    * Field _nsPrefix.
36    */
37   private java.lang.String _nsPrefix;
38
39   /**
40    * Field _nsURI.
41    */
42   private java.lang.String _nsURI;
43
44   /**
45    * Field _xmlName.
46    */
47   private java.lang.String _xmlName;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public JSeqDescriptor()
54   {
55     super();
56     _nsURI = "www.jalview.org";
57     _xmlName = "JSeq";
58     _elementDefinition = true;
59
60     // -- set grouping compositor
61     setCompositorAsSequence();
62     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63     org.exolab.castor.mapping.FieldHandler handler = null;
64     org.exolab.castor.xml.FieldValidator fieldValidator = null;
65     // -- initialize attribute descriptors
66
67     // -- _colour
68     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69             java.lang.Integer.TYPE, "_colour", "colour",
70             org.exolab.castor.xml.NodeType.Attribute);
71     handler = new org.exolab.castor.xml.XMLFieldHandler()
72     {
73       public java.lang.Object getValue(java.lang.Object object)
74               throws IllegalStateException
75       {
76         JSeq target = (JSeq) object;
77         if (!target.hasColour())
78         {
79           return null;
80         }
81         return new java.lang.Integer(target.getColour());
82       }
83
84       public void setValue(java.lang.Object object, java.lang.Object value)
85               throws IllegalStateException, IllegalArgumentException
86       {
87         try
88         {
89           JSeq target = (JSeq) object;
90           // if null, use delete method for optional primitives
91           if (value == null)
92           {
93             target.deleteColour();
94             return;
95           }
96           target.setColour(((java.lang.Integer) value).intValue());
97         } catch (java.lang.Exception ex)
98         {
99           throw new IllegalStateException(ex.toString());
100         }
101       }
102
103       public java.lang.Object newInstance(java.lang.Object parent)
104       {
105         return null;
106       }
107     };
108     desc.setHandler(handler);
109     desc.setMultivalued(false);
110     addFieldDescriptor(desc);
111
112     // -- validation code for: _colour
113     fieldValidator = new org.exolab.castor.xml.FieldValidator();
114     { // -- local scope
115       org.exolab.castor.xml.validators.IntValidator typeValidator;
116       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
117       fieldValidator.setValidator(typeValidator);
118       typeValidator.setMinInclusive(-2147483648);
119       typeValidator.setMaxInclusive(2147483647);
120     }
121     desc.setValidator(fieldValidator);
122     // -- _start
123     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
124             java.lang.Integer.TYPE, "_start", "start",
125             org.exolab.castor.xml.NodeType.Attribute);
126     handler = new org.exolab.castor.xml.XMLFieldHandler()
127     {
128       public java.lang.Object getValue(java.lang.Object object)
129               throws IllegalStateException
130       {
131         JSeq target = (JSeq) object;
132         if (!target.hasStart())
133         {
134           return null;
135         }
136         return new java.lang.Integer(target.getStart());
137       }
138
139       public void setValue(java.lang.Object object, java.lang.Object value)
140               throws IllegalStateException, IllegalArgumentException
141       {
142         try
143         {
144           JSeq target = (JSeq) object;
145           // ignore null values for non optional primitives
146           if (value == null)
147           {
148             return;
149           }
150
151           target.setStart(((java.lang.Integer) value).intValue());
152         } catch (java.lang.Exception ex)
153         {
154           throw new IllegalStateException(ex.toString());
155         }
156       }
157
158       public java.lang.Object newInstance(java.lang.Object parent)
159       {
160         return null;
161       }
162     };
163     desc.setHandler(handler);
164     desc.setRequired(true);
165     desc.setMultivalued(false);
166     addFieldDescriptor(desc);
167
168     // -- validation code for: _start
169     fieldValidator = new org.exolab.castor.xml.FieldValidator();
170     fieldValidator.setMinOccurs(1);
171     { // -- local scope
172       org.exolab.castor.xml.validators.IntValidator typeValidator;
173       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
174       fieldValidator.setValidator(typeValidator);
175       typeValidator.setMinInclusive(-2147483648);
176       typeValidator.setMaxInclusive(2147483647);
177     }
178     desc.setValidator(fieldValidator);
179     // -- _end
180     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
181             java.lang.Integer.TYPE, "_end", "end",
182             org.exolab.castor.xml.NodeType.Attribute);
183     handler = new org.exolab.castor.xml.XMLFieldHandler()
184     {
185       public java.lang.Object getValue(java.lang.Object object)
186               throws IllegalStateException
187       {
188         JSeq target = (JSeq) object;
189         if (!target.hasEnd())
190         {
191           return null;
192         }
193         return new java.lang.Integer(target.getEnd());
194       }
195
196       public void setValue(java.lang.Object object, java.lang.Object value)
197               throws IllegalStateException, IllegalArgumentException
198       {
199         try
200         {
201           JSeq target = (JSeq) object;
202           // ignore null values for non optional primitives
203           if (value == null)
204           {
205             return;
206           }
207
208           target.setEnd(((java.lang.Integer) value).intValue());
209         } catch (java.lang.Exception ex)
210         {
211           throw new IllegalStateException(ex.toString());
212         }
213       }
214
215       public java.lang.Object newInstance(java.lang.Object parent)
216       {
217         return null;
218       }
219     };
220     desc.setHandler(handler);
221     desc.setRequired(true);
222     desc.setMultivalued(false);
223     addFieldDescriptor(desc);
224
225     // -- validation code for: _end
226     fieldValidator = new org.exolab.castor.xml.FieldValidator();
227     fieldValidator.setMinOccurs(1);
228     { // -- local scope
229       org.exolab.castor.xml.validators.IntValidator typeValidator;
230       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
231       fieldValidator.setValidator(typeValidator);
232       typeValidator.setMinInclusive(-2147483648);
233       typeValidator.setMaxInclusive(2147483647);
234     }
235     desc.setValidator(fieldValidator);
236     // -- _id
237     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
238             java.lang.String.class, "_id", "id",
239             org.exolab.castor.xml.NodeType.Attribute);
240     desc.setImmutable(true);
241     handler = new org.exolab.castor.xml.XMLFieldHandler()
242     {
243       public java.lang.Object getValue(java.lang.Object object)
244               throws IllegalStateException
245       {
246         JSeq target = (JSeq) object;
247         return target.getId();
248       }
249
250       public void setValue(java.lang.Object object, java.lang.Object value)
251               throws IllegalStateException, IllegalArgumentException
252       {
253         try
254         {
255           JSeq target = (JSeq) object;
256           target.setId((java.lang.String) value);
257         } catch (java.lang.Exception ex)
258         {
259           throw new IllegalStateException(ex.toString());
260         }
261       }
262
263       public java.lang.Object newInstance(java.lang.Object parent)
264       {
265         return null;
266       }
267     };
268     desc.setHandler(handler);
269     desc.setRequired(true);
270     desc.setMultivalued(false);
271     addFieldDescriptor(desc);
272
273     // -- validation code for: _id
274     fieldValidator = new org.exolab.castor.xml.FieldValidator();
275     fieldValidator.setMinOccurs(1);
276     { // -- local scope
277       org.exolab.castor.xml.validators.StringValidator typeValidator;
278       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
279       fieldValidator.setValidator(typeValidator);
280       typeValidator.setWhiteSpace("preserve");
281     }
282     desc.setValidator(fieldValidator);
283     // -- _hidden
284     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
285             java.lang.Boolean.TYPE, "_hidden", "hidden",
286             org.exolab.castor.xml.NodeType.Attribute);
287     handler = new org.exolab.castor.xml.XMLFieldHandler()
288     {
289       public java.lang.Object getValue(java.lang.Object object)
290               throws IllegalStateException
291       {
292         JSeq target = (JSeq) object;
293         if (!target.hasHidden())
294         {
295           return null;
296         }
297         return (target.getHidden() ? java.lang.Boolean.TRUE
298                 : java.lang.Boolean.FALSE);
299       }
300
301       public void setValue(java.lang.Object object, java.lang.Object value)
302               throws IllegalStateException, IllegalArgumentException
303       {
304         try
305         {
306           JSeq target = (JSeq) object;
307           // if null, use delete method for optional primitives
308           if (value == null)
309           {
310             target.deleteHidden();
311             return;
312           }
313           target.setHidden(((java.lang.Boolean) value).booleanValue());
314         } catch (java.lang.Exception ex)
315         {
316           throw new IllegalStateException(ex.toString());
317         }
318       }
319
320       public java.lang.Object newInstance(java.lang.Object parent)
321       {
322         return null;
323       }
324     };
325     desc.setHandler(handler);
326     desc.setMultivalued(false);
327     addFieldDescriptor(desc);
328
329     // -- validation code for: _hidden
330     fieldValidator = new org.exolab.castor.xml.FieldValidator();
331     { // -- local scope
332       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
333       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
334       fieldValidator.setValidator(typeValidator);
335     }
336     desc.setValidator(fieldValidator);
337     // -- initialize element descriptors
338
339     // -- _featuresList
340     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
341             jalview.schemabinding.version2.Features.class, "_featuresList",
342             "features", org.exolab.castor.xml.NodeType.Element);
343     handler = new org.exolab.castor.xml.XMLFieldHandler()
344     {
345       public java.lang.Object getValue(java.lang.Object object)
346               throws IllegalStateException
347       {
348         JSeq target = (JSeq) object;
349         return target.getFeatures();
350       }
351
352       public void setValue(java.lang.Object object, java.lang.Object value)
353               throws IllegalStateException, IllegalArgumentException
354       {
355         try
356         {
357           JSeq target = (JSeq) object;
358           target.addFeatures((jalview.schemabinding.version2.Features) value);
359         } catch (java.lang.Exception ex)
360         {
361           throw new IllegalStateException(ex.toString());
362         }
363       }
364
365       public void resetValue(Object object) throws IllegalStateException,
366               IllegalArgumentException
367       {
368         try
369         {
370           JSeq target = (JSeq) object;
371           target.removeAllFeatures();
372         } catch (java.lang.Exception ex)
373         {
374           throw new IllegalStateException(ex.toString());
375         }
376       }
377
378       public java.lang.Object newInstance(java.lang.Object parent)
379       {
380         return new jalview.schemabinding.version2.Features();
381       }
382     };
383     desc.setHandler(handler);
384     desc.setNameSpaceURI("www.jalview.org");
385     desc.setMultivalued(true);
386     addFieldDescriptor(desc);
387
388     // -- validation code for: _featuresList
389     fieldValidator = new org.exolab.castor.xml.FieldValidator();
390     fieldValidator.setMinOccurs(0);
391     { // -- local scope
392     }
393     desc.setValidator(fieldValidator);
394     // -- _pdbidsList
395     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
396             jalview.schemabinding.version2.Pdbids.class, "_pdbidsList",
397             "pdbids", org.exolab.castor.xml.NodeType.Element);
398     handler = new org.exolab.castor.xml.XMLFieldHandler()
399     {
400       public java.lang.Object getValue(java.lang.Object object)
401               throws IllegalStateException
402       {
403         JSeq target = (JSeq) object;
404         return target.getPdbids();
405       }
406
407       public void setValue(java.lang.Object object, java.lang.Object value)
408               throws IllegalStateException, IllegalArgumentException
409       {
410         try
411         {
412           JSeq target = (JSeq) object;
413           target.addPdbids((jalview.schemabinding.version2.Pdbids) value);
414         } catch (java.lang.Exception ex)
415         {
416           throw new IllegalStateException(ex.toString());
417         }
418       }
419
420       public void resetValue(Object object) throws IllegalStateException,
421               IllegalArgumentException
422       {
423         try
424         {
425           JSeq target = (JSeq) object;
426           target.removeAllPdbids();
427         } catch (java.lang.Exception ex)
428         {
429           throw new IllegalStateException(ex.toString());
430         }
431       }
432
433       public java.lang.Object newInstance(java.lang.Object parent)
434       {
435         return new jalview.schemabinding.version2.Pdbids();
436       }
437     };
438     desc.setHandler(handler);
439     desc.setNameSpaceURI("www.jalview.org");
440     desc.setMultivalued(true);
441     addFieldDescriptor(desc);
442
443     // -- validation code for: _pdbidsList
444     fieldValidator = new org.exolab.castor.xml.FieldValidator();
445     fieldValidator.setMinOccurs(0);
446     { // -- local scope
447     }
448     desc.setValidator(fieldValidator);
449     // -- _hiddenSequencesList
450     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
451             java.lang.Integer.TYPE, "_hiddenSequencesList",
452             "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
453     handler = new org.exolab.castor.xml.XMLFieldHandler()
454     {
455       public java.lang.Object getValue(java.lang.Object object)
456               throws IllegalStateException
457       {
458         JSeq target = (JSeq) object;
459         return target.getHiddenSequences();
460       }
461
462       public void setValue(java.lang.Object object, java.lang.Object value)
463               throws IllegalStateException, IllegalArgumentException
464       {
465         try
466         {
467           JSeq target = (JSeq) object;
468           // ignore null values for non optional primitives
469           if (value == null)
470           {
471             return;
472           }
473
474           target.addHiddenSequences(((java.lang.Integer) value).intValue());
475         } catch (java.lang.Exception ex)
476         {
477           throw new IllegalStateException(ex.toString());
478         }
479       }
480
481       public void resetValue(Object object) throws IllegalStateException,
482               IllegalArgumentException
483       {
484         try
485         {
486           JSeq target = (JSeq) object;
487           target.removeAllHiddenSequences();
488         } catch (java.lang.Exception ex)
489         {
490           throw new IllegalStateException(ex.toString());
491         }
492       }
493
494       public java.lang.Object newInstance(java.lang.Object parent)
495       {
496         return null;
497       }
498     };
499     desc.setHandler(handler);
500     desc.setNameSpaceURI("www.jalview.org");
501     desc.setMultivalued(true);
502     addFieldDescriptor(desc);
503
504     // -- validation code for: _hiddenSequencesList
505     fieldValidator = new org.exolab.castor.xml.FieldValidator();
506     fieldValidator.setMinOccurs(0);
507     { // -- local scope
508       org.exolab.castor.xml.validators.IntValidator typeValidator;
509       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
510       fieldValidator.setValidator(typeValidator);
511       typeValidator.setMinInclusive(-2147483648);
512       typeValidator.setMaxInclusive(2147483647);
513     }
514     desc.setValidator(fieldValidator);
515   }
516
517   // -----------/
518   // - Methods -/
519   // -----------/
520
521   /**
522    * Method getAccessMode.
523    * 
524    * @return the access mode specified for this class.
525    */
526   public org.exolab.castor.mapping.AccessMode getAccessMode()
527   {
528     return null;
529   }
530
531   /**
532    * Method getIdentity.
533    * 
534    * @return the identity field, null if this class has no identity.
535    */
536   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
537   {
538     return super.getIdentity();
539   }
540
541   /**
542    * Method getJavaClass.
543    * 
544    * @return the Java class represented by this descriptor.
545    */
546   public java.lang.Class getJavaClass()
547   {
548     return jalview.schemabinding.version2.JSeq.class;
549   }
550
551   /**
552    * Method getNameSpacePrefix.
553    * 
554    * @return the namespace prefix to use when marshaling as XML.
555    */
556   public java.lang.String getNameSpacePrefix()
557   {
558     return _nsPrefix;
559   }
560
561   /**
562    * Method getNameSpaceURI.
563    * 
564    * @return the namespace URI used when marshaling and unmarshaling as XML.
565    */
566   public java.lang.String getNameSpaceURI()
567   {
568     return _nsURI;
569   }
570
571   /**
572    * Method getValidator.
573    * 
574    * @return a specific validator for the class described by this
575    *         ClassDescriptor.
576    */
577   public org.exolab.castor.xml.TypeValidator getValidator()
578   {
579     return this;
580   }
581
582   /**
583    * Method getXMLName.
584    * 
585    * @return the XML Name for the Class being described.
586    */
587   public java.lang.String getXMLName()
588   {
589     return _xmlName;
590   }
591
592   /**
593    * Method isElementDefinition.
594    * 
595    * @return true if XML schema definition of this Class is that of a global
596    *         element or element with anonymous type definition.
597    */
598   public boolean isElementDefinition()
599   {
600     return _elementDefinition;
601   }
602
603 }