update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / AnnotationElementDescriptor.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.AnnotationElement;
32
33 /**
34  * Class AnnotationElementDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class AnnotationElementDescriptor 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 AnnotationElementDescriptor() {
71         super();
72         _nsURI = "www.vamsas.ac.uk/jalview/version2";
73         _xmlName = "annotationElement";
74         _elementDefinition = true;
75         
76         //-- set grouping compositor
77         setCompositorAsSequence();
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         //-- _position
84         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute);
85         handler = new org.exolab.castor.xml.XMLFieldHandler() {
86             public java.lang.Object getValue( java.lang.Object object ) 
87                 throws IllegalStateException
88             {
89                 AnnotationElement target = (AnnotationElement) object;
90                 if (!target.hasPosition()) { return null; }
91                 return new java.lang.Integer(target.getPosition());
92             }
93             public void setValue( java.lang.Object object, java.lang.Object value) 
94                 throws IllegalStateException, IllegalArgumentException
95             {
96                 try {
97                     AnnotationElement target = (AnnotationElement) object;
98                     // ignore null values for non optional primitives
99                     if (value == null) { return; }
100                     
101                     target.setPosition( ((java.lang.Integer) value).intValue());
102                 } catch (java.lang.Exception ex) {
103                     throw new IllegalStateException(ex.toString());
104                 }
105             }
106             public java.lang.Object newInstance(java.lang.Object parent) {
107                 return null;
108             }
109         };
110         desc.setHandler(handler);
111         desc.setRequired(true);
112         desc.setMultivalued(false);
113         addFieldDescriptor(desc);
114         
115         //-- validation code for: _position
116         fieldValidator = new org.exolab.castor.xml.FieldValidator();
117         fieldValidator.setMinOccurs(1);
118         { //-- local scope
119             org.exolab.castor.xml.validators.IntValidator typeValidator;
120             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
121             fieldValidator.setValidator(typeValidator);
122             typeValidator.setMinInclusive(-2147483648);
123             typeValidator.setMaxInclusive(2147483647);
124         }
125         desc.setValidator(fieldValidator);
126         //-- _colour
127         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute);
128         handler = new org.exolab.castor.xml.XMLFieldHandler() {
129             public java.lang.Object getValue( java.lang.Object object ) 
130                 throws IllegalStateException
131             {
132                 AnnotationElement target = (AnnotationElement) object;
133                 if (!target.hasColour()) { return null; }
134                 return new java.lang.Integer(target.getColour());
135             }
136             public void setValue( java.lang.Object object, java.lang.Object value) 
137                 throws IllegalStateException, IllegalArgumentException
138             {
139                 try {
140                     AnnotationElement target = (AnnotationElement) object;
141                     // if null, use delete method for optional primitives 
142                     if (value == null) {
143                         target.deleteColour();
144                         return;
145                     }
146                     target.setColour( ((java.lang.Integer) value).intValue());
147                 } catch (java.lang.Exception ex) {
148                     throw new IllegalStateException(ex.toString());
149                 }
150             }
151             public java.lang.Object newInstance(java.lang.Object parent) {
152                 return null;
153             }
154         };
155         desc.setHandler(handler);
156         desc.setMultivalued(false);
157         addFieldDescriptor(desc);
158         
159         //-- validation code for: _colour
160         fieldValidator = new org.exolab.castor.xml.FieldValidator();
161         { //-- local scope
162             org.exolab.castor.xml.validators.IntValidator typeValidator;
163             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
164             fieldValidator.setValidator(typeValidator);
165             typeValidator.setMinInclusive(-2147483648);
166             typeValidator.setMaxInclusive(2147483647);
167         }
168         desc.setValidator(fieldValidator);
169         //-- initialize element descriptors
170         
171         //-- _displayCharacter
172         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_displayCharacter", "displayCharacter", org.exolab.castor.xml.NodeType.Element);
173         desc.setImmutable(true);
174         handler = new org.exolab.castor.xml.XMLFieldHandler() {
175             public java.lang.Object getValue( java.lang.Object object ) 
176                 throws IllegalStateException
177             {
178                 AnnotationElement target = (AnnotationElement) object;
179                 return target.getDisplayCharacter();
180             }
181             public void setValue( java.lang.Object object, java.lang.Object value) 
182                 throws IllegalStateException, IllegalArgumentException
183             {
184                 try {
185                     AnnotationElement target = (AnnotationElement) object;
186                     target.setDisplayCharacter( (java.lang.String) value);
187                 } catch (java.lang.Exception ex) {
188                     throw new IllegalStateException(ex.toString());
189                 }
190             }
191             public java.lang.Object newInstance(java.lang.Object parent) {
192                 return null;
193             }
194         };
195         desc.setHandler(handler);
196         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
197         desc.setMultivalued(false);
198         addFieldDescriptor(desc);
199         
200         //-- validation code for: _displayCharacter
201         fieldValidator = new org.exolab.castor.xml.FieldValidator();
202         { //-- local scope
203             org.exolab.castor.xml.validators.StringValidator typeValidator;
204             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
205             fieldValidator.setValidator(typeValidator);
206             typeValidator.setWhiteSpace("preserve");
207         }
208         desc.setValidator(fieldValidator);
209         //-- _description
210         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
211         desc.setImmutable(true);
212         handler = new org.exolab.castor.xml.XMLFieldHandler() {
213             public java.lang.Object getValue( java.lang.Object object ) 
214                 throws IllegalStateException
215             {
216                 AnnotationElement target = (AnnotationElement) object;
217                 return target.getDescription();
218             }
219             public void setValue( java.lang.Object object, java.lang.Object value) 
220                 throws IllegalStateException, IllegalArgumentException
221             {
222                 try {
223                     AnnotationElement target = (AnnotationElement) object;
224                     target.setDescription( (java.lang.String) value);
225                 } catch (java.lang.Exception ex) {
226                     throw new IllegalStateException(ex.toString());
227                 }
228             }
229             public java.lang.Object newInstance(java.lang.Object parent) {
230                 return null;
231             }
232         };
233         desc.setHandler(handler);
234         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
235         desc.setMultivalued(false);
236         addFieldDescriptor(desc);
237         
238         //-- validation code for: _description
239         fieldValidator = new org.exolab.castor.xml.FieldValidator();
240         { //-- local scope
241             org.exolab.castor.xml.validators.StringValidator typeValidator;
242             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
243             fieldValidator.setValidator(typeValidator);
244             typeValidator.setWhiteSpace("preserve");
245         }
246         desc.setValidator(fieldValidator);
247         //-- _secondaryStructure
248         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_secondaryStructure", "secondaryStructure", org.exolab.castor.xml.NodeType.Element);
249         desc.setImmutable(true);
250         handler = new org.exolab.castor.xml.XMLFieldHandler() {
251             public java.lang.Object getValue( java.lang.Object object ) 
252                 throws IllegalStateException
253             {
254                 AnnotationElement target = (AnnotationElement) object;
255                 return target.getSecondaryStructure();
256             }
257             public void setValue( java.lang.Object object, java.lang.Object value) 
258                 throws IllegalStateException, IllegalArgumentException
259             {
260                 try {
261                     AnnotationElement target = (AnnotationElement) object;
262                     target.setSecondaryStructure( (java.lang.String) value);
263                 } catch (java.lang.Exception ex) {
264                     throw new IllegalStateException(ex.toString());
265                 }
266             }
267             public java.lang.Object newInstance(java.lang.Object parent) {
268                 return null;
269             }
270         };
271         desc.setHandler(handler);
272         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
273         desc.setMultivalued(false);
274         addFieldDescriptor(desc);
275         
276         //-- validation code for: _secondaryStructure
277         fieldValidator = new org.exolab.castor.xml.FieldValidator();
278         { //-- local scope
279             org.exolab.castor.xml.validators.StringValidator typeValidator;
280             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
281             fieldValidator.setValidator(typeValidator);
282             typeValidator.setWhiteSpace("preserve");
283             typeValidator.setLength(1);
284         }
285         desc.setValidator(fieldValidator);
286         //-- _value
287         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_value", "value", org.exolab.castor.xml.NodeType.Element);
288         handler = new org.exolab.castor.xml.XMLFieldHandler() {
289             public java.lang.Object getValue( java.lang.Object object ) 
290                 throws IllegalStateException
291             {
292                 AnnotationElement target = (AnnotationElement) object;
293                 if (!target.hasValue()) { return null; }
294                 return new java.lang.Float(target.getValue());
295             }
296             public void setValue( java.lang.Object object, java.lang.Object value) 
297                 throws IllegalStateException, IllegalArgumentException
298             {
299                 try {
300                     AnnotationElement target = (AnnotationElement) object;
301                     // if null, use delete method for optional primitives 
302                     if (value == null) {
303                         target.deleteValue();
304                         return;
305                     }
306                     target.setValue( ((java.lang.Float) value).floatValue());
307                 } catch (java.lang.Exception ex) {
308                     throw new IllegalStateException(ex.toString());
309                 }
310             }
311             public java.lang.Object newInstance(java.lang.Object parent) {
312                 return null;
313             }
314         };
315         desc.setHandler(handler);
316         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
317         desc.setMultivalued(false);
318         addFieldDescriptor(desc);
319         
320         //-- validation code for: _value
321         fieldValidator = new org.exolab.castor.xml.FieldValidator();
322         { //-- local scope
323             org.exolab.castor.xml.validators.FloatValidator typeValidator;
324             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
325             fieldValidator.setValidator(typeValidator);
326             typeValidator.setMinInclusive((float) -3.4028235E38);
327             typeValidator.setMaxInclusive((float) 3.4028235E38);
328         }
329         desc.setValidator(fieldValidator);
330     }
331
332
333       //-----------/
334      //- Methods -/
335     //-----------/
336
337     /**
338      * Method getAccessMode.
339      * 
340      * @return the access mode specified for this class.
341      */
342     public org.exolab.castor.mapping.AccessMode getAccessMode(
343     ) {
344         return null;
345     }
346
347     /**
348      * Method getIdentity.
349      * 
350      * @return the identity field, null if this class has no
351      * identity.
352      */
353     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
354     ) {
355         return super.getIdentity();
356     }
357
358     /**
359      * Method getJavaClass.
360      * 
361      * @return the Java class represented by this descriptor.
362      */
363     public java.lang.Class getJavaClass(
364     ) {
365         return jalview.schemabinding.version2.AnnotationElement.class;
366     }
367
368     /**
369      * Method getNameSpacePrefix.
370      * 
371      * @return the namespace prefix to use when marshaling as XML.
372      */
373     public java.lang.String getNameSpacePrefix(
374     ) {
375         return _nsPrefix;
376     }
377
378     /**
379      * Method getNameSpaceURI.
380      * 
381      * @return the namespace URI used when marshaling and
382      * unmarshaling as XML.
383      */
384     public java.lang.String getNameSpaceURI(
385     ) {
386         return _nsURI;
387     }
388
389     /**
390      * Method getValidator.
391      * 
392      * @return a specific validator for the class described by this
393      * ClassDescriptor.
394      */
395     public org.exolab.castor.xml.TypeValidator getValidator(
396     ) {
397         return this;
398     }
399
400     /**
401      * Method getXMLName.
402      * 
403      * @return the XML Name for the Class being described.
404      */
405     public java.lang.String getXMLName(
406     ) {
407         return _xmlName;
408     }
409
410     /**
411      * Method isElementDefinition.
412      * 
413      * @return true if XML schema definition of this Class is that
414      * of a global
415      * element or element with anonymous type definition.
416      */
417     public boolean isElementDefinition(
418     ) {
419         return _elementDefinition;
420     }
421
422 }