47d6e016db54f40f26ccb4baf514d52cde8e99b1
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / AlcodonDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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.Alcodon;
34
35 /**
36  * Class AlcodonDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class AlcodonDescriptor 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 AlcodonDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "alcodon";
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     // -- _pos1
84     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
85             java.lang.Long.TYPE, "_pos1", "pos1",
86             org.exolab.castor.xml.NodeType.Attribute);
87     handler = new org.exolab.castor.xml.XMLFieldHandler()
88     {
89       public java.lang.Object getValue(java.lang.Object object)
90               throws IllegalStateException
91       {
92         Alcodon target = (Alcodon) object;
93         if (!target.hasPos1())
94         {
95           return null;
96         }
97         return new java.lang.Long(target.getPos1());
98       }
99
100       public void setValue(java.lang.Object object, java.lang.Object value)
101               throws IllegalStateException, IllegalArgumentException
102       {
103         try
104         {
105           Alcodon target = (Alcodon) object;
106           // if null, use delete method for optional primitives
107           if (value == null)
108           {
109             target.deletePos1();
110             return;
111           }
112           target.setPos1(((java.lang.Long) value).longValue());
113         } catch (java.lang.Exception ex)
114         {
115           throw new IllegalStateException(ex.toString());
116         }
117       }
118
119       public java.lang.Object newInstance(java.lang.Object parent)
120       {
121         return null;
122       }
123     };
124     desc.setHandler(handler);
125     desc.setMultivalued(false);
126     addFieldDescriptor(desc);
127
128     // -- validation code for: _pos1
129     fieldValidator = new org.exolab.castor.xml.FieldValidator();
130     { // -- local scope
131       org.exolab.castor.xml.validators.LongValidator typeValidator;
132       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
133       fieldValidator.setValidator(typeValidator);
134     }
135     desc.setValidator(fieldValidator);
136     // -- _pos2
137     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
138             java.lang.Long.TYPE, "_pos2", "pos2",
139             org.exolab.castor.xml.NodeType.Attribute);
140     handler = new org.exolab.castor.xml.XMLFieldHandler()
141     {
142       public java.lang.Object getValue(java.lang.Object object)
143               throws IllegalStateException
144       {
145         Alcodon target = (Alcodon) object;
146         if (!target.hasPos2())
147         {
148           return null;
149         }
150         return new java.lang.Long(target.getPos2());
151       }
152
153       public void setValue(java.lang.Object object, java.lang.Object value)
154               throws IllegalStateException, IllegalArgumentException
155       {
156         try
157         {
158           Alcodon target = (Alcodon) object;
159           // if null, use delete method for optional primitives
160           if (value == null)
161           {
162             target.deletePos2();
163             return;
164           }
165           target.setPos2(((java.lang.Long) value).longValue());
166         } catch (java.lang.Exception ex)
167         {
168           throw new IllegalStateException(ex.toString());
169         }
170       }
171
172       public java.lang.Object newInstance(java.lang.Object parent)
173       {
174         return null;
175       }
176     };
177     desc.setHandler(handler);
178     desc.setMultivalued(false);
179     addFieldDescriptor(desc);
180
181     // -- validation code for: _pos2
182     fieldValidator = new org.exolab.castor.xml.FieldValidator();
183     { // -- local scope
184       org.exolab.castor.xml.validators.LongValidator typeValidator;
185       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
186       fieldValidator.setValidator(typeValidator);
187     }
188     desc.setValidator(fieldValidator);
189     // -- _pos3
190     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
191             java.lang.Long.TYPE, "_pos3", "pos3",
192             org.exolab.castor.xml.NodeType.Attribute);
193     handler = new org.exolab.castor.xml.XMLFieldHandler()
194     {
195       public java.lang.Object getValue(java.lang.Object object)
196               throws IllegalStateException
197       {
198         Alcodon target = (Alcodon) object;
199         if (!target.hasPos3())
200         {
201           return null;
202         }
203         return new java.lang.Long(target.getPos3());
204       }
205
206       public void setValue(java.lang.Object object, java.lang.Object value)
207               throws IllegalStateException, IllegalArgumentException
208       {
209         try
210         {
211           Alcodon target = (Alcodon) object;
212           // if null, use delete method for optional primitives
213           if (value == null)
214           {
215             target.deletePos3();
216             return;
217           }
218           target.setPos3(((java.lang.Long) value).longValue());
219         } catch (java.lang.Exception ex)
220         {
221           throw new IllegalStateException(ex.toString());
222         }
223       }
224
225       public java.lang.Object newInstance(java.lang.Object parent)
226       {
227         return null;
228       }
229     };
230     desc.setHandler(handler);
231     desc.setMultivalued(false);
232     addFieldDescriptor(desc);
233
234     // -- validation code for: _pos3
235     fieldValidator = new org.exolab.castor.xml.FieldValidator();
236     { // -- local scope
237       org.exolab.castor.xml.validators.LongValidator typeValidator;
238       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
239       fieldValidator.setValidator(typeValidator);
240     }
241     desc.setValidator(fieldValidator);
242     // -- initialize element descriptors
243
244   }
245
246   // -----------/
247   // - Methods -/
248   // -----------/
249
250   /**
251    * Method getAccessMode.
252    * 
253    * @return the access mode specified for this class.
254    */
255   public org.exolab.castor.mapping.AccessMode getAccessMode()
256   {
257     return null;
258   }
259
260   /**
261    * Method getIdentity.
262    * 
263    * @return the identity field, null if this class has no identity.
264    */
265   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
266   {
267     return super.getIdentity();
268   }
269
270   /**
271    * Method getJavaClass.
272    * 
273    * @return the Java class represented by this descriptor.
274    */
275   public java.lang.Class getJavaClass()
276   {
277     return jalview.schemabinding.version2.Alcodon.class;
278   }
279
280   /**
281    * Method getNameSpacePrefix.
282    * 
283    * @return the namespace prefix to use when marshaling as XML.
284    */
285   public java.lang.String getNameSpacePrefix()
286   {
287     return _nsPrefix;
288   }
289
290   /**
291    * Method getNameSpaceURI.
292    * 
293    * @return the namespace URI used when marshaling and unmarshaling as XML.
294    */
295   public java.lang.String getNameSpaceURI()
296   {
297     return _nsURI;
298   }
299
300   /**
301    * Method getValidator.
302    * 
303    * @return a specific validator for the class described by this
304    *         ClassDescriptor.
305    */
306   public org.exolab.castor.xml.TypeValidator getValidator()
307   {
308     return this;
309   }
310
311   /**
312    * Method getXMLName.
313    * 
314    * @return the XML Name for the Class being described.
315    */
316   public java.lang.String getXMLName()
317   {
318     return _xmlName;
319   }
320
321   /**
322    * Method isElementDefinition.
323    * 
324    * @return true if XML schema definition of this Class is that of a global
325    *         element or element with anonymous type definition.
326    */
327   public boolean isElementDefinition()
328   {
329     return _elementDefinition;
330   }
331
332 }