update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / ColourDescriptor.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.Colour;
32
33 /**
34  * Class ColourDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class ColourDescriptor 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 ColourDescriptor() {
71         super();
72         _xmlName = "colour";
73         _elementDefinition = true;
74         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
75         org.exolab.castor.mapping.FieldHandler             handler        = null;
76         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
77         //-- initialize attribute descriptors
78         
79         //-- _name
80         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "Name", org.exolab.castor.xml.NodeType.Attribute);
81         desc.setImmutable(true);
82         handler = new org.exolab.castor.xml.XMLFieldHandler() {
83             public java.lang.Object getValue( java.lang.Object object ) 
84                 throws IllegalStateException
85             {
86                 Colour target = (Colour) object;
87                 return target.getName();
88             }
89             public void setValue( java.lang.Object object, java.lang.Object value) 
90                 throws IllegalStateException, IllegalArgumentException
91             {
92                 try {
93                     Colour target = (Colour) object;
94                     target.setName( (java.lang.String) value);
95                 } catch (java.lang.Exception ex) {
96                     throw new IllegalStateException(ex.toString());
97                 }
98             }
99             public java.lang.Object newInstance(java.lang.Object parent) {
100                 return null;
101             }
102         };
103         desc.setHandler(handler);
104         desc.setMultivalued(false);
105         addFieldDescriptor(desc);
106         
107         //-- validation code for: _name
108         fieldValidator = new org.exolab.castor.xml.FieldValidator();
109         { //-- local scope
110             org.exolab.castor.xml.validators.StringValidator typeValidator;
111             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
112             fieldValidator.setValidator(typeValidator);
113             typeValidator.setWhiteSpace("preserve");
114         }
115         desc.setValidator(fieldValidator);
116         //-- _RGB
117         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_RGB", "RGB", org.exolab.castor.xml.NodeType.Attribute);
118         desc.setImmutable(true);
119         handler = new org.exolab.castor.xml.XMLFieldHandler() {
120             public java.lang.Object getValue( java.lang.Object object ) 
121                 throws IllegalStateException
122             {
123                 Colour target = (Colour) object;
124                 return target.getRGB();
125             }
126             public void setValue( java.lang.Object object, java.lang.Object value) 
127                 throws IllegalStateException, IllegalArgumentException
128             {
129                 try {
130                     Colour target = (Colour) object;
131                     target.setRGB( (java.lang.String) value);
132                 } catch (java.lang.Exception ex) {
133                     throw new IllegalStateException(ex.toString());
134                 }
135             }
136             public java.lang.Object newInstance(java.lang.Object parent) {
137                 return null;
138             }
139         };
140         desc.setHandler(handler);
141         desc.setRequired(true);
142         desc.setMultivalued(false);
143         addFieldDescriptor(desc);
144         
145         //-- validation code for: _RGB
146         fieldValidator = new org.exolab.castor.xml.FieldValidator();
147         fieldValidator.setMinOccurs(1);
148         { //-- local scope
149             org.exolab.castor.xml.validators.StringValidator typeValidator;
150             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
151             fieldValidator.setValidator(typeValidator);
152             typeValidator.setWhiteSpace("preserve");
153         }
154         desc.setValidator(fieldValidator);
155         //-- _minRGB
156         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_minRGB", "minRGB", org.exolab.castor.xml.NodeType.Attribute);
157         desc.setImmutable(true);
158         handler = new org.exolab.castor.xml.XMLFieldHandler() {
159             public java.lang.Object getValue( java.lang.Object object ) 
160                 throws IllegalStateException
161             {
162                 Colour target = (Colour) object;
163                 return target.getMinRGB();
164             }
165             public void setValue( java.lang.Object object, java.lang.Object value) 
166                 throws IllegalStateException, IllegalArgumentException
167             {
168                 try {
169                     Colour target = (Colour) object;
170                     target.setMinRGB( (java.lang.String) value);
171                 } catch (java.lang.Exception ex) {
172                     throw new IllegalStateException(ex.toString());
173                 }
174             }
175             public java.lang.Object newInstance(java.lang.Object parent) {
176                 return null;
177             }
178         };
179         desc.setHandler(handler);
180         desc.setMultivalued(false);
181         addFieldDescriptor(desc);
182         
183         //-- validation code for: _minRGB
184         fieldValidator = new org.exolab.castor.xml.FieldValidator();
185         { //-- local scope
186             org.exolab.castor.xml.validators.StringValidator typeValidator;
187             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
188             fieldValidator.setValidator(typeValidator);
189             typeValidator.setWhiteSpace("preserve");
190         }
191         desc.setValidator(fieldValidator);
192         //-- _threshType
193         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_threshType", "threshType", org.exolab.castor.xml.NodeType.Attribute);
194         desc.setImmutable(true);
195         handler = new org.exolab.castor.xml.XMLFieldHandler() {
196             public java.lang.Object getValue( java.lang.Object object ) 
197                 throws IllegalStateException
198             {
199                 Colour target = (Colour) object;
200                 return target.getThreshType();
201             }
202             public void setValue( java.lang.Object object, java.lang.Object value) 
203                 throws IllegalStateException, IllegalArgumentException
204             {
205                 try {
206                     Colour target = (Colour) object;
207                     target.setThreshType( (java.lang.String) value);
208                 } catch (java.lang.Exception ex) {
209                     throw new IllegalStateException(ex.toString());
210                 }
211             }
212             public java.lang.Object newInstance(java.lang.Object parent) {
213                 return null;
214             }
215         };
216         desc.setHandler(handler);
217         desc.setMultivalued(false);
218         addFieldDescriptor(desc);
219         
220         //-- validation code for: _threshType
221         fieldValidator = new org.exolab.castor.xml.FieldValidator();
222         { //-- local scope
223             org.exolab.castor.xml.validators.StringValidator typeValidator;
224             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
225             fieldValidator.setValidator(typeValidator);
226             typeValidator.setWhiteSpace("preserve");
227         }
228         desc.setValidator(fieldValidator);
229         //-- _threshold
230         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute);
231         handler = new org.exolab.castor.xml.XMLFieldHandler() {
232             public java.lang.Object getValue( java.lang.Object object ) 
233                 throws IllegalStateException
234             {
235                 Colour target = (Colour) object;
236                 if (!target.hasThreshold()) { return null; }
237                 return new java.lang.Float(target.getThreshold());
238             }
239             public void setValue( java.lang.Object object, java.lang.Object value) 
240                 throws IllegalStateException, IllegalArgumentException
241             {
242                 try {
243                     Colour target = (Colour) object;
244                     // if null, use delete method for optional primitives 
245                     if (value == null) {
246                         target.deleteThreshold();
247                         return;
248                     }
249                     target.setThreshold( ((java.lang.Float) value).floatValue());
250                 } catch (java.lang.Exception ex) {
251                     throw new IllegalStateException(ex.toString());
252                 }
253             }
254             public java.lang.Object newInstance(java.lang.Object parent) {
255                 return null;
256             }
257         };
258         desc.setHandler(handler);
259         desc.setMultivalued(false);
260         addFieldDescriptor(desc);
261         
262         //-- validation code for: _threshold
263         fieldValidator = new org.exolab.castor.xml.FieldValidator();
264         { //-- local scope
265             org.exolab.castor.xml.validators.FloatValidator typeValidator;
266             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
267             fieldValidator.setValidator(typeValidator);
268             typeValidator.setMinInclusive((float) -3.4028235E38);
269             typeValidator.setMaxInclusive((float) 3.4028235E38);
270         }
271         desc.setValidator(fieldValidator);
272         //-- _max
273         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_max", "max", org.exolab.castor.xml.NodeType.Attribute);
274         handler = new org.exolab.castor.xml.XMLFieldHandler() {
275             public java.lang.Object getValue( java.lang.Object object ) 
276                 throws IllegalStateException
277             {
278                 Colour target = (Colour) object;
279                 if (!target.hasMax()) { return null; }
280                 return new java.lang.Float(target.getMax());
281             }
282             public void setValue( java.lang.Object object, java.lang.Object value) 
283                 throws IllegalStateException, IllegalArgumentException
284             {
285                 try {
286                     Colour target = (Colour) object;
287                     // if null, use delete method for optional primitives 
288                     if (value == null) {
289                         target.deleteMax();
290                         return;
291                     }
292                     target.setMax( ((java.lang.Float) value).floatValue());
293                 } catch (java.lang.Exception ex) {
294                     throw new IllegalStateException(ex.toString());
295                 }
296             }
297             public java.lang.Object newInstance(java.lang.Object parent) {
298                 return null;
299             }
300         };
301         desc.setHandler(handler);
302         desc.setMultivalued(false);
303         addFieldDescriptor(desc);
304         
305         //-- validation code for: _max
306         fieldValidator = new org.exolab.castor.xml.FieldValidator();
307         { //-- local scope
308             org.exolab.castor.xml.validators.FloatValidator typeValidator;
309             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
310             fieldValidator.setValidator(typeValidator);
311             typeValidator.setMinInclusive((float) -3.4028235E38);
312             typeValidator.setMaxInclusive((float) 3.4028235E38);
313         }
314         desc.setValidator(fieldValidator);
315         //-- _min
316         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_min", "min", org.exolab.castor.xml.NodeType.Attribute);
317         handler = new org.exolab.castor.xml.XMLFieldHandler() {
318             public java.lang.Object getValue( java.lang.Object object ) 
319                 throws IllegalStateException
320             {
321                 Colour target = (Colour) object;
322                 if (!target.hasMin()) { return null; }
323                 return new java.lang.Float(target.getMin());
324             }
325             public void setValue( java.lang.Object object, java.lang.Object value) 
326                 throws IllegalStateException, IllegalArgumentException
327             {
328                 try {
329                     Colour target = (Colour) object;
330                     // if null, use delete method for optional primitives 
331                     if (value == null) {
332                         target.deleteMin();
333                         return;
334                     }
335                     target.setMin( ((java.lang.Float) value).floatValue());
336                 } catch (java.lang.Exception ex) {
337                     throw new IllegalStateException(ex.toString());
338                 }
339             }
340             public java.lang.Object newInstance(java.lang.Object parent) {
341                 return null;
342             }
343         };
344         desc.setHandler(handler);
345         desc.setMultivalued(false);
346         addFieldDescriptor(desc);
347         
348         //-- validation code for: _min
349         fieldValidator = new org.exolab.castor.xml.FieldValidator();
350         { //-- local scope
351             org.exolab.castor.xml.validators.FloatValidator typeValidator;
352             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
353             fieldValidator.setValidator(typeValidator);
354             typeValidator.setMinInclusive((float) -3.4028235E38);
355             typeValidator.setMaxInclusive((float) 3.4028235E38);
356         }
357         desc.setValidator(fieldValidator);
358         //-- _colourByLabel
359         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByLabel", "colourByLabel", org.exolab.castor.xml.NodeType.Attribute);
360         handler = new org.exolab.castor.xml.XMLFieldHandler() {
361             public java.lang.Object getValue( java.lang.Object object ) 
362                 throws IllegalStateException
363             {
364                 Colour target = (Colour) object;
365                 if (!target.hasColourByLabel()) { return null; }
366                 return (target.getColourByLabel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
367             }
368             public void setValue( java.lang.Object object, java.lang.Object value) 
369                 throws IllegalStateException, IllegalArgumentException
370             {
371                 try {
372                     Colour target = (Colour) object;
373                     // if null, use delete method for optional primitives 
374                     if (value == null) {
375                         target.deleteColourByLabel();
376                         return;
377                     }
378                     target.setColourByLabel( ((java.lang.Boolean) value).booleanValue());
379                 } catch (java.lang.Exception ex) {
380                     throw new IllegalStateException(ex.toString());
381                 }
382             }
383             public java.lang.Object newInstance(java.lang.Object parent) {
384                 return null;
385             }
386         };
387         desc.setHandler(handler);
388         desc.setMultivalued(false);
389         addFieldDescriptor(desc);
390         
391         //-- validation code for: _colourByLabel
392         fieldValidator = new org.exolab.castor.xml.FieldValidator();
393         { //-- local scope
394             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
395             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
396             fieldValidator.setValidator(typeValidator);
397         }
398         desc.setValidator(fieldValidator);
399         //-- _autoScale
400         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoScale", "autoScale", org.exolab.castor.xml.NodeType.Attribute);
401         handler = new org.exolab.castor.xml.XMLFieldHandler() {
402             public java.lang.Object getValue( java.lang.Object object ) 
403                 throws IllegalStateException
404             {
405                 Colour target = (Colour) object;
406                 if (!target.hasAutoScale()) { return null; }
407                 return (target.getAutoScale() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
408             }
409             public void setValue( java.lang.Object object, java.lang.Object value) 
410                 throws IllegalStateException, IllegalArgumentException
411             {
412                 try {
413                     Colour target = (Colour) object;
414                     // if null, use delete method for optional primitives 
415                     if (value == null) {
416                         target.deleteAutoScale();
417                         return;
418                     }
419                     target.setAutoScale( ((java.lang.Boolean) value).booleanValue());
420                 } catch (java.lang.Exception ex) {
421                     throw new IllegalStateException(ex.toString());
422                 }
423             }
424             public java.lang.Object newInstance(java.lang.Object parent) {
425                 return null;
426             }
427         };
428         desc.setHandler(handler);
429         desc.setMultivalued(false);
430         addFieldDescriptor(desc);
431         
432         //-- validation code for: _autoScale
433         fieldValidator = new org.exolab.castor.xml.FieldValidator();
434         { //-- local scope
435             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
436             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
437             fieldValidator.setValidator(typeValidator);
438         }
439         desc.setValidator(fieldValidator);
440         //-- initialize element descriptors
441         
442     }
443
444
445       //-----------/
446      //- Methods -/
447     //-----------/
448
449     /**
450      * Method getAccessMode.
451      * 
452      * @return the access mode specified for this class.
453      */
454     public org.exolab.castor.mapping.AccessMode getAccessMode(
455     ) {
456         return null;
457     }
458
459     /**
460      * Method getIdentity.
461      * 
462      * @return the identity field, null if this class has no
463      * identity.
464      */
465     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
466     ) {
467         return super.getIdentity();
468     }
469
470     /**
471      * Method getJavaClass.
472      * 
473      * @return the Java class represented by this descriptor.
474      */
475     public java.lang.Class getJavaClass(
476     ) {
477         return jalview.schemabinding.version2.Colour.class;
478     }
479
480     /**
481      * Method getNameSpacePrefix.
482      * 
483      * @return the namespace prefix to use when marshaling as XML.
484      */
485     public java.lang.String getNameSpacePrefix(
486     ) {
487         return _nsPrefix;
488     }
489
490     /**
491      * Method getNameSpaceURI.
492      * 
493      * @return the namespace URI used when marshaling and
494      * unmarshaling as XML.
495      */
496     public java.lang.String getNameSpaceURI(
497     ) {
498         return _nsURI;
499     }
500
501     /**
502      * Method getValidator.
503      * 
504      * @return a specific validator for the class described by this
505      * ClassDescriptor.
506      */
507     public org.exolab.castor.xml.TypeValidator getValidator(
508     ) {
509         return this;
510     }
511
512     /**
513      * Method getXMLName.
514      * 
515      * @return the XML Name for the Class being described.
516      */
517     public java.lang.String getXMLName(
518     ) {
519         return _xmlName;
520     }
521
522     /**
523      * Method isElementDefinition.
524      * 
525      * @return true if XML schema definition of this Class is that
526      * of a global
527      * element or element with anonymous type definition.
528      */
529     public boolean isElementDefinition(
530     ) {
531         return _elementDefinition;
532     }
533
534 }