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