43a40335fe4480c217a66f1da83e08c56d5e11c2
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MapListToDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.MapListTo;
15
16 /**
17  * Class MapListToDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class MapListToDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * Field _elementDefinition.
30      */
31     private boolean _elementDefinition;
32
33     /**
34      * Field _nsPrefix.
35      */
36     private java.lang.String _nsPrefix;
37
38     /**
39      * Field _nsURI.
40      */
41     private java.lang.String _nsURI;
42
43     /**
44      * Field _xmlName.
45      */
46     private java.lang.String _xmlName;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public MapListToDescriptor() {
54         super();
55         _nsURI = "www.vamsas.ac.uk/jalview/version2";
56         _xmlName = "mapListTo";
57         _elementDefinition = true;
58         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
59         org.exolab.castor.mapping.FieldHandler             handler        = null;
60         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
61         //-- initialize attribute descriptors
62         
63         //-- _start
64         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
65         handler = new org.exolab.castor.xml.XMLFieldHandler() {
66             public java.lang.Object getValue( java.lang.Object object ) 
67                 throws IllegalStateException
68             {
69                 MapListTo target = (MapListTo) object;
70                 if (!target.hasStart()) { return null; }
71                 return new java.lang.Integer(target.getStart());
72             }
73             public void setValue( java.lang.Object object, java.lang.Object value) 
74                 throws IllegalStateException, IllegalArgumentException
75             {
76                 try {
77                     MapListTo target = (MapListTo) object;
78                     // ignore null values for non optional primitives
79                     if (value == null) { return; }
80                     
81                     target.setStart( ((java.lang.Integer) value).intValue());
82                 } catch (java.lang.Exception ex) {
83                     throw new IllegalStateException(ex.toString());
84                 }
85             }
86             public java.lang.Object newInstance(java.lang.Object parent) {
87                 return null;
88             }
89         };
90         desc.setHandler(handler);
91         desc.setRequired(true);
92         desc.setMultivalued(false);
93         addFieldDescriptor(desc);
94         
95         //-- validation code for: _start
96         fieldValidator = new org.exolab.castor.xml.FieldValidator();
97         fieldValidator.setMinOccurs(1);
98         { //-- local scope
99             org.exolab.castor.xml.validators.IntValidator typeValidator;
100             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
101             fieldValidator.setValidator(typeValidator);
102             typeValidator.setMinInclusive(-2147483648);
103             typeValidator.setMaxInclusive(2147483647);
104         }
105         desc.setValidator(fieldValidator);
106         //-- _end
107         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
108         handler = new org.exolab.castor.xml.XMLFieldHandler() {
109             public java.lang.Object getValue( java.lang.Object object ) 
110                 throws IllegalStateException
111             {
112                 MapListTo target = (MapListTo) object;
113                 if (!target.hasEnd()) { return null; }
114                 return new java.lang.Integer(target.getEnd());
115             }
116             public void setValue( java.lang.Object object, java.lang.Object value) 
117                 throws IllegalStateException, IllegalArgumentException
118             {
119                 try {
120                     MapListTo target = (MapListTo) object;
121                     // ignore null values for non optional primitives
122                     if (value == null) { return; }
123                     
124                     target.setEnd( ((java.lang.Integer) value).intValue());
125                 } catch (java.lang.Exception ex) {
126                     throw new IllegalStateException(ex.toString());
127                 }
128             }
129             public java.lang.Object newInstance(java.lang.Object parent) {
130                 return null;
131             }
132         };
133         desc.setHandler(handler);
134         desc.setRequired(true);
135         desc.setMultivalued(false);
136         addFieldDescriptor(desc);
137         
138         //-- validation code for: _end
139         fieldValidator = new org.exolab.castor.xml.FieldValidator();
140         fieldValidator.setMinOccurs(1);
141         { //-- local scope
142             org.exolab.castor.xml.validators.IntValidator typeValidator;
143             typeValidator = new org.exolab.castor.xml.validators.IntValidator();
144             fieldValidator.setValidator(typeValidator);
145             typeValidator.setMinInclusive(-2147483648);
146             typeValidator.setMaxInclusive(2147483647);
147         }
148         desc.setValidator(fieldValidator);
149         //-- initialize element descriptors
150         
151     }
152
153
154       //-----------/
155      //- Methods -/
156     //-----------/
157
158     /**
159      * Method getAccessMode.
160      * 
161      * @return the access mode specified for this class.
162      */
163     public org.exolab.castor.mapping.AccessMode getAccessMode(
164     ) {
165         return null;
166     }
167
168     /**
169      * Method getIdentity.
170      * 
171      * @return the identity field, null if this class has no
172      * identity.
173      */
174     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
175     ) {
176         return super.getIdentity();
177     }
178
179     /**
180      * Method getJavaClass.
181      * 
182      * @return the Java class represented by this descriptor.
183      */
184     public java.lang.Class getJavaClass(
185     ) {
186         return jalview.schemabinding.version2.MapListTo.class;
187     }
188
189     /**
190      * Method getNameSpacePrefix.
191      * 
192      * @return the namespace prefix to use when marshaling as XML.
193      */
194     public java.lang.String getNameSpacePrefix(
195     ) {
196         return _nsPrefix;
197     }
198
199     /**
200      * Method getNameSpaceURI.
201      * 
202      * @return the namespace URI used when marshaling and
203      * unmarshaling as XML.
204      */
205     public java.lang.String getNameSpaceURI(
206     ) {
207         return _nsURI;
208     }
209
210     /**
211      * Method getValidator.
212      * 
213      * @return a specific validator for the class described by this
214      * ClassDescriptor.
215      */
216     public org.exolab.castor.xml.TypeValidator getValidator(
217     ) {
218         return this;
219     }
220
221     /**
222      * Method getXMLName.
223      * 
224      * @return the XML Name for the Class being described.
225      */
226     public java.lang.String getXMLName(
227     ) {
228         return _xmlName;
229     }
230
231     /**
232      * Method isElementDefinition.
233      * 
234      * @return true if XML schema definition of this Class is that
235      * of a global
236      * element or element with anonymous type definition.
237      */
238     public boolean isElementDefinition(
239     ) {
240         return _elementDefinition;
241     }
242
243 }