update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / ThresholdLineDescriptor.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.ThresholdLine;
32
33 /**
34  * Class ThresholdLineDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class ThresholdLineDescriptor 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 ThresholdLineDescriptor() {
71         super();
72         _nsURI = "www.vamsas.ac.uk/jalview/version2";
73         _xmlName = "thresholdLine";
74         _elementDefinition = true;
75         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
76         org.exolab.castor.mapping.FieldHandler             handler        = null;
77         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
78         //-- initialize attribute descriptors
79         
80         //-- _label
81         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", org.exolab.castor.xml.NodeType.Attribute);
82         desc.setImmutable(true);
83         handler = new org.exolab.castor.xml.XMLFieldHandler() {
84             public java.lang.Object getValue( java.lang.Object object ) 
85                 throws IllegalStateException
86             {
87                 ThresholdLine target = (ThresholdLine) object;
88                 return target.getLabel();
89             }
90             public void setValue( java.lang.Object object, java.lang.Object value) 
91                 throws IllegalStateException, IllegalArgumentException
92             {
93                 try {
94                     ThresholdLine target = (ThresholdLine) object;
95                     target.setLabel( (java.lang.String) value);
96                 } catch (java.lang.Exception ex) {
97                     throw new IllegalStateException(ex.toString());
98                 }
99             }
100             public java.lang.Object newInstance(java.lang.Object parent) {
101                 return null;
102             }
103         };
104         desc.setHandler(handler);
105         desc.setMultivalued(false);
106         addFieldDescriptor(desc);
107         
108         //-- validation code for: _label
109         fieldValidator = new org.exolab.castor.xml.FieldValidator();
110         { //-- local scope
111             org.exolab.castor.xml.validators.StringValidator typeValidator;
112             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
113             fieldValidator.setValidator(typeValidator);
114             typeValidator.setWhiteSpace("preserve");
115         }
116         desc.setValidator(fieldValidator);
117         //-- _value
118         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
119         handler = new org.exolab.castor.xml.XMLFieldHandler() {
120             public java.lang.Object getValue( java.lang.Object object ) 
121                 throws IllegalStateException
122             {
123                 ThresholdLine target = (ThresholdLine) object;
124                 if (!target.hasValue()) { return null; }
125                 return new java.lang.Float(target.getValue());
126             }
127             public void setValue( java.lang.Object object, java.lang.Object value) 
128                 throws IllegalStateException, IllegalArgumentException
129             {
130                 try {
131                     ThresholdLine target = (ThresholdLine) object;
132                     // if null, use delete method for optional primitives 
133                     if (value == null) {
134                         target.deleteValue();
135                         return;
136                     }
137                     target.setValue( ((java.lang.Float) value).floatValue());
138                 } catch (java.lang.Exception ex) {
139                     throw new IllegalStateException(ex.toString());
140                 }
141             }
142             public java.lang.Object newInstance(java.lang.Object parent) {
143                 return null;
144             }
145         };
146         desc.setHandler(handler);
147         desc.setMultivalued(false);
148         addFieldDescriptor(desc);
149         
150         //-- validation code for: _value
151         fieldValidator = new org.exolab.castor.xml.FieldValidator();
152         { //-- local scope
153             org.exolab.castor.xml.validators.FloatValidator typeValidator;
154             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
155             fieldValidator.setValidator(typeValidator);
156             typeValidator.setMinInclusive((float) -3.4028235E38);
157             typeValidator.setMaxInclusive((float) 3.4028235E38);
158         }
159         desc.setValidator(fieldValidator);
160         //-- _colour
161         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute);
162         handler = new org.exolab.castor.xml.XMLFieldHandler() {
163             public java.lang.Object getValue( java.lang.Object object ) 
164                 throws IllegalStateException
165             {
166                 ThresholdLine target = (ThresholdLine) object;
167                 if (!target.hasColour()) { return null; }
168                 return new java.lang.Integer(target.getColour());
169             }
170             public void setValue( java.lang.Object object, java.lang.Object value) 
171                 throws IllegalStateException, IllegalArgumentException
172             {
173                 try {
174                     ThresholdLine target = (ThresholdLine) object;
175                     // if null, use delete method for optional primitives 
176                     if (value == null) {
177                         target.deleteColour();
178                         return;
179                     }
180                     target.setColour( ((java.lang.Integer) value).intValue());
181                 } catch (java.lang.Exception ex) {
182                     throw new IllegalStateException(ex.toString());
183                 }
184             }
185             public java.lang.Object newInstance(java.lang.Object parent) {
186                 return null;
187             }
188         };
189         desc.setHandler(handler);
190         desc.setMultivalued(false);
191         addFieldDescriptor(desc);
192         
193         //-- validation code for: _colour
194         fieldValidator = new org.exolab.castor.xml.FieldValidator();
195         { //-- local scope
196             org.exolab.castor.xml.validators.IntValidator typeValidator;
197             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
198             fieldValidator.setValidator(typeValidator);
199             typeValidator.setMinInclusive(-2147483648);
200             typeValidator.setMaxInclusive(2147483647);
201         }
202         desc.setValidator(fieldValidator);
203         //-- initialize element descriptors
204         
205     }
206
207
208       //-----------/
209      //- Methods -/
210     //-----------/
211
212     /**
213      * Method getAccessMode.
214      * 
215      * @return the access mode specified for this class.
216      */
217     public org.exolab.castor.mapping.AccessMode getAccessMode(
218     ) {
219         return null;
220     }
221
222     /**
223      * Method getIdentity.
224      * 
225      * @return the identity field, null if this class has no
226      * identity.
227      */
228     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
229     ) {
230         return super.getIdentity();
231     }
232
233     /**
234      * Method getJavaClass.
235      * 
236      * @return the Java class represented by this descriptor.
237      */
238     public java.lang.Class getJavaClass(
239     ) {
240         return jalview.schemabinding.version2.ThresholdLine.class;
241     }
242
243     /**
244      * Method getNameSpacePrefix.
245      * 
246      * @return the namespace prefix to use when marshaling as XML.
247      */
248     public java.lang.String getNameSpacePrefix(
249     ) {
250         return _nsPrefix;
251     }
252
253     /**
254      * Method getNameSpaceURI.
255      * 
256      * @return the namespace URI used when marshaling and
257      * unmarshaling as XML.
258      */
259     public java.lang.String getNameSpaceURI(
260     ) {
261         return _nsURI;
262     }
263
264     /**
265      * Method getValidator.
266      * 
267      * @return a specific validator for the class described by this
268      * ClassDescriptor.
269      */
270     public org.exolab.castor.xml.TypeValidator getValidator(
271     ) {
272         return this;
273     }
274
275     /**
276      * Method getXMLName.
277      * 
278      * @return the XML Name for the Class being described.
279      */
280     public java.lang.String getXMLName(
281     ) {
282         return _xmlName;
283     }
284
285     /**
286      * Method isElementDefinition.
287      * 
288      * @return true if XML schema definition of this Class is that
289      * of a global
290      * element or element with anonymous type definition.
291      */
292     public boolean isElementDefinition(
293     ) {
294         return _elementDefinition;
295     }
296
297 }