84024496639ab3fc8e74942a01b72f84059b58e6
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MapListTypeDescriptor.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.MapListType;
34
35 /**
36  * Class MapListTypeDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class MapListTypeDescriptor 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 MapListTypeDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "mapListType";
77     _elementDefinition = false;
78
79     // -- set grouping compositor
80     setCompositorAsSequence();
81     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
82     org.exolab.castor.mapping.FieldHandler handler = null;
83     org.exolab.castor.xml.FieldValidator fieldValidator = null;
84     // -- initialize attribute descriptors
85
86     // -- _mapFromUnit
87     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88             java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit",
89             org.exolab.castor.xml.NodeType.Attribute);
90     handler = new org.exolab.castor.xml.XMLFieldHandler()
91     {
92       public java.lang.Object getValue(java.lang.Object object)
93               throws IllegalStateException
94       {
95         MapListType target = (MapListType) object;
96         if (!target.hasMapFromUnit())
97         {
98           return null;
99         }
100         return new java.lang.Long(target.getMapFromUnit());
101       }
102
103       public void setValue(java.lang.Object object, java.lang.Object value)
104               throws IllegalStateException, IllegalArgumentException
105       {
106         try
107         {
108           MapListType target = (MapListType) object;
109           // ignore null values for non optional primitives
110           if (value == null)
111           {
112             return;
113           }
114
115           target.setMapFromUnit(((java.lang.Long) value).longValue());
116         } catch (java.lang.Exception ex)
117         {
118           throw new IllegalStateException(ex.toString());
119         }
120       }
121
122       public java.lang.Object newInstance(java.lang.Object parent)
123       {
124         return null;
125       }
126     };
127     desc.setHandler(handler);
128     desc.setRequired(true);
129     desc.setMultivalued(false);
130     addFieldDescriptor(desc);
131
132     // -- validation code for: _mapFromUnit
133     fieldValidator = new org.exolab.castor.xml.FieldValidator();
134     fieldValidator.setMinOccurs(1);
135     { // -- local scope
136       org.exolab.castor.xml.validators.LongValidator typeValidator;
137       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
138       fieldValidator.setValidator(typeValidator);
139       typeValidator.setMinInclusive(1L);
140     }
141     desc.setValidator(fieldValidator);
142     // -- _mapToUnit
143     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
144             java.lang.Long.TYPE, "_mapToUnit", "mapToUnit",
145             org.exolab.castor.xml.NodeType.Attribute);
146     handler = new org.exolab.castor.xml.XMLFieldHandler()
147     {
148       public java.lang.Object getValue(java.lang.Object object)
149               throws IllegalStateException
150       {
151         MapListType target = (MapListType) object;
152         if (!target.hasMapToUnit())
153         {
154           return null;
155         }
156         return new java.lang.Long(target.getMapToUnit());
157       }
158
159       public void setValue(java.lang.Object object, java.lang.Object value)
160               throws IllegalStateException, IllegalArgumentException
161       {
162         try
163         {
164           MapListType target = (MapListType) object;
165           // ignore null values for non optional primitives
166           if (value == null)
167           {
168             return;
169           }
170
171           target.setMapToUnit(((java.lang.Long) value).longValue());
172         } catch (java.lang.Exception ex)
173         {
174           throw new IllegalStateException(ex.toString());
175         }
176       }
177
178       public java.lang.Object newInstance(java.lang.Object parent)
179       {
180         return null;
181       }
182     };
183     desc.setHandler(handler);
184     desc.setRequired(true);
185     desc.setMultivalued(false);
186     addFieldDescriptor(desc);
187
188     // -- validation code for: _mapToUnit
189     fieldValidator = new org.exolab.castor.xml.FieldValidator();
190     fieldValidator.setMinOccurs(1);
191     { // -- local scope
192       org.exolab.castor.xml.validators.LongValidator typeValidator;
193       typeValidator = new org.exolab.castor.xml.validators.LongValidator();
194       fieldValidator.setValidator(typeValidator);
195       typeValidator.setMinInclusive(1L);
196     }
197     desc.setValidator(fieldValidator);
198     // -- initialize element descriptors
199
200     // -- _mapListFromList
201     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
202             jalview.schemabinding.version2.MapListFrom.class,
203             "_mapListFromList", "mapListFrom",
204             org.exolab.castor.xml.NodeType.Element);
205     handler = new org.exolab.castor.xml.XMLFieldHandler()
206     {
207       public java.lang.Object getValue(java.lang.Object object)
208               throws IllegalStateException
209       {
210         MapListType target = (MapListType) object;
211         return target.getMapListFrom();
212       }
213
214       public void setValue(java.lang.Object object, java.lang.Object value)
215               throws IllegalStateException, IllegalArgumentException
216       {
217         try
218         {
219           MapListType target = (MapListType) object;
220           target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value);
221         } catch (java.lang.Exception ex)
222         {
223           throw new IllegalStateException(ex.toString());
224         }
225       }
226
227       public void resetValue(Object object) throws IllegalStateException,
228               IllegalArgumentException
229       {
230         try
231         {
232           MapListType target = (MapListType) object;
233           target.removeAllMapListFrom();
234         } catch (java.lang.Exception ex)
235         {
236           throw new IllegalStateException(ex.toString());
237         }
238       }
239
240       public java.lang.Object newInstance(java.lang.Object parent)
241       {
242         return new jalview.schemabinding.version2.MapListFrom();
243       }
244     };
245     desc.setHandler(handler);
246     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
247     desc.setMultivalued(true);
248     addFieldDescriptor(desc);
249
250     // -- validation code for: _mapListFromList
251     fieldValidator = new org.exolab.castor.xml.FieldValidator();
252     fieldValidator.setMinOccurs(0);
253     { // -- local scope
254     }
255     desc.setValidator(fieldValidator);
256     // -- _mapListToList
257     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
258             jalview.schemabinding.version2.MapListTo.class,
259             "_mapListToList", "mapListTo",
260             org.exolab.castor.xml.NodeType.Element);
261     handler = new org.exolab.castor.xml.XMLFieldHandler()
262     {
263       public java.lang.Object getValue(java.lang.Object object)
264               throws IllegalStateException
265       {
266         MapListType target = (MapListType) object;
267         return target.getMapListTo();
268       }
269
270       public void setValue(java.lang.Object object, java.lang.Object value)
271               throws IllegalStateException, IllegalArgumentException
272       {
273         try
274         {
275           MapListType target = (MapListType) object;
276           target.addMapListTo((jalview.schemabinding.version2.MapListTo) value);
277         } catch (java.lang.Exception ex)
278         {
279           throw new IllegalStateException(ex.toString());
280         }
281       }
282
283       public void resetValue(Object object) throws IllegalStateException,
284               IllegalArgumentException
285       {
286         try
287         {
288           MapListType target = (MapListType) object;
289           target.removeAllMapListTo();
290         } catch (java.lang.Exception ex)
291         {
292           throw new IllegalStateException(ex.toString());
293         }
294       }
295
296       public java.lang.Object newInstance(java.lang.Object parent)
297       {
298         return new jalview.schemabinding.version2.MapListTo();
299       }
300     };
301     desc.setHandler(handler);
302     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
303     desc.setMultivalued(true);
304     addFieldDescriptor(desc);
305
306     // -- validation code for: _mapListToList
307     fieldValidator = new org.exolab.castor.xml.FieldValidator();
308     fieldValidator.setMinOccurs(0);
309     { // -- local scope
310     }
311     desc.setValidator(fieldValidator);
312   }
313
314   // -----------/
315   // - Methods -/
316   // -----------/
317
318   /**
319    * Method getAccessMode.
320    * 
321    * @return the access mode specified for this class.
322    */
323   public org.exolab.castor.mapping.AccessMode getAccessMode()
324   {
325     return null;
326   }
327
328   /**
329    * Method getIdentity.
330    * 
331    * @return the identity field, null if this class has no identity.
332    */
333   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
334   {
335     return super.getIdentity();
336   }
337
338   /**
339    * Method getJavaClass.
340    * 
341    * @return the Java class represented by this descriptor.
342    */
343   public java.lang.Class getJavaClass()
344   {
345     return jalview.schemabinding.version2.MapListType.class;
346   }
347
348   /**
349    * Method getNameSpacePrefix.
350    * 
351    * @return the namespace prefix to use when marshaling as XML.
352    */
353   public java.lang.String getNameSpacePrefix()
354   {
355     return _nsPrefix;
356   }
357
358   /**
359    * Method getNameSpaceURI.
360    * 
361    * @return the namespace URI used when marshaling and unmarshaling as XML.
362    */
363   public java.lang.String getNameSpaceURI()
364   {
365     return _nsURI;
366   }
367
368   /**
369    * Method getValidator.
370    * 
371    * @return a specific validator for the class described by this
372    *         ClassDescriptor.
373    */
374   public org.exolab.castor.xml.TypeValidator getValidator()
375   {
376     return this;
377   }
378
379   /**
380    * Method getXMLName.
381    * 
382    * @return the XML Name for the Class being described.
383    */
384   public java.lang.String getXMLName()
385   {
386     return _xmlName;
387   }
388
389   /**
390    * Method isElementDefinition.
391    * 
392    * @return true if XML schema definition of this Class is that of a global
393    *         element or element with anonymous type definition.
394    */
395   public boolean isElementDefinition()
396   {
397     return _elementDefinition;
398   }
399
400 }