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