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