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