formatting
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / AnnotationColoursDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.AnnotationColours;
15
16 /**
17  * Class AnnotationColoursDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class AnnotationColoursDescriptor extends
22         org.exolab.castor.xml.util.XMLClassDescriptorImpl
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _elementDefinition.
31    */
32   private boolean _elementDefinition;
33
34   /**
35    * Field _nsPrefix.
36    */
37   private java.lang.String _nsPrefix;
38
39   /**
40    * Field _nsURI.
41    */
42   private java.lang.String _nsURI;
43
44   /**
45    * Field _xmlName.
46    */
47   private java.lang.String _xmlName;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public AnnotationColoursDescriptor()
54   {
55     super();
56     _nsURI = "www.jalview.org";
57     _xmlName = "AnnotationColours";
58     _elementDefinition = true;
59     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60     org.exolab.castor.mapping.FieldHandler handler = null;
61     org.exolab.castor.xml.FieldValidator fieldValidator = null;
62     // -- initialize attribute descriptors
63
64     // -- _aboveThreshold
65     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66             java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold",
67             org.exolab.castor.xml.NodeType.Attribute);
68     handler = new org.exolab.castor.xml.XMLFieldHandler()
69     {
70       public java.lang.Object getValue(java.lang.Object object)
71               throws IllegalStateException
72       {
73         AnnotationColours target = (AnnotationColours) object;
74         if (!target.hasAboveThreshold())
75         {
76           return null;
77         }
78         return new java.lang.Integer(target.getAboveThreshold());
79       }
80
81       public void setValue(java.lang.Object object, java.lang.Object value)
82               throws IllegalStateException, IllegalArgumentException
83       {
84         try
85         {
86           AnnotationColours target = (AnnotationColours) object;
87           // if null, use delete method for optional primitives
88           if (value == null)
89           {
90             target.deleteAboveThreshold();
91             return;
92           }
93           target.setAboveThreshold(((java.lang.Integer) value).intValue());
94         } catch (java.lang.Exception ex)
95         {
96           throw new IllegalStateException(ex.toString());
97         }
98       }
99
100       public java.lang.Object newInstance(java.lang.Object parent)
101       {
102         return null;
103       }
104     };
105     desc.setHandler(handler);
106     desc.setMultivalued(false);
107     addFieldDescriptor(desc);
108
109     // -- validation code for: _aboveThreshold
110     fieldValidator = new org.exolab.castor.xml.FieldValidator();
111     { // -- local scope
112       org.exolab.castor.xml.validators.IntValidator typeValidator;
113       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
114       fieldValidator.setValidator(typeValidator);
115       typeValidator.setMinInclusive(-2147483648);
116       typeValidator.setMaxInclusive(2147483647);
117     }
118     desc.setValidator(fieldValidator);
119     // -- _annotation
120     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
121             java.lang.String.class, "_annotation", "annotation",
122             org.exolab.castor.xml.NodeType.Attribute);
123     desc.setImmutable(true);
124     handler = new org.exolab.castor.xml.XMLFieldHandler()
125     {
126       public java.lang.Object getValue(java.lang.Object object)
127               throws IllegalStateException
128       {
129         AnnotationColours target = (AnnotationColours) object;
130         return target.getAnnotation();
131       }
132
133       public void setValue(java.lang.Object object, java.lang.Object value)
134               throws IllegalStateException, IllegalArgumentException
135       {
136         try
137         {
138           AnnotationColours target = (AnnotationColours) object;
139           target.setAnnotation((java.lang.String) value);
140         } catch (java.lang.Exception ex)
141         {
142           throw new IllegalStateException(ex.toString());
143         }
144       }
145
146       public java.lang.Object newInstance(java.lang.Object parent)
147       {
148         return null;
149       }
150     };
151     desc.setHandler(handler);
152     desc.setMultivalued(false);
153     addFieldDescriptor(desc);
154
155     // -- validation code for: _annotation
156     fieldValidator = new org.exolab.castor.xml.FieldValidator();
157     { // -- local scope
158       org.exolab.castor.xml.validators.StringValidator typeValidator;
159       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
160       fieldValidator.setValidator(typeValidator);
161       typeValidator.setWhiteSpace("preserve");
162     }
163     desc.setValidator(fieldValidator);
164     // -- _minColour
165     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
166             java.lang.Integer.TYPE, "_minColour", "minColour",
167             org.exolab.castor.xml.NodeType.Attribute);
168     handler = new org.exolab.castor.xml.XMLFieldHandler()
169     {
170       public java.lang.Object getValue(java.lang.Object object)
171               throws IllegalStateException
172       {
173         AnnotationColours target = (AnnotationColours) object;
174         if (!target.hasMinColour())
175         {
176           return null;
177         }
178         return new java.lang.Integer(target.getMinColour());
179       }
180
181       public void setValue(java.lang.Object object, java.lang.Object value)
182               throws IllegalStateException, IllegalArgumentException
183       {
184         try
185         {
186           AnnotationColours target = (AnnotationColours) object;
187           // if null, use delete method for optional primitives
188           if (value == null)
189           {
190             target.deleteMinColour();
191             return;
192           }
193           target.setMinColour(((java.lang.Integer) value).intValue());
194         } catch (java.lang.Exception ex)
195         {
196           throw new IllegalStateException(ex.toString());
197         }
198       }
199
200       public java.lang.Object newInstance(java.lang.Object parent)
201       {
202         return null;
203       }
204     };
205     desc.setHandler(handler);
206     desc.setMultivalued(false);
207     addFieldDescriptor(desc);
208
209     // -- validation code for: _minColour
210     fieldValidator = new org.exolab.castor.xml.FieldValidator();
211     { // -- local scope
212       org.exolab.castor.xml.validators.IntValidator typeValidator;
213       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
214       fieldValidator.setValidator(typeValidator);
215       typeValidator.setMinInclusive(-2147483648);
216       typeValidator.setMaxInclusive(2147483647);
217     }
218     desc.setValidator(fieldValidator);
219     // -- _maxColour
220     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
221             java.lang.Integer.TYPE, "_maxColour", "maxColour",
222             org.exolab.castor.xml.NodeType.Attribute);
223     handler = new org.exolab.castor.xml.XMLFieldHandler()
224     {
225       public java.lang.Object getValue(java.lang.Object object)
226               throws IllegalStateException
227       {
228         AnnotationColours target = (AnnotationColours) object;
229         if (!target.hasMaxColour())
230         {
231           return null;
232         }
233         return new java.lang.Integer(target.getMaxColour());
234       }
235
236       public void setValue(java.lang.Object object, java.lang.Object value)
237               throws IllegalStateException, IllegalArgumentException
238       {
239         try
240         {
241           AnnotationColours target = (AnnotationColours) object;
242           // if null, use delete method for optional primitives
243           if (value == null)
244           {
245             target.deleteMaxColour();
246             return;
247           }
248           target.setMaxColour(((java.lang.Integer) value).intValue());
249         } catch (java.lang.Exception ex)
250         {
251           throw new IllegalStateException(ex.toString());
252         }
253       }
254
255       public java.lang.Object newInstance(java.lang.Object parent)
256       {
257         return null;
258       }
259     };
260     desc.setHandler(handler);
261     desc.setMultivalued(false);
262     addFieldDescriptor(desc);
263
264     // -- validation code for: _maxColour
265     fieldValidator = new org.exolab.castor.xml.FieldValidator();
266     { // -- local scope
267       org.exolab.castor.xml.validators.IntValidator typeValidator;
268       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
269       fieldValidator.setValidator(typeValidator);
270       typeValidator.setMinInclusive(-2147483648);
271       typeValidator.setMaxInclusive(2147483647);
272     }
273     desc.setValidator(fieldValidator);
274     // -- _colourScheme
275     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
276             java.lang.String.class, "_colourScheme", "colourScheme",
277             org.exolab.castor.xml.NodeType.Attribute);
278     desc.setImmutable(true);
279     handler = new org.exolab.castor.xml.XMLFieldHandler()
280     {
281       public java.lang.Object getValue(java.lang.Object object)
282               throws IllegalStateException
283       {
284         AnnotationColours target = (AnnotationColours) object;
285         return target.getColourScheme();
286       }
287
288       public void setValue(java.lang.Object object, java.lang.Object value)
289               throws IllegalStateException, IllegalArgumentException
290       {
291         try
292         {
293           AnnotationColours target = (AnnotationColours) object;
294           target.setColourScheme((java.lang.String) value);
295         } catch (java.lang.Exception ex)
296         {
297           throw new IllegalStateException(ex.toString());
298         }
299       }
300
301       public java.lang.Object newInstance(java.lang.Object parent)
302       {
303         return null;
304       }
305     };
306     desc.setHandler(handler);
307     desc.setMultivalued(false);
308     addFieldDescriptor(desc);
309
310     // -- validation code for: _colourScheme
311     fieldValidator = new org.exolab.castor.xml.FieldValidator();
312     { // -- local scope
313       org.exolab.castor.xml.validators.StringValidator typeValidator;
314       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
315       fieldValidator.setValidator(typeValidator);
316       typeValidator.setWhiteSpace("preserve");
317     }
318     desc.setValidator(fieldValidator);
319     // -- _threshold
320     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
321             java.lang.Float.TYPE, "_threshold", "threshold",
322             org.exolab.castor.xml.NodeType.Attribute);
323     handler = new org.exolab.castor.xml.XMLFieldHandler()
324     {
325       public java.lang.Object getValue(java.lang.Object object)
326               throws IllegalStateException
327       {
328         AnnotationColours target = (AnnotationColours) object;
329         if (!target.hasThreshold())
330         {
331           return null;
332         }
333         return new java.lang.Float(target.getThreshold());
334       }
335
336       public void setValue(java.lang.Object object, java.lang.Object value)
337               throws IllegalStateException, IllegalArgumentException
338       {
339         try
340         {
341           AnnotationColours target = (AnnotationColours) object;
342           // if null, use delete method for optional primitives
343           if (value == null)
344           {
345             target.deleteThreshold();
346             return;
347           }
348           target.setThreshold(((java.lang.Float) value).floatValue());
349         } catch (java.lang.Exception ex)
350         {
351           throw new IllegalStateException(ex.toString());
352         }
353       }
354
355       public java.lang.Object newInstance(java.lang.Object parent)
356       {
357         return null;
358       }
359     };
360     desc.setHandler(handler);
361     desc.setMultivalued(false);
362     addFieldDescriptor(desc);
363
364     // -- validation code for: _threshold
365     fieldValidator = new org.exolab.castor.xml.FieldValidator();
366     { // -- local scope
367       org.exolab.castor.xml.validators.FloatValidator typeValidator;
368       typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
369       fieldValidator.setValidator(typeValidator);
370       typeValidator.setMinInclusive((float) -3.4028235E38);
371       typeValidator.setMaxInclusive((float) 3.4028235E38);
372     }
373     desc.setValidator(fieldValidator);
374     // -- initialize element descriptors
375
376   }
377
378   // -----------/
379   // - Methods -/
380   // -----------/
381
382   /**
383    * Method getAccessMode.
384    * 
385    * @return the access mode specified for this class.
386    */
387   public org.exolab.castor.mapping.AccessMode getAccessMode()
388   {
389     return null;
390   }
391
392   /**
393    * Method getIdentity.
394    * 
395    * @return the identity field, null if this class has no identity.
396    */
397   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
398   {
399     return super.getIdentity();
400   }
401
402   /**
403    * Method getJavaClass.
404    * 
405    * @return the Java class represented by this descriptor.
406    */
407   public java.lang.Class getJavaClass()
408   {
409     return jalview.schemabinding.version2.AnnotationColours.class;
410   }
411
412   /**
413    * Method getNameSpacePrefix.
414    * 
415    * @return the namespace prefix to use when marshaling as XML.
416    */
417   public java.lang.String getNameSpacePrefix()
418   {
419     return _nsPrefix;
420   }
421
422   /**
423    * Method getNameSpaceURI.
424    * 
425    * @return the namespace URI used when marshaling and unmarshaling as XML.
426    */
427   public java.lang.String getNameSpaceURI()
428   {
429     return _nsURI;
430   }
431
432   /**
433    * Method getValidator.
434    * 
435    * @return a specific validator for the class described by this
436    *         ClassDescriptor.
437    */
438   public org.exolab.castor.xml.TypeValidator getValidator()
439   {
440     return this;
441   }
442
443   /**
444    * Method getXMLName.
445    * 
446    * @return the XML Name for the Class being described.
447    */
448   public java.lang.String getXMLName()
449   {
450     return _xmlName;
451   }
452
453   /**
454    * Method isElementDefinition.
455    * 
456    * @return true if XML schema definition of this Class is that of a global
457    *         element or element with anonymous type definition.
458    */
459   public boolean isElementDefinition()
460   {
461     return _elementDefinition;
462   }
463
464 }