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