aafcfc67a5a3e4e5660ca3fcb16802e60b22c6a0
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / AlcodonDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $(date) 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
10  * of the License, or (at your option) any later version.
11  *   
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  *******************************************************************************/
21 /*
22  * This class was automatically generated with 
23  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
24  * Schema.
25  * $Id$
26  */
27
28 package jalview.schemabinding.version2.descriptors;
29
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
33
34 import jalview.schemabinding.version2.Alcodon;
35
36 /**
37  * Class AlcodonDescriptor.
38  * 
39  * @version $Revision$ $Date$
40  */
41 public class AlcodonDescriptor extends
42         org.exolab.castor.xml.util.XMLClassDescriptorImpl
43 {
44
45   // --------------------------/
46   // - Class/Member Variables -/
47   // --------------------------/
48
49   /**
50    * Field _elementDefinition.
51    */
52   private boolean _elementDefinition;
53
54   /**
55    * Field _nsPrefix.
56    */
57   private java.lang.String _nsPrefix;
58
59   /**
60    * Field _nsURI.
61    */
62   private java.lang.String _nsURI;
63
64   /**
65    * Field _xmlName.
66    */
67   private java.lang.String _xmlName;
68
69   // ----------------/
70   // - Constructors -/
71   // ----------------/
72
73   public AlcodonDescriptor()
74   {
75     super();
76     _nsURI = "www.vamsas.ac.uk/jalview/version2";
77     _xmlName = "alcodon";
78     _elementDefinition = true;
79     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
80     org.exolab.castor.mapping.FieldHandler handler = null;
81     org.exolab.castor.xml.FieldValidator fieldValidator = null;
82     // -- initialize attribute descriptors
83
84     // -- _pos1
85     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
86             java.lang.Long.TYPE, "_pos1", "pos1",
87             org.exolab.castor.xml.NodeType.Attribute);
88     handler = new org.exolab.castor.xml.XMLFieldHandler()
89     {
90       public java.lang.Object getValue(java.lang.Object object)
91               throws IllegalStateException
92       {
93         Alcodon target = (Alcodon) object;
94         if (!target.hasPos1())
95         {
96           return null;
97         }
98         return new java.lang.Long(target.getPos1());
99       }
100
101       public void setValue(java.lang.Object object, java.lang.Object value)
102               throws IllegalStateException, IllegalArgumentException
103       {
104         try
105         {
106           Alcodon target = (Alcodon) object;
107           // if null, use delete method for optional primitives
108           if (value == null)
109           {
110             target.deletePos1();
111             return;
112           }
113           target.setPos1(((java.lang.Long) value).longValue());
114         } catch (java.lang.Exception ex)
115         {
116           throw new IllegalStateException(ex.toString());
117         }
118       }
119
120       public java.lang.Object newInstance(java.lang.Object parent)
121       {
122         return null;
123       }
124     };
125     desc.setHandler(handler);
126     desc.setMultivalued(false);
127     addFieldDescriptor(desc);
128
129     // -- validation code for: _pos1
130     fieldValidator = new org.exolab.castor.xml.FieldValidator();
131     { // -- local scope
132       org.exolab.castor.xml.validators.LongValidator typeValidator;
133       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
134       fieldValidator.setValidator(typeValidator);
135     }
136     desc.setValidator(fieldValidator);
137     // -- _pos2
138     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
139             java.lang.Long.TYPE, "_pos2", "pos2",
140             org.exolab.castor.xml.NodeType.Attribute);
141     handler = new org.exolab.castor.xml.XMLFieldHandler()
142     {
143       public java.lang.Object getValue(java.lang.Object object)
144               throws IllegalStateException
145       {
146         Alcodon target = (Alcodon) object;
147         if (!target.hasPos2())
148         {
149           return null;
150         }
151         return new java.lang.Long(target.getPos2());
152       }
153
154       public void setValue(java.lang.Object object, java.lang.Object value)
155               throws IllegalStateException, IllegalArgumentException
156       {
157         try
158         {
159           Alcodon target = (Alcodon) object;
160           // if null, use delete method for optional primitives
161           if (value == null)
162           {
163             target.deletePos2();
164             return;
165           }
166           target.setPos2(((java.lang.Long) value).longValue());
167         } catch (java.lang.Exception ex)
168         {
169           throw new IllegalStateException(ex.toString());
170         }
171       }
172
173       public java.lang.Object newInstance(java.lang.Object parent)
174       {
175         return null;
176       }
177     };
178     desc.setHandler(handler);
179     desc.setMultivalued(false);
180     addFieldDescriptor(desc);
181
182     // -- validation code for: _pos2
183     fieldValidator = new org.exolab.castor.xml.FieldValidator();
184     { // -- local scope
185       org.exolab.castor.xml.validators.LongValidator typeValidator;
186       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
187       fieldValidator.setValidator(typeValidator);
188     }
189     desc.setValidator(fieldValidator);
190     // -- _pos3
191     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
192             java.lang.Long.TYPE, "_pos3", "pos3",
193             org.exolab.castor.xml.NodeType.Attribute);
194     handler = new org.exolab.castor.xml.XMLFieldHandler()
195     {
196       public java.lang.Object getValue(java.lang.Object object)
197               throws IllegalStateException
198       {
199         Alcodon target = (Alcodon) object;
200         if (!target.hasPos3())
201         {
202           return null;
203         }
204         return new java.lang.Long(target.getPos3());
205       }
206
207       public void setValue(java.lang.Object object, java.lang.Object value)
208               throws IllegalStateException, IllegalArgumentException
209       {
210         try
211         {
212           Alcodon target = (Alcodon) object;
213           // if null, use delete method for optional primitives
214           if (value == null)
215           {
216             target.deletePos3();
217             return;
218           }
219           target.setPos3(((java.lang.Long) value).longValue());
220         } catch (java.lang.Exception ex)
221         {
222           throw new IllegalStateException(ex.toString());
223         }
224       }
225
226       public java.lang.Object newInstance(java.lang.Object parent)
227       {
228         return null;
229       }
230     };
231     desc.setHandler(handler);
232     desc.setMultivalued(false);
233     addFieldDescriptor(desc);
234
235     // -- validation code for: _pos3
236     fieldValidator = new org.exolab.castor.xml.FieldValidator();
237     { // -- local scope
238       org.exolab.castor.xml.validators.LongValidator typeValidator;
239       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
240       fieldValidator.setValidator(typeValidator);
241     }
242     desc.setValidator(fieldValidator);
243     // -- initialize element descriptors
244
245   }
246
247   // -----------/
248   // - Methods -/
249   // -----------/
250
251   /**
252    * Method getAccessMode.
253    * 
254    * @return the access mode specified for this class.
255    */
256   public org.exolab.castor.mapping.AccessMode getAccessMode()
257   {
258     return null;
259   }
260
261   /**
262    * Method getIdentity.
263    * 
264    * @return the identity field, null if this class has no identity.
265    */
266   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
267   {
268     return super.getIdentity();
269   }
270
271   /**
272    * Method getJavaClass.
273    * 
274    * @return the Java class represented by this descriptor.
275    */
276   public java.lang.Class getJavaClass()
277   {
278     return jalview.schemabinding.version2.Alcodon.class;
279   }
280
281   /**
282    * Method getNameSpacePrefix.
283    * 
284    * @return the namespace prefix to use when marshaling as XML.
285    */
286   public java.lang.String getNameSpacePrefix()
287   {
288     return _nsPrefix;
289   }
290
291   /**
292    * Method getNameSpaceURI.
293    * 
294    * @return the namespace URI used when marshaling and unmarshaling as XML.
295    */
296   public java.lang.String getNameSpaceURI()
297   {
298     return _nsURI;
299   }
300
301   /**
302    * Method getValidator.
303    * 
304    * @return a specific validator for the class described by this
305    *         ClassDescriptor.
306    */
307   public org.exolab.castor.xml.TypeValidator getValidator()
308   {
309     return this;
310   }
311
312   /**
313    * Method getXMLName.
314    * 
315    * @return the XML Name for the Class being described.
316    */
317   public java.lang.String getXMLName()
318   {
319     return _xmlName;
320   }
321
322   /**
323    * Method isElementDefinition.
324    * 
325    * @return true if XML schema definition of this Class is that of a global
326    *         element or element with anonymous type definition.
327    */
328   public boolean isElementDefinition()
329   {
330     return _elementDefinition;
331   }
332
333 }