JAL-1503 update version in GPL header
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / ThresholdLineDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
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.ThresholdLine;
34
35 /**
36  * Class ThresholdLineDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class ThresholdLineDescriptor 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 ThresholdLineDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "thresholdLine";
77     _elementDefinition = true;
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     // -- _label
84     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
85             java.lang.String.class, "_label", "label",
86             org.exolab.castor.xml.NodeType.Attribute);
87     desc.setImmutable(true);
88     handler = new org.exolab.castor.xml.XMLFieldHandler()
89     {
90       public java.lang.Object getValue(java.lang.Object object)
91               throws IllegalStateException
92       {
93         ThresholdLine target = (ThresholdLine) object;
94         return target.getLabel();
95       }
96
97       public void setValue(java.lang.Object object, java.lang.Object value)
98               throws IllegalStateException, IllegalArgumentException
99       {
100         try
101         {
102           ThresholdLine target = (ThresholdLine) object;
103           target.setLabel((java.lang.String) value);
104         } catch (java.lang.Exception ex)
105         {
106           throw new IllegalStateException(ex.toString());
107         }
108       }
109
110       public java.lang.Object newInstance(java.lang.Object parent)
111       {
112         return null;
113       }
114     };
115     desc.setHandler(handler);
116     desc.setMultivalued(false);
117     addFieldDescriptor(desc);
118
119     // -- validation code for: _label
120     fieldValidator = new org.exolab.castor.xml.FieldValidator();
121     { // -- local scope
122       org.exolab.castor.xml.validators.StringValidator typeValidator;
123       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
124       fieldValidator.setValidator(typeValidator);
125       typeValidator.setWhiteSpace("preserve");
126     }
127     desc.setValidator(fieldValidator);
128     // -- _value
129     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
130             java.lang.Float.TYPE, "_value", "value",
131             org.exolab.castor.xml.NodeType.Attribute);
132     handler = new org.exolab.castor.xml.XMLFieldHandler()
133     {
134       public java.lang.Object getValue(java.lang.Object object)
135               throws IllegalStateException
136       {
137         ThresholdLine target = (ThresholdLine) object;
138         if (!target.hasValue())
139         {
140           return null;
141         }
142         return new java.lang.Float(target.getValue());
143       }
144
145       public void setValue(java.lang.Object object, java.lang.Object value)
146               throws IllegalStateException, IllegalArgumentException
147       {
148         try
149         {
150           ThresholdLine target = (ThresholdLine) object;
151           // if null, use delete method for optional primitives
152           if (value == null)
153           {
154             target.deleteValue();
155             return;
156           }
157           target.setValue(((java.lang.Float) value).floatValue());
158         } catch (java.lang.Exception ex)
159         {
160           throw new IllegalStateException(ex.toString());
161         }
162       }
163
164       public java.lang.Object newInstance(java.lang.Object parent)
165       {
166         return null;
167       }
168     };
169     desc.setHandler(handler);
170     desc.setMultivalued(false);
171     addFieldDescriptor(desc);
172
173     // -- validation code for: _value
174     fieldValidator = new org.exolab.castor.xml.FieldValidator();
175     { // -- local scope
176       org.exolab.castor.xml.validators.FloatValidator typeValidator;
177       typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
178       fieldValidator.setValidator(typeValidator);
179       typeValidator.setMinInclusive((float) -3.4028235E38);
180       typeValidator.setMaxInclusive((float) 3.4028235E38);
181     }
182     desc.setValidator(fieldValidator);
183     // -- _colour
184     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
185             java.lang.Integer.TYPE, "_colour", "colour",
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         ThresholdLine target = (ThresholdLine) object;
193         if (!target.hasColour())
194         {
195           return null;
196         }
197         return new java.lang.Integer(target.getColour());
198       }
199
200       public void setValue(java.lang.Object object, java.lang.Object value)
201               throws IllegalStateException, IllegalArgumentException
202       {
203         try
204         {
205           ThresholdLine target = (ThresholdLine) object;
206           // if null, use delete method for optional primitives
207           if (value == null)
208           {
209             target.deleteColour();
210             return;
211           }
212           target.setColour(((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: _colour
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     // -- initialize element descriptors
239
240   }
241
242   // -----------/
243   // - Methods -/
244   // -----------/
245
246   /**
247    * Method getAccessMode.
248    * 
249    * @return the access mode specified for this class.
250    */
251   public org.exolab.castor.mapping.AccessMode getAccessMode()
252   {
253     return null;
254   }
255
256   /**
257    * Method getIdentity.
258    * 
259    * @return the identity field, null if this class has no identity.
260    */
261   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
262   {
263     return super.getIdentity();
264   }
265
266   /**
267    * Method getJavaClass.
268    * 
269    * @return the Java class represented by this descriptor.
270    */
271   public java.lang.Class getJavaClass()
272   {
273     return jalview.schemabinding.version2.ThresholdLine.class;
274   }
275
276   /**
277    * Method getNameSpacePrefix.
278    * 
279    * @return the namespace prefix to use when marshaling as XML.
280    */
281   public java.lang.String getNameSpacePrefix()
282   {
283     return _nsPrefix;
284   }
285
286   /**
287    * Method getNameSpaceURI.
288    * 
289    * @return the namespace URI used when marshaling and unmarshaling as XML.
290    */
291   public java.lang.String getNameSpaceURI()
292   {
293     return _nsURI;
294   }
295
296   /**
297    * Method getValidator.
298    * 
299    * @return a specific validator for the class described by this
300    *         ClassDescriptor.
301    */
302   public org.exolab.castor.xml.TypeValidator getValidator()
303   {
304     return this;
305   }
306
307   /**
308    * Method getXMLName.
309    * 
310    * @return the XML Name for the Class being described.
311    */
312   public java.lang.String getXMLName()
313   {
314     return _xmlName;
315   }
316
317   /**
318    * Method isElementDefinition.
319    * 
320    * @return true if XML schema definition of this Class is that of a global
321    *         element or element with anonymous type definition.
322    */
323   public boolean isElementDefinition()
324   {
325     return _elementDefinition;
326   }
327
328 }