JAL-1503 update version in GPL header
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MapListToDescriptor.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.MapListTo;
34
35 /**
36  * Class MapListToDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class MapListToDescriptor 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 MapListToDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "mapListTo";
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     // -- _start
84     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
85             java.lang.Integer.TYPE, "_start", "start",
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         MapListTo target = (MapListTo) object;
93         if (!target.hasStart())
94         {
95           return null;
96         }
97         return new java.lang.Integer(target.getStart());
98       }
99
100       public void setValue(java.lang.Object object, java.lang.Object value)
101               throws IllegalStateException, IllegalArgumentException
102       {
103         try
104         {
105           MapListTo target = (MapListTo) object;
106           // ignore null values for non optional primitives
107           if (value == null)
108           {
109             return;
110           }
111
112           target.setStart(((java.lang.Integer) value).intValue());
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.setRequired(true);
126     desc.setMultivalued(false);
127     addFieldDescriptor(desc);
128
129     // -- validation code for: _start
130     fieldValidator = new org.exolab.castor.xml.FieldValidator();
131     fieldValidator.setMinOccurs(1);
132     { // -- local scope
133       org.exolab.castor.xml.validators.IntValidator typeValidator;
134       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
135       fieldValidator.setValidator(typeValidator);
136       typeValidator.setMinInclusive(-2147483648);
137       typeValidator.setMaxInclusive(2147483647);
138     }
139     desc.setValidator(fieldValidator);
140     // -- _end
141     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
142             java.lang.Integer.TYPE, "_end", "end",
143             org.exolab.castor.xml.NodeType.Attribute);
144     handler = new org.exolab.castor.xml.XMLFieldHandler()
145     {
146       public java.lang.Object getValue(java.lang.Object object)
147               throws IllegalStateException
148       {
149         MapListTo target = (MapListTo) object;
150         if (!target.hasEnd())
151         {
152           return null;
153         }
154         return new java.lang.Integer(target.getEnd());
155       }
156
157       public void setValue(java.lang.Object object, java.lang.Object value)
158               throws IllegalStateException, IllegalArgumentException
159       {
160         try
161         {
162           MapListTo target = (MapListTo) object;
163           // ignore null values for non optional primitives
164           if (value == null)
165           {
166             return;
167           }
168
169           target.setEnd(((java.lang.Integer) value).intValue());
170         } catch (java.lang.Exception ex)
171         {
172           throw new IllegalStateException(ex.toString());
173         }
174       }
175
176       public java.lang.Object newInstance(java.lang.Object parent)
177       {
178         return null;
179       }
180     };
181     desc.setHandler(handler);
182     desc.setRequired(true);
183     desc.setMultivalued(false);
184     addFieldDescriptor(desc);
185
186     // -- validation code for: _end
187     fieldValidator = new org.exolab.castor.xml.FieldValidator();
188     fieldValidator.setMinOccurs(1);
189     { // -- local scope
190       org.exolab.castor.xml.validators.IntValidator typeValidator;
191       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
192       fieldValidator.setValidator(typeValidator);
193       typeValidator.setMinInclusive(-2147483648);
194       typeValidator.setMaxInclusive(2147483647);
195     }
196     desc.setValidator(fieldValidator);
197     // -- initialize element descriptors
198
199   }
200
201   // -----------/
202   // - Methods -/
203   // -----------/
204
205   /**
206    * Method getAccessMode.
207    * 
208    * @return the access mode specified for this class.
209    */
210   public org.exolab.castor.mapping.AccessMode getAccessMode()
211   {
212     return null;
213   }
214
215   /**
216    * Method getIdentity.
217    * 
218    * @return the identity field, null if this class has no identity.
219    */
220   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
221   {
222     return super.getIdentity();
223   }
224
225   /**
226    * Method getJavaClass.
227    * 
228    * @return the Java class represented by this descriptor.
229    */
230   public java.lang.Class getJavaClass()
231   {
232     return jalview.schemabinding.version2.MapListTo.class;
233   }
234
235   /**
236    * Method getNameSpacePrefix.
237    * 
238    * @return the namespace prefix to use when marshaling as XML.
239    */
240   public java.lang.String getNameSpacePrefix()
241   {
242     return _nsPrefix;
243   }
244
245   /**
246    * Method getNameSpaceURI.
247    * 
248    * @return the namespace URI used when marshaling and unmarshaling as XML.
249    */
250   public java.lang.String getNameSpaceURI()
251   {
252     return _nsURI;
253   }
254
255   /**
256    * Method getValidator.
257    * 
258    * @return a specific validator for the class described by this
259    *         ClassDescriptor.
260    */
261   public org.exolab.castor.xml.TypeValidator getValidator()
262   {
263     return this;
264   }
265
266   /**
267    * Method getXMLName.
268    * 
269    * @return the XML Name for the Class being described.
270    */
271   public java.lang.String getXMLName()
272   {
273     return _xmlName;
274   }
275
276   /**
277    * Method isElementDefinition.
278    * 
279    * @return true if XML schema definition of this Class is that of a global
280    *         element or element with anonymous type definition.
281    */
282   public boolean isElementDefinition()
283   {
284     return _elementDefinition;
285   }
286
287 }