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