update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / StructureStateDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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.  If not, see <http://www.gnu.org/licenses/>.
17  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2.descriptors;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import jalview.schemabinding.version2.StructureState;
32
33 /**
34  * Class StructureStateDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class StructureStateDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
39
40
41       //--------------------------/
42      //- Class/Member Variables -/
43     //--------------------------/
44
45     /**
46      * Field _elementDefinition.
47      */
48     private boolean _elementDefinition;
49
50     /**
51      * Field _nsPrefix.
52      */
53     private java.lang.String _nsPrefix;
54
55     /**
56      * Field _nsURI.
57      */
58     private java.lang.String _nsURI;
59
60     /**
61      * Field _xmlName.
62      */
63     private java.lang.String _xmlName;
64
65
66       //----------------/
67      //- Constructors -/
68     //----------------/
69
70     public StructureStateDescriptor() {
71         super();
72         _nsURI = "www.jalview.org";
73         _xmlName = "structureState";
74         _elementDefinition = true;
75         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
76         org.exolab.castor.mapping.FieldHandler             handler        = null;
77         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
78         //-- _content
79         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
80         desc.setImmutable(true);
81         handler = new org.exolab.castor.xml.XMLFieldHandler() {
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             public void setValue( java.lang.Object object, java.lang.Object value) 
89                 throws IllegalStateException, IllegalArgumentException
90             {
91                 try {
92                     StructureState target = (StructureState) object;
93                     target.setContent( (java.lang.String) value);
94                 } catch (java.lang.Exception ex) {
95                     throw new IllegalStateException(ex.toString());
96                 }
97             }
98             public java.lang.Object newInstance(java.lang.Object parent) {
99                 return null;
100             }
101         };
102         desc.setHandler(handler);
103         addFieldDescriptor(desc);
104         
105         //-- validation code for: _content
106         fieldValidator = new org.exolab.castor.xml.FieldValidator();
107         { //-- local scope
108             org.exolab.castor.xml.validators.StringValidator typeValidator;
109             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
110             fieldValidator.setValidator(typeValidator);
111             typeValidator.setWhiteSpace("preserve");
112         }
113         desc.setValidator(fieldValidator);
114         //-- initialize attribute descriptors
115         
116         //-- _visible
117         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "visible", org.exolab.castor.xml.NodeType.Attribute);
118         handler = new org.exolab.castor.xml.XMLFieldHandler() {
119             public java.lang.Object getValue( java.lang.Object object ) 
120                 throws IllegalStateException
121             {
122                 StructureState target = (StructureState) object;
123                 if (!target.hasVisible()) { return null; }
124                 return (target.getVisible() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
125             }
126             public void setValue( java.lang.Object object, java.lang.Object value) 
127                 throws IllegalStateException, IllegalArgumentException
128             {
129                 try {
130                     StructureState target = (StructureState) object;
131                     // if null, use delete method for optional primitives 
132                     if (value == null) {
133                         target.deleteVisible();
134                         return;
135                     }
136                     target.setVisible( ((java.lang.Boolean) value).booleanValue());
137                 } catch (java.lang.Exception ex) {
138                     throw new IllegalStateException(ex.toString());
139                 }
140             }
141             public java.lang.Object newInstance(java.lang.Object parent) {
142                 return null;
143             }
144         };
145         desc.setHandler(handler);
146         desc.setMultivalued(false);
147         addFieldDescriptor(desc);
148         
149         //-- validation code for: _visible
150         fieldValidator = new org.exolab.castor.xml.FieldValidator();
151         { //-- local scope
152             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
153             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
154             fieldValidator.setValidator(typeValidator);
155         }
156         desc.setValidator(fieldValidator);
157         //-- _viewId
158         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewId", "viewId", org.exolab.castor.xml.NodeType.Attribute);
159         desc.setImmutable(true);
160         handler = new org.exolab.castor.xml.XMLFieldHandler() {
161             public java.lang.Object getValue( java.lang.Object object ) 
162                 throws IllegalStateException
163             {
164                 StructureState target = (StructureState) object;
165                 return target.getViewId();
166             }
167             public void setValue( java.lang.Object object, java.lang.Object value) 
168                 throws IllegalStateException, IllegalArgumentException
169             {
170                 try {
171                     StructureState target = (StructureState) object;
172                     target.setViewId( (java.lang.String) value);
173                 } catch (java.lang.Exception ex) {
174                     throw new IllegalStateException(ex.toString());
175                 }
176             }
177             public java.lang.Object newInstance(java.lang.Object parent) {
178                 return null;
179             }
180         };
181         desc.setHandler(handler);
182         desc.setMultivalued(false);
183         addFieldDescriptor(desc);
184         
185         //-- validation code for: _viewId
186         fieldValidator = new org.exolab.castor.xml.FieldValidator();
187         { //-- local scope
188             org.exolab.castor.xml.validators.StringValidator typeValidator;
189             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
190             fieldValidator.setValidator(typeValidator);
191             typeValidator.setWhiteSpace("preserve");
192         }
193         desc.setValidator(fieldValidator);
194         //-- _alignwithAlignPanel
195         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_alignwithAlignPanel", "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
196         handler = new org.exolab.castor.xml.XMLFieldHandler() {
197             public java.lang.Object getValue( java.lang.Object object ) 
198                 throws IllegalStateException
199             {
200                 StructureState target = (StructureState) object;
201                 if (!target.hasAlignwithAlignPanel()) { return null; }
202                 return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
203             }
204             public void setValue( java.lang.Object object, java.lang.Object value) 
205                 throws IllegalStateException, IllegalArgumentException
206             {
207                 try {
208                     StructureState target = (StructureState) object;
209                     // if null, use delete method for optional primitives 
210                     if (value == null) {
211                         target.deleteAlignwithAlignPanel();
212                         return;
213                     }
214                     target.setAlignwithAlignPanel( ((java.lang.Boolean) value).booleanValue());
215                 } catch (java.lang.Exception ex) {
216                     throw new IllegalStateException(ex.toString());
217                 }
218             }
219             public java.lang.Object newInstance(java.lang.Object parent) {
220                 return null;
221             }
222         };
223         desc.setHandler(handler);
224         desc.setMultivalued(false);
225         addFieldDescriptor(desc);
226         
227         //-- validation code for: _alignwithAlignPanel
228         fieldValidator = new org.exolab.castor.xml.FieldValidator();
229         { //-- local scope
230             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
231             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
232             fieldValidator.setValidator(typeValidator);
233         }
234         desc.setValidator(fieldValidator);
235         //-- _colourwithAlignPanel
236         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourwithAlignPanel", "colourwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
237         handler = new org.exolab.castor.xml.XMLFieldHandler() {
238             public java.lang.Object getValue( java.lang.Object object ) 
239                 throws IllegalStateException
240             {
241                 StructureState target = (StructureState) object;
242                 if (!target.hasColourwithAlignPanel()) { return null; }
243                 return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
244             }
245             public void setValue( java.lang.Object object, java.lang.Object value) 
246                 throws IllegalStateException, IllegalArgumentException
247             {
248                 try {
249                     StructureState target = (StructureState) object;
250                     // if null, use delete method for optional primitives 
251                     if (value == null) {
252                         target.deleteColourwithAlignPanel();
253                         return;
254                     }
255                     target.setColourwithAlignPanel( ((java.lang.Boolean) value).booleanValue());
256                 } catch (java.lang.Exception ex) {
257                     throw new IllegalStateException(ex.toString());
258                 }
259             }
260             public java.lang.Object newInstance(java.lang.Object parent) {
261                 return null;
262             }
263         };
264         desc.setHandler(handler);
265         desc.setMultivalued(false);
266         addFieldDescriptor(desc);
267         
268         //-- validation code for: _colourwithAlignPanel
269         fieldValidator = new org.exolab.castor.xml.FieldValidator();
270         { //-- local scope
271             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
272             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
273             fieldValidator.setValidator(typeValidator);
274         }
275         desc.setValidator(fieldValidator);
276         //-- _colourByJmol
277         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol", org.exolab.castor.xml.NodeType.Attribute);
278         handler = new org.exolab.castor.xml.XMLFieldHandler() {
279             public java.lang.Object getValue( java.lang.Object object ) 
280                 throws IllegalStateException
281             {
282                 StructureState target = (StructureState) object;
283                 if (!target.hasColourByJmol()) { return null; }
284                 return (target.getColourByJmol() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
285             }
286             public void setValue( java.lang.Object object, java.lang.Object value) 
287                 throws IllegalStateException, IllegalArgumentException
288             {
289                 try {
290                     StructureState target = (StructureState) object;
291                     // if null, use delete method for optional primitives 
292                     if (value == null) {
293                         target.deleteColourByJmol();
294                         return;
295                     }
296                     target.setColourByJmol( ((java.lang.Boolean) value).booleanValue());
297                 } catch (java.lang.Exception ex) {
298                     throw new IllegalStateException(ex.toString());
299                 }
300             }
301             public java.lang.Object newInstance(java.lang.Object parent) {
302                 return null;
303             }
304         };
305         desc.setHandler(handler);
306         desc.setMultivalued(false);
307         addFieldDescriptor(desc);
308         
309         //-- validation code for: _colourByJmol
310         fieldValidator = new org.exolab.castor.xml.FieldValidator();
311         { //-- local scope
312             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
313             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
314             fieldValidator.setValidator(typeValidator);
315         }
316         desc.setValidator(fieldValidator);
317         //-- _width
318         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute);
319         handler = new org.exolab.castor.xml.XMLFieldHandler() {
320             public java.lang.Object getValue( java.lang.Object object ) 
321                 throws IllegalStateException
322             {
323                 StructureState target = (StructureState) object;
324                 if (!target.hasWidth()) { return null; }
325                 return new java.lang.Integer(target.getWidth());
326             }
327             public void setValue( java.lang.Object object, java.lang.Object value) 
328                 throws IllegalStateException, IllegalArgumentException
329             {
330                 try {
331                     StructureState target = (StructureState) object;
332                     // if null, use delete method for optional primitives 
333                     if (value == null) {
334                         target.deleteWidth();
335                         return;
336                     }
337                     target.setWidth( ((java.lang.Integer) value).intValue());
338                 } catch (java.lang.Exception ex) {
339                     throw new IllegalStateException(ex.toString());
340                 }
341             }
342             public java.lang.Object newInstance(java.lang.Object parent) {
343                 return null;
344             }
345         };
346         desc.setHandler(handler);
347         desc.setMultivalued(false);
348         addFieldDescriptor(desc);
349         
350         //-- validation code for: _width
351         fieldValidator = new org.exolab.castor.xml.FieldValidator();
352         { //-- local scope
353             org.exolab.castor.xml.validators.IntValidator typeValidator;
354             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
355             fieldValidator.setValidator(typeValidator);
356             typeValidator.setMinInclusive(-2147483648);
357             typeValidator.setMaxInclusive(2147483647);
358         }
359         desc.setValidator(fieldValidator);
360         //-- _height
361         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute);
362         handler = new org.exolab.castor.xml.XMLFieldHandler() {
363             public java.lang.Object getValue( java.lang.Object object ) 
364                 throws IllegalStateException
365             {
366                 StructureState target = (StructureState) object;
367                 if (!target.hasHeight()) { return null; }
368                 return new java.lang.Integer(target.getHeight());
369             }
370             public void setValue( java.lang.Object object, java.lang.Object value) 
371                 throws IllegalStateException, IllegalArgumentException
372             {
373                 try {
374                     StructureState target = (StructureState) object;
375                     // if null, use delete method for optional primitives 
376                     if (value == null) {
377                         target.deleteHeight();
378                         return;
379                     }
380                     target.setHeight( ((java.lang.Integer) value).intValue());
381                 } catch (java.lang.Exception ex) {
382                     throw new IllegalStateException(ex.toString());
383                 }
384             }
385             public java.lang.Object newInstance(java.lang.Object parent) {
386                 return null;
387             }
388         };
389         desc.setHandler(handler);
390         desc.setMultivalued(false);
391         addFieldDescriptor(desc);
392         
393         //-- validation code for: _height
394         fieldValidator = new org.exolab.castor.xml.FieldValidator();
395         { //-- local scope
396             org.exolab.castor.xml.validators.IntValidator typeValidator;
397             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
398             fieldValidator.setValidator(typeValidator);
399             typeValidator.setMinInclusive(-2147483648);
400             typeValidator.setMaxInclusive(2147483647);
401         }
402         desc.setValidator(fieldValidator);
403         //-- _xpos
404         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute);
405         handler = new org.exolab.castor.xml.XMLFieldHandler() {
406             public java.lang.Object getValue( java.lang.Object object ) 
407                 throws IllegalStateException
408             {
409                 StructureState target = (StructureState) object;
410                 if (!target.hasXpos()) { return null; }
411                 return new java.lang.Integer(target.getXpos());
412             }
413             public void setValue( java.lang.Object object, java.lang.Object value) 
414                 throws IllegalStateException, IllegalArgumentException
415             {
416                 try {
417                     StructureState target = (StructureState) object;
418                     // if null, use delete method for optional primitives 
419                     if (value == null) {
420                         target.deleteXpos();
421                         return;
422                     }
423                     target.setXpos( ((java.lang.Integer) value).intValue());
424                 } catch (java.lang.Exception ex) {
425                     throw new IllegalStateException(ex.toString());
426                 }
427             }
428             public java.lang.Object newInstance(java.lang.Object parent) {
429                 return null;
430             }
431         };
432         desc.setHandler(handler);
433         desc.setMultivalued(false);
434         addFieldDescriptor(desc);
435         
436         //-- validation code for: _xpos
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         //-- _ypos
447         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute);
448         handler = new org.exolab.castor.xml.XMLFieldHandler() {
449             public java.lang.Object getValue( java.lang.Object object ) 
450                 throws IllegalStateException
451             {
452                 StructureState target = (StructureState) object;
453                 if (!target.hasYpos()) { return null; }
454                 return new java.lang.Integer(target.getYpos());
455             }
456             public void setValue( java.lang.Object object, java.lang.Object value) 
457                 throws IllegalStateException, IllegalArgumentException
458             {
459                 try {
460                     StructureState target = (StructureState) object;
461                     // if null, use delete method for optional primitives 
462                     if (value == null) {
463                         target.deleteYpos();
464                         return;
465                     }
466                     target.setYpos( ((java.lang.Integer) value).intValue());
467                 } catch (java.lang.Exception ex) {
468                     throw new IllegalStateException(ex.toString());
469                 }
470             }
471             public java.lang.Object newInstance(java.lang.Object parent) {
472                 return null;
473             }
474         };
475         desc.setHandler(handler);
476         desc.setMultivalued(false);
477         addFieldDescriptor(desc);
478         
479         //-- validation code for: _ypos
480         fieldValidator = new org.exolab.castor.xml.FieldValidator();
481         { //-- local scope
482             org.exolab.castor.xml.validators.IntValidator typeValidator;
483             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
484             fieldValidator.setValidator(typeValidator);
485             typeValidator.setMinInclusive(-2147483648);
486             typeValidator.setMaxInclusive(2147483647);
487         }
488         desc.setValidator(fieldValidator);
489         //-- initialize element descriptors
490         
491     }
492
493
494       //-----------/
495      //- Methods -/
496     //-----------/
497
498     /**
499      * Method getAccessMode.
500      * 
501      * @return the access mode specified for this class.
502      */
503     public org.exolab.castor.mapping.AccessMode getAccessMode(
504     ) {
505         return null;
506     }
507
508     /**
509      * Method getIdentity.
510      * 
511      * @return the identity field, null if this class has no
512      * identity.
513      */
514     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
515     ) {
516         return super.getIdentity();
517     }
518
519     /**
520      * Method getJavaClass.
521      * 
522      * @return the Java class represented by this descriptor.
523      */
524     public java.lang.Class getJavaClass(
525     ) {
526         return jalview.schemabinding.version2.StructureState.class;
527     }
528
529     /**
530      * Method getNameSpacePrefix.
531      * 
532      * @return the namespace prefix to use when marshaling as XML.
533      */
534     public java.lang.String getNameSpacePrefix(
535     ) {
536         return _nsPrefix;
537     }
538
539     /**
540      * Method getNameSpaceURI.
541      * 
542      * @return the namespace URI used when marshaling and
543      * unmarshaling as XML.
544      */
545     public java.lang.String getNameSpaceURI(
546     ) {
547         return _nsURI;
548     }
549
550     /**
551      * Method getValidator.
552      * 
553      * @return a specific validator for the class described by this
554      * ClassDescriptor.
555      */
556     public org.exolab.castor.xml.TypeValidator getValidator(
557     ) {
558         return this;
559     }
560
561     /**
562      * Method getXMLName.
563      * 
564      * @return the XML Name for the Class being described.
565      */
566     public java.lang.String getXMLName(
567     ) {
568         return _xmlName;
569     }
570
571     /**
572      * Method isElementDefinition.
573      * 
574      * @return true if XML schema definition of this Class is that
575      * of a global
576      * element or element with anonymous type definition.
577      */
578     public boolean isElementDefinition(
579     ) {
580         return _elementDefinition;
581     }
582
583 }