9d82b98d9e4533ad2829c1cd0e8762259316b742
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / StructureStateDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  
17  * If not, see <http://www.gnu.org/licenses/>.
18  * The Jalview Authors are detailed in the 'AUTHORS' file.
19  ******************************************************************************/
20 /*
21  * This class was automatically generated with 
22  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
23  * Schema.
24  * $Id$
25  */
26
27 package jalview.schemabinding.version2.descriptors;
28
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
32
33 import jalview.schemabinding.version2.StructureState;
34
35 /**
36  * Class StructureStateDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class StructureStateDescriptor extends
41         org.exolab.castor.xml.util.XMLClassDescriptorImpl
42 {
43
44   // --------------------------/
45   // - Class/Member Variables -/
46   // --------------------------/
47
48   /**
49    * Field _elementDefinition.
50    */
51   private boolean _elementDefinition;
52
53   /**
54    * Field _nsPrefix.
55    */
56   private java.lang.String _nsPrefix;
57
58   /**
59    * Field _nsURI.
60    */
61   private java.lang.String _nsURI;
62
63   /**
64    * Field _xmlName.
65    */
66   private java.lang.String _xmlName;
67
68   // ----------------/
69   // - Constructors -/
70   // ----------------/
71
72   public StructureStateDescriptor()
73   {
74     super();
75     _nsURI = "www.jalview.org";
76     _xmlName = "structureState";
77     _elementDefinition = true;
78     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
79     org.exolab.castor.mapping.FieldHandler handler = null;
80     org.exolab.castor.xml.FieldValidator fieldValidator = null;
81     // -- _content
82     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
83             java.lang.String.class, "_content", "PCDATA",
84             org.exolab.castor.xml.NodeType.Text);
85     desc.setImmutable(true);
86     handler = new org.exolab.castor.xml.XMLFieldHandler()
87     {
88       public java.lang.Object getValue(java.lang.Object object)
89               throws IllegalStateException
90       {
91         StructureState target = (StructureState) object;
92         return target.getContent();
93       }
94
95       public void setValue(java.lang.Object object, java.lang.Object value)
96               throws IllegalStateException, IllegalArgumentException
97       {
98         try
99         {
100           StructureState target = (StructureState) object;
101           target.setContent((java.lang.String) value);
102         } catch (java.lang.Exception ex)
103         {
104           throw new IllegalStateException(ex.toString());
105         }
106       }
107
108       public java.lang.Object newInstance(java.lang.Object parent)
109       {
110         return null;
111       }
112     };
113     desc.setHandler(handler);
114     addFieldDescriptor(desc);
115
116     // -- validation code for: _content
117     fieldValidator = new org.exolab.castor.xml.FieldValidator();
118     { // -- local scope
119       org.exolab.castor.xml.validators.StringValidator typeValidator;
120       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
121       fieldValidator.setValidator(typeValidator);
122       typeValidator.setWhiteSpace("preserve");
123     }
124     desc.setValidator(fieldValidator);
125     // -- initialize attribute descriptors
126
127     // -- _visible
128     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
129             java.lang.Boolean.TYPE, "_visible", "visible",
130             org.exolab.castor.xml.NodeType.Attribute);
131     handler = new org.exolab.castor.xml.XMLFieldHandler()
132     {
133       public java.lang.Object getValue(java.lang.Object object)
134               throws IllegalStateException
135       {
136         StructureState target = (StructureState) object;
137         if (!target.hasVisible())
138         {
139           return null;
140         }
141         return (target.getVisible() ? java.lang.Boolean.TRUE
142                 : java.lang.Boolean.FALSE);
143       }
144
145       public void setValue(java.lang.Object object, java.lang.Object value)
146               throws IllegalStateException, IllegalArgumentException
147       {
148         try
149         {
150           StructureState target = (StructureState) object;
151           // if null, use delete method for optional primitives
152           if (value == null)
153           {
154             target.deleteVisible();
155             return;
156           }
157           target.setVisible(((java.lang.Boolean) value).booleanValue());
158         } catch (java.lang.Exception ex)
159         {
160           throw new IllegalStateException(ex.toString());
161         }
162       }
163
164       public java.lang.Object newInstance(java.lang.Object parent)
165       {
166         return null;
167       }
168     };
169     desc.setHandler(handler);
170     desc.setMultivalued(false);
171     addFieldDescriptor(desc);
172
173     // -- validation code for: _visible
174     fieldValidator = new org.exolab.castor.xml.FieldValidator();
175     { // -- local scope
176       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
177       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
178       fieldValidator.setValidator(typeValidator);
179     }
180     desc.setValidator(fieldValidator);
181     // -- _viewId
182     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
183             java.lang.String.class, "_viewId", "viewId",
184             org.exolab.castor.xml.NodeType.Attribute);
185     desc.setImmutable(true);
186     handler = new org.exolab.castor.xml.XMLFieldHandler()
187     {
188       public java.lang.Object getValue(java.lang.Object object)
189               throws IllegalStateException
190       {
191         StructureState target = (StructureState) object;
192         return target.getViewId();
193       }
194
195       public void setValue(java.lang.Object object, java.lang.Object value)
196               throws IllegalStateException, IllegalArgumentException
197       {
198         try
199         {
200           StructureState target = (StructureState) object;
201           target.setViewId((java.lang.String) value);
202         } catch (java.lang.Exception ex)
203         {
204           throw new IllegalStateException(ex.toString());
205         }
206       }
207
208       public java.lang.Object newInstance(java.lang.Object parent)
209       {
210         return null;
211       }
212     };
213     desc.setHandler(handler);
214     desc.setMultivalued(false);
215     addFieldDescriptor(desc);
216
217     // -- validation code for: _viewId
218     fieldValidator = new org.exolab.castor.xml.FieldValidator();
219     { // -- local scope
220       org.exolab.castor.xml.validators.StringValidator typeValidator;
221       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
222       fieldValidator.setValidator(typeValidator);
223       typeValidator.setWhiteSpace("preserve");
224     }
225     desc.setValidator(fieldValidator);
226     // -- _alignwithAlignPanel
227     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
228             java.lang.Boolean.TYPE, "_alignwithAlignPanel",
229             "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
230     handler = new org.exolab.castor.xml.XMLFieldHandler()
231     {
232       public java.lang.Object getValue(java.lang.Object object)
233               throws IllegalStateException
234       {
235         StructureState target = (StructureState) object;
236         if (!target.hasAlignwithAlignPanel())
237         {
238           return null;
239         }
240         return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE
241                 : java.lang.Boolean.FALSE);
242       }
243
244       public void setValue(java.lang.Object object, java.lang.Object value)
245               throws IllegalStateException, IllegalArgumentException
246       {
247         try
248         {
249           StructureState target = (StructureState) object;
250           // if null, use delete method for optional primitives
251           if (value == null)
252           {
253             target.deleteAlignwithAlignPanel();
254             return;
255           }
256           target.setAlignwithAlignPanel(((java.lang.Boolean) value)
257                   .booleanValue());
258         } catch (java.lang.Exception ex)
259         {
260           throw new IllegalStateException(ex.toString());
261         }
262       }
263
264       public java.lang.Object newInstance(java.lang.Object parent)
265       {
266         return null;
267       }
268     };
269     desc.setHandler(handler);
270     desc.setMultivalued(false);
271     addFieldDescriptor(desc);
272
273     // -- validation code for: _alignwithAlignPanel
274     fieldValidator = new org.exolab.castor.xml.FieldValidator();
275     { // -- local scope
276       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
277       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
278       fieldValidator.setValidator(typeValidator);
279     }
280     desc.setValidator(fieldValidator);
281     // -- _colourwithAlignPanel
282     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
283             java.lang.Boolean.TYPE, "_colourwithAlignPanel",
284             "colourwithAlignPanel",
285             org.exolab.castor.xml.NodeType.Attribute);
286     handler = new org.exolab.castor.xml.XMLFieldHandler()
287     {
288       public java.lang.Object getValue(java.lang.Object object)
289               throws IllegalStateException
290       {
291         StructureState target = (StructureState) object;
292         if (!target.hasColourwithAlignPanel())
293         {
294           return null;
295         }
296         return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE
297                 : java.lang.Boolean.FALSE);
298       }
299
300       public void setValue(java.lang.Object object, java.lang.Object value)
301               throws IllegalStateException, IllegalArgumentException
302       {
303         try
304         {
305           StructureState target = (StructureState) object;
306           // if null, use delete method for optional primitives
307           if (value == null)
308           {
309             target.deleteColourwithAlignPanel();
310             return;
311           }
312           target.setColourwithAlignPanel(((java.lang.Boolean) value)
313                   .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: _colourwithAlignPanel
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     // -- _colourByJmol
338     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
339             java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol",
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         StructureState target = (StructureState) object;
347         if (!target.hasColourByJmol())
348         {
349           return null;
350         }
351         return (target.getColourByJmol() ? 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           StructureState target = (StructureState) object;
361           // if null, use delete method for optional primitives
362           if (value == null)
363           {
364             target.deleteColourByJmol();
365             return;
366           }
367           target.setColourByJmol(((java.lang.Boolean) value).booleanValue());
368         } catch (java.lang.Exception ex)
369         {
370           throw new IllegalStateException(ex.toString());
371         }
372       }
373
374       public java.lang.Object newInstance(java.lang.Object parent)
375       {
376         return null;
377       }
378     };
379     desc.setHandler(handler);
380     desc.setMultivalued(false);
381     addFieldDescriptor(desc);
382
383     // -- validation code for: _colourByJmol
384     fieldValidator = new org.exolab.castor.xml.FieldValidator();
385     { // -- local scope
386       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
387       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
388       fieldValidator.setValidator(typeValidator);
389     }
390     desc.setValidator(fieldValidator);
391     // -- _width
392     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
393             java.lang.Integer.TYPE, "_width", "width",
394             org.exolab.castor.xml.NodeType.Attribute);
395     handler = new org.exolab.castor.xml.XMLFieldHandler()
396     {
397       public java.lang.Object getValue(java.lang.Object object)
398               throws IllegalStateException
399       {
400         StructureState target = (StructureState) object;
401         if (!target.hasWidth())
402         {
403           return null;
404         }
405         return new java.lang.Integer(target.getWidth());
406       }
407
408       public void setValue(java.lang.Object object, java.lang.Object value)
409               throws IllegalStateException, IllegalArgumentException
410       {
411         try
412         {
413           StructureState target = (StructureState) object;
414           // if null, use delete method for optional primitives
415           if (value == null)
416           {
417             target.deleteWidth();
418             return;
419           }
420           target.setWidth(((java.lang.Integer) value).intValue());
421         } catch (java.lang.Exception ex)
422         {
423           throw new IllegalStateException(ex.toString());
424         }
425       }
426
427       public java.lang.Object newInstance(java.lang.Object parent)
428       {
429         return null;
430       }
431     };
432     desc.setHandler(handler);
433     desc.setMultivalued(false);
434     addFieldDescriptor(desc);
435
436     // -- validation code for: _width
437     fieldValidator = new org.exolab.castor.xml.FieldValidator();
438     { // -- local scope
439       org.exolab.castor.xml.validators.IntValidator typeValidator;
440       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
441       fieldValidator.setValidator(typeValidator);
442       typeValidator.setMinInclusive(-2147483648);
443       typeValidator.setMaxInclusive(2147483647);
444     }
445     desc.setValidator(fieldValidator);
446     // -- _height
447     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
448             java.lang.Integer.TYPE, "_height", "height",
449             org.exolab.castor.xml.NodeType.Attribute);
450     handler = new org.exolab.castor.xml.XMLFieldHandler()
451     {
452       public java.lang.Object getValue(java.lang.Object object)
453               throws IllegalStateException
454       {
455         StructureState target = (StructureState) object;
456         if (!target.hasHeight())
457         {
458           return null;
459         }
460         return new java.lang.Integer(target.getHeight());
461       }
462
463       public void setValue(java.lang.Object object, java.lang.Object value)
464               throws IllegalStateException, IllegalArgumentException
465       {
466         try
467         {
468           StructureState target = (StructureState) object;
469           // if null, use delete method for optional primitives
470           if (value == null)
471           {
472             target.deleteHeight();
473             return;
474           }
475           target.setHeight(((java.lang.Integer) value).intValue());
476         } catch (java.lang.Exception ex)
477         {
478           throw new IllegalStateException(ex.toString());
479         }
480       }
481
482       public java.lang.Object newInstance(java.lang.Object parent)
483       {
484         return null;
485       }
486     };
487     desc.setHandler(handler);
488     desc.setMultivalued(false);
489     addFieldDescriptor(desc);
490
491     // -- validation code for: _height
492     fieldValidator = new org.exolab.castor.xml.FieldValidator();
493     { // -- local scope
494       org.exolab.castor.xml.validators.IntValidator typeValidator;
495       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
496       fieldValidator.setValidator(typeValidator);
497       typeValidator.setMinInclusive(-2147483648);
498       typeValidator.setMaxInclusive(2147483647);
499     }
500     desc.setValidator(fieldValidator);
501     // -- _xpos
502     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
503             java.lang.Integer.TYPE, "_xpos", "xpos",
504             org.exolab.castor.xml.NodeType.Attribute);
505     handler = new org.exolab.castor.xml.XMLFieldHandler()
506     {
507       public java.lang.Object getValue(java.lang.Object object)
508               throws IllegalStateException
509       {
510         StructureState target = (StructureState) object;
511         if (!target.hasXpos())
512         {
513           return null;
514         }
515         return new java.lang.Integer(target.getXpos());
516       }
517
518       public void setValue(java.lang.Object object, java.lang.Object value)
519               throws IllegalStateException, IllegalArgumentException
520       {
521         try
522         {
523           StructureState target = (StructureState) object;
524           // if null, use delete method for optional primitives
525           if (value == null)
526           {
527             target.deleteXpos();
528             return;
529           }
530           target.setXpos(((java.lang.Integer) value).intValue());
531         } catch (java.lang.Exception ex)
532         {
533           throw new IllegalStateException(ex.toString());
534         }
535       }
536
537       public java.lang.Object newInstance(java.lang.Object parent)
538       {
539         return null;
540       }
541     };
542     desc.setHandler(handler);
543     desc.setMultivalued(false);
544     addFieldDescriptor(desc);
545
546     // -- validation code for: _xpos
547     fieldValidator = new org.exolab.castor.xml.FieldValidator();
548     { // -- local scope
549       org.exolab.castor.xml.validators.IntValidator typeValidator;
550       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
551       fieldValidator.setValidator(typeValidator);
552       typeValidator.setMinInclusive(-2147483648);
553       typeValidator.setMaxInclusive(2147483647);
554     }
555     desc.setValidator(fieldValidator);
556     // -- _ypos
557     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
558             java.lang.Integer.TYPE, "_ypos", "ypos",
559             org.exolab.castor.xml.NodeType.Attribute);
560     handler = new org.exolab.castor.xml.XMLFieldHandler()
561     {
562       public java.lang.Object getValue(java.lang.Object object)
563               throws IllegalStateException
564       {
565         StructureState target = (StructureState) object;
566         if (!target.hasYpos())
567         {
568           return null;
569         }
570         return new java.lang.Integer(target.getYpos());
571       }
572
573       public void setValue(java.lang.Object object, java.lang.Object value)
574               throws IllegalStateException, IllegalArgumentException
575       {
576         try
577         {
578           StructureState target = (StructureState) object;
579           // if null, use delete method for optional primitives
580           if (value == null)
581           {
582             target.deleteYpos();
583             return;
584           }
585           target.setYpos(((java.lang.Integer) value).intValue());
586         } catch (java.lang.Exception ex)
587         {
588           throw new IllegalStateException(ex.toString());
589         }
590       }
591
592       public java.lang.Object newInstance(java.lang.Object parent)
593       {
594         return null;
595       }
596     };
597     desc.setHandler(handler);
598     desc.setMultivalued(false);
599     addFieldDescriptor(desc);
600
601     // -- validation code for: _ypos
602     fieldValidator = new org.exolab.castor.xml.FieldValidator();
603     { // -- local scope
604       org.exolab.castor.xml.validators.IntValidator typeValidator;
605       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
606       fieldValidator.setValidator(typeValidator);
607       typeValidator.setMinInclusive(-2147483648);
608       typeValidator.setMaxInclusive(2147483647);
609     }
610     desc.setValidator(fieldValidator);
611     // -- initialize element descriptors
612
613   }
614
615   // -----------/
616   // - Methods -/
617   // -----------/
618
619   /**
620    * Method getAccessMode.
621    * 
622    * @return the access mode specified for this class.
623    */
624   public org.exolab.castor.mapping.AccessMode getAccessMode()
625   {
626     return null;
627   }
628
629   /**
630    * Method getIdentity.
631    * 
632    * @return the identity field, null if this class has no identity.
633    */
634   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
635   {
636     return super.getIdentity();
637   }
638
639   /**
640    * Method getJavaClass.
641    * 
642    * @return the Java class represented by this descriptor.
643    */
644   public java.lang.Class getJavaClass()
645   {
646     return jalview.schemabinding.version2.StructureState.class;
647   }
648
649   /**
650    * Method getNameSpacePrefix.
651    * 
652    * @return the namespace prefix to use when marshaling as XML.
653    */
654   public java.lang.String getNameSpacePrefix()
655   {
656     return _nsPrefix;
657   }
658
659   /**
660    * Method getNameSpaceURI.
661    * 
662    * @return the namespace URI used when marshaling and unmarshaling as XML.
663    */
664   public java.lang.String getNameSpaceURI()
665   {
666     return _nsURI;
667   }
668
669   /**
670    * Method getValidator.
671    * 
672    * @return a specific validator for the class described by this
673    *         ClassDescriptor.
674    */
675   public org.exolab.castor.xml.TypeValidator getValidator()
676   {
677     return this;
678   }
679
680   /**
681    * Method getXMLName.
682    * 
683    * @return the XML Name for the Class being described.
684    */
685   public java.lang.String getXMLName()
686   {
687     return _xmlName;
688   }
689
690   /**
691    * Method isElementDefinition.
692    * 
693    * @return true if XML schema definition of this Class is that of a global
694    *         element or element with anonymous type definition.
695    */
696   public boolean isElementDefinition()
697   {
698     return _elementDefinition;
699   }
700
701 }