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