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