JAL-3120 preserve feature colour/mincolour/maxcolour while modifying,
[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     // -- _viewreference
338     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
339             java.lang.Boolean.TYPE, "_viewreference", "viewreference",
340             org.exolab.castor.xml.NodeType.Attribute);
341     handler = new org.exolab.castor.xml.XMLFieldHandler()
342     {
343       public java.lang.Object getValue(java.lang.Object object)
344               throws IllegalStateException
345       {
346         JSeq target = (JSeq) object;
347         if (!target.hasViewreference())
348         {
349           return null;
350         }
351         return (target.getViewreference() ? java.lang.Boolean.TRUE
352                 : java.lang.Boolean.FALSE);
353       }
354
355       public void setValue(java.lang.Object object, java.lang.Object value)
356               throws IllegalStateException, IllegalArgumentException
357       {
358         try
359         {
360           JSeq target = (JSeq) object;
361           // if null, use delete method for optional primitives
362           if (value == null)
363           {
364             target.deleteViewreference();
365             return;
366           }
367           target.setViewreference(((java.lang.Boolean) value)
368                   .booleanValue());
369         } catch (java.lang.Exception ex)
370         {
371           throw new IllegalStateException(ex.toString());
372         }
373       }
374
375       public java.lang.Object newInstance(java.lang.Object parent)
376       {
377         return null;
378       }
379     };
380     desc.setHandler(handler);
381     desc.setMultivalued(false);
382     addFieldDescriptor(desc);
383
384     // -- validation code for: _viewreference
385     fieldValidator = new org.exolab.castor.xml.FieldValidator();
386     { // -- local scope
387       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
388       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
389       fieldValidator.setValidator(typeValidator);
390     }
391     desc.setValidator(fieldValidator);
392     // -- initialize element descriptors
393
394     // -- _featuresList
395     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
396             jalview.schemabinding.version2.Features.class, "_featuresList",
397             "features", 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.getFeatures();
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.addFeatures((jalview.schemabinding.version2.Features) 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.removeAllFeatures();
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.Features();
436       }
437     };
438     desc.setHandler(handler);
439     desc.setNameSpaceURI("www.jalview.org");
440     desc.setMultivalued(true);
441     addFieldDescriptor(desc);
442
443     // -- validation code for: _featuresList
444     fieldValidator = new org.exolab.castor.xml.FieldValidator();
445     fieldValidator.setMinOccurs(0);
446     { // -- local scope
447     }
448     desc.setValidator(fieldValidator);
449     // -- _pdbidsList
450     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
451             jalview.schemabinding.version2.Pdbids.class, "_pdbidsList",
452             "pdbids", 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.getPdbids();
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           target.addPdbids((jalview.schemabinding.version2.Pdbids) value);
469         } catch (java.lang.Exception ex)
470         {
471           throw new IllegalStateException(ex.toString());
472         }
473       }
474
475       public void resetValue(Object object) throws IllegalStateException,
476               IllegalArgumentException
477       {
478         try
479         {
480           JSeq target = (JSeq) object;
481           target.removeAllPdbids();
482         } catch (java.lang.Exception ex)
483         {
484           throw new IllegalStateException(ex.toString());
485         }
486       }
487
488       public java.lang.Object newInstance(java.lang.Object parent)
489       {
490         return new jalview.schemabinding.version2.Pdbids();
491       }
492     };
493     desc.setHandler(handler);
494     desc.setNameSpaceURI("www.jalview.org");
495     desc.setMultivalued(true);
496     addFieldDescriptor(desc);
497
498     // -- validation code for: _pdbidsList
499     fieldValidator = new org.exolab.castor.xml.FieldValidator();
500     fieldValidator.setMinOccurs(0);
501     { // -- local scope
502     }
503     desc.setValidator(fieldValidator);
504     // -- _hiddenSequencesList
505     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
506             java.lang.Integer.TYPE, "_hiddenSequencesList",
507             "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
508     handler = new org.exolab.castor.xml.XMLFieldHandler()
509     {
510       public java.lang.Object getValue(java.lang.Object object)
511               throws IllegalStateException
512       {
513         JSeq target = (JSeq) object;
514         return target.getHiddenSequences();
515       }
516
517       public void setValue(java.lang.Object object, java.lang.Object value)
518               throws IllegalStateException, IllegalArgumentException
519       {
520         try
521         {
522           JSeq target = (JSeq) object;
523           // ignore null values for non optional primitives
524           if (value == null)
525           {
526             return;
527           }
528
529           target.addHiddenSequences(((java.lang.Integer) value).intValue());
530         } catch (java.lang.Exception ex)
531         {
532           throw new IllegalStateException(ex.toString());
533         }
534       }
535
536       public void resetValue(Object object) throws IllegalStateException,
537               IllegalArgumentException
538       {
539         try
540         {
541           JSeq target = (JSeq) object;
542           target.removeAllHiddenSequences();
543         } catch (java.lang.Exception ex)
544         {
545           throw new IllegalStateException(ex.toString());
546         }
547       }
548
549       public java.lang.Object newInstance(java.lang.Object parent)
550       {
551         return null;
552       }
553     };
554     desc.setHandler(handler);
555     desc.setNameSpaceURI("www.jalview.org");
556     desc.setMultivalued(true);
557     addFieldDescriptor(desc);
558
559     // -- validation code for: _hiddenSequencesList
560     fieldValidator = new org.exolab.castor.xml.FieldValidator();
561     fieldValidator.setMinOccurs(0);
562     { // -- local scope
563       org.exolab.castor.xml.validators.IntValidator typeValidator;
564       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
565       fieldValidator.setValidator(typeValidator);
566       typeValidator.setMinInclusive(-2147483648);
567       typeValidator.setMaxInclusive(2147483647);
568     }
569     desc.setValidator(fieldValidator);
570     // -- _rnaViewerList
571     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
572             jalview.schemabinding.version2.RnaViewer.class,
573             "_rnaViewerList", "rnaViewer",
574             org.exolab.castor.xml.NodeType.Element);
575     handler = new org.exolab.castor.xml.XMLFieldHandler()
576     {
577       public java.lang.Object getValue(java.lang.Object object)
578               throws IllegalStateException
579       {
580         JSeq target = (JSeq) object;
581         return target.getRnaViewer();
582       }
583
584       public void setValue(java.lang.Object object, java.lang.Object value)
585               throws IllegalStateException, IllegalArgumentException
586       {
587         try
588         {
589           JSeq target = (JSeq) object;
590           target.addRnaViewer((jalview.schemabinding.version2.RnaViewer) value);
591         } catch (java.lang.Exception ex)
592         {
593           throw new IllegalStateException(ex.toString());
594         }
595       }
596
597       public void resetValue(Object object) throws IllegalStateException,
598               IllegalArgumentException
599       {
600         try
601         {
602           JSeq target = (JSeq) object;
603           target.removeAllRnaViewer();
604         } catch (java.lang.Exception ex)
605         {
606           throw new IllegalStateException(ex.toString());
607         }
608       }
609
610       public java.lang.Object newInstance(java.lang.Object parent)
611       {
612         return new jalview.schemabinding.version2.RnaViewer();
613       }
614     };
615     desc.setHandler(handler);
616     desc.setNameSpaceURI("www.jalview.org");
617     desc.setMultivalued(true);
618     addFieldDescriptor(desc);
619
620     // -- validation code for: _rnaViewerList
621     fieldValidator = new org.exolab.castor.xml.FieldValidator();
622     fieldValidator.setMinOccurs(0);
623     { // -- local scope
624     }
625     desc.setValidator(fieldValidator);
626   }
627
628   // -----------/
629   // - Methods -/
630   // -----------/
631
632   /**
633    * Method getAccessMode.
634    * 
635    * @return the access mode specified for this class.
636    */
637   public org.exolab.castor.mapping.AccessMode getAccessMode()
638   {
639     return null;
640   }
641
642   /**
643    * Method getIdentity.
644    * 
645    * @return the identity field, null if this class has no identity.
646    */
647   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
648   {
649     return super.getIdentity();
650   }
651
652   /**
653    * Method getJavaClass.
654    * 
655    * @return the Java class represented by this descriptor.
656    */
657   public java.lang.Class getJavaClass()
658   {
659     return jalview.schemabinding.version2.JSeq.class;
660   }
661
662   /**
663    * Method getNameSpacePrefix.
664    * 
665    * @return the namespace prefix to use when marshaling as XML.
666    */
667   public java.lang.String getNameSpacePrefix()
668   {
669     return _nsPrefix;
670   }
671
672   /**
673    * Method getNameSpaceURI.
674    * 
675    * @return the namespace URI used when marshaling and unmarshaling as XML.
676    */
677   public java.lang.String getNameSpaceURI()
678   {
679     return _nsURI;
680   }
681
682   /**
683    * Method getValidator.
684    * 
685    * @return a specific validator for the class described by this
686    *         ClassDescriptor.
687    */
688   public org.exolab.castor.xml.TypeValidator getValidator()
689   {
690     return this;
691   }
692
693   /**
694    * Method getXMLName.
695    * 
696    * @return the XML Name for the Class being described.
697    */
698   public java.lang.String getXMLName()
699   {
700     return _xmlName;
701   }
702
703   /**
704    * Method isElementDefinition.
705    * 
706    * @return true if XML schema definition of this Class is that of a global
707    *         element or element with anonymous type definition.
708    */
709   public boolean isElementDefinition()
710   {
711     return _elementDefinition;
712   }
713
714 }