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