update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MapListTypeDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2.descriptors;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import jalview.schemabinding.version2.MapListType;
32
33 /**
34  * Class MapListTypeDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class MapListTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
39
40
41       //--------------------------/
42      //- Class/Member Variables -/
43     //--------------------------/
44
45     /**
46      * Field _elementDefinition.
47      */
48     private boolean _elementDefinition;
49
50     /**
51      * Field _nsPrefix.
52      */
53     private java.lang.String _nsPrefix;
54
55     /**
56      * Field _nsURI.
57      */
58     private java.lang.String _nsURI;
59
60     /**
61      * Field _xmlName.
62      */
63     private java.lang.String _xmlName;
64
65
66       //----------------/
67      //- Constructors -/
68     //----------------/
69
70     public MapListTypeDescriptor() {
71         super();
72         _nsURI = "www.vamsas.ac.uk/jalview/version2";
73         _xmlName = "mapListType";
74         _elementDefinition = false;
75         
76         //-- set grouping compositor
77         setCompositorAsSequence();
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         //-- _mapFromUnit
84         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit", org.exolab.castor.xml.NodeType.Attribute);
85         handler = new org.exolab.castor.xml.XMLFieldHandler() {
86             public java.lang.Object getValue( java.lang.Object object ) 
87                 throws IllegalStateException
88             {
89                 MapListType target = (MapListType) object;
90                 if (!target.hasMapFromUnit()) { return null; }
91                 return new java.lang.Long(target.getMapFromUnit());
92             }
93             public void setValue( java.lang.Object object, java.lang.Object value) 
94                 throws IllegalStateException, IllegalArgumentException
95             {
96                 try {
97                     MapListType target = (MapListType) object;
98                     // ignore null values for non optional primitives
99                     if (value == null) { return; }
100                     
101                     target.setMapFromUnit( ((java.lang.Long) value).longValue());
102                 } catch (java.lang.Exception ex) {
103                     throw new IllegalStateException(ex.toString());
104                 }
105             }
106             public java.lang.Object newInstance(java.lang.Object parent) {
107                 return null;
108             }
109         };
110         desc.setHandler(handler);
111         desc.setRequired(true);
112         desc.setMultivalued(false);
113         addFieldDescriptor(desc);
114         
115         //-- validation code for: _mapFromUnit
116         fieldValidator = new org.exolab.castor.xml.FieldValidator();
117         fieldValidator.setMinOccurs(1);
118         { //-- local scope
119             org.exolab.castor.xml.validators.LongValidator typeValidator;
120             typeValidator = new org.exolab.castor.xml.validators.LongValidator();
121             fieldValidator.setValidator(typeValidator);
122             typeValidator.setMinInclusive(1L);
123         }
124         desc.setValidator(fieldValidator);
125         //-- _mapToUnit
126         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_mapToUnit", "mapToUnit", org.exolab.castor.xml.NodeType.Attribute);
127         handler = new org.exolab.castor.xml.XMLFieldHandler() {
128             public java.lang.Object getValue( java.lang.Object object ) 
129                 throws IllegalStateException
130             {
131                 MapListType target = (MapListType) object;
132                 if (!target.hasMapToUnit()) { return null; }
133                 return new java.lang.Long(target.getMapToUnit());
134             }
135             public void setValue( java.lang.Object object, java.lang.Object value) 
136                 throws IllegalStateException, IllegalArgumentException
137             {
138                 try {
139                     MapListType target = (MapListType) object;
140                     // ignore null values for non optional primitives
141                     if (value == null) { return; }
142                     
143                     target.setMapToUnit( ((java.lang.Long) value).longValue());
144                 } catch (java.lang.Exception ex) {
145                     throw new IllegalStateException(ex.toString());
146                 }
147             }
148             public java.lang.Object newInstance(java.lang.Object parent) {
149                 return null;
150             }
151         };
152         desc.setHandler(handler);
153         desc.setRequired(true);
154         desc.setMultivalued(false);
155         addFieldDescriptor(desc);
156         
157         //-- validation code for: _mapToUnit
158         fieldValidator = new org.exolab.castor.xml.FieldValidator();
159         fieldValidator.setMinOccurs(1);
160         { //-- local scope
161             org.exolab.castor.xml.validators.LongValidator typeValidator;
162             typeValidator = new org.exolab.castor.xml.validators.LongValidator();
163             fieldValidator.setValidator(typeValidator);
164             typeValidator.setMinInclusive(1L);
165         }
166         desc.setValidator(fieldValidator);
167         //-- initialize element descriptors
168         
169         //-- _mapListFromList
170         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MapListFrom.class, "_mapListFromList", "mapListFrom", org.exolab.castor.xml.NodeType.Element);
171         handler = new org.exolab.castor.xml.XMLFieldHandler() {
172             public java.lang.Object getValue( java.lang.Object object ) 
173                 throws IllegalStateException
174             {
175                 MapListType target = (MapListType) object;
176                 return target.getMapListFrom();
177             }
178             public void setValue( java.lang.Object object, java.lang.Object value) 
179                 throws IllegalStateException, IllegalArgumentException
180             {
181                 try {
182                     MapListType target = (MapListType) object;
183                     target.addMapListFrom( (jalview.schemabinding.version2.MapListFrom) value);
184                 } catch (java.lang.Exception ex) {
185                     throw new IllegalStateException(ex.toString());
186                 }
187             }
188             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
189                 try {
190                     MapListType target = (MapListType) object;
191                     target.removeAllMapListFrom();
192                 } catch (java.lang.Exception ex) {
193                     throw new IllegalStateException(ex.toString());
194                 }
195             }
196             public java.lang.Object newInstance(java.lang.Object parent) {
197                 return new jalview.schemabinding.version2.MapListFrom();
198             }
199         };
200         desc.setHandler(handler);
201         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
202         desc.setMultivalued(true);
203         addFieldDescriptor(desc);
204         
205         //-- validation code for: _mapListFromList
206         fieldValidator = new org.exolab.castor.xml.FieldValidator();
207         fieldValidator.setMinOccurs(0);
208         { //-- local scope
209         }
210         desc.setValidator(fieldValidator);
211         //-- _mapListToList
212         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MapListTo.class, "_mapListToList", "mapListTo", org.exolab.castor.xml.NodeType.Element);
213         handler = new org.exolab.castor.xml.XMLFieldHandler() {
214             public java.lang.Object getValue( java.lang.Object object ) 
215                 throws IllegalStateException
216             {
217                 MapListType target = (MapListType) object;
218                 return target.getMapListTo();
219             }
220             public void setValue( java.lang.Object object, java.lang.Object value) 
221                 throws IllegalStateException, IllegalArgumentException
222             {
223                 try {
224                     MapListType target = (MapListType) object;
225                     target.addMapListTo( (jalview.schemabinding.version2.MapListTo) value);
226                 } catch (java.lang.Exception ex) {
227                     throw new IllegalStateException(ex.toString());
228                 }
229             }
230             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
231                 try {
232                     MapListType target = (MapListType) object;
233                     target.removeAllMapListTo();
234                 } catch (java.lang.Exception ex) {
235                     throw new IllegalStateException(ex.toString());
236                 }
237             }
238             public java.lang.Object newInstance(java.lang.Object parent) {
239                 return new jalview.schemabinding.version2.MapListTo();
240             }
241         };
242         desc.setHandler(handler);
243         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
244         desc.setMultivalued(true);
245         addFieldDescriptor(desc);
246         
247         //-- validation code for: _mapListToList
248         fieldValidator = new org.exolab.castor.xml.FieldValidator();
249         fieldValidator.setMinOccurs(0);
250         { //-- local scope
251         }
252         desc.setValidator(fieldValidator);
253     }
254
255
256       //-----------/
257      //- Methods -/
258     //-----------/
259
260     /**
261      * Method getAccessMode.
262      * 
263      * @return the access mode specified for this class.
264      */
265     public org.exolab.castor.mapping.AccessMode getAccessMode(
266     ) {
267         return null;
268     }
269
270     /**
271      * Method getIdentity.
272      * 
273      * @return the identity field, null if this class has no
274      * identity.
275      */
276     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
277     ) {
278         return super.getIdentity();
279     }
280
281     /**
282      * Method getJavaClass.
283      * 
284      * @return the Java class represented by this descriptor.
285      */
286     public java.lang.Class getJavaClass(
287     ) {
288         return jalview.schemabinding.version2.MapListType.class;
289     }
290
291     /**
292      * Method getNameSpacePrefix.
293      * 
294      * @return the namespace prefix to use when marshaling as XML.
295      */
296     public java.lang.String getNameSpacePrefix(
297     ) {
298         return _nsPrefix;
299     }
300
301     /**
302      * Method getNameSpaceURI.
303      * 
304      * @return the namespace URI used when marshaling and
305      * unmarshaling as XML.
306      */
307     public java.lang.String getNameSpaceURI(
308     ) {
309         return _nsURI;
310     }
311
312     /**
313      * Method getValidator.
314      * 
315      * @return a specific validator for the class described by this
316      * ClassDescriptor.
317      */
318     public org.exolab.castor.xml.TypeValidator getValidator(
319     ) {
320         return this;
321     }
322
323     /**
324      * Method getXMLName.
325      * 
326      * @return the XML Name for the Class being described.
327      */
328     public java.lang.String getXMLName(
329     ) {
330         return _xmlName;
331     }
332
333     /**
334      * Method isElementDefinition.
335      * 
336      * @return true if XML schema definition of this Class is that
337      * of a global
338      * element or element with anonymous type definition.
339      */
340     public boolean isElementDefinition(
341     ) {
342         return _elementDefinition;
343     }
344
345 }