09ffdfcaebfcc4f6ca7343513154be78fffa3987
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceSetDescriptor.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.  
17  * If not, see <http://www.gnu.org/licenses/>.
18  * The Jalview Authors are detailed in the 'AUTHORS' file.
19  ******************************************************************************/
20 /*
21  * This class was automatically generated with 
22  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
23  * Schema.
24  * $Id$
25  */
26
27 package jalview.schemabinding.version2.descriptors;
28
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
32
33 import jalview.schemabinding.version2.SequenceSet;
34
35 /**
36  * Class SequenceSetDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class SequenceSetDescriptor extends
41         org.exolab.castor.xml.util.XMLClassDescriptorImpl
42 {
43
44   // --------------------------/
45   // - Class/Member Variables -/
46   // --------------------------/
47
48   /**
49    * Field _elementDefinition.
50    */
51   private boolean _elementDefinition;
52
53   /**
54    * Field _nsPrefix.
55    */
56   private java.lang.String _nsPrefix;
57
58   /**
59    * Field _nsURI.
60    */
61   private java.lang.String _nsURI;
62
63   /**
64    * Field _xmlName.
65    */
66   private java.lang.String _xmlName;
67
68   // ----------------/
69   // - Constructors -/
70   // ----------------/
71
72   public SequenceSetDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "SequenceSet";
77     _elementDefinition = true;
78
79     // -- set grouping compositor
80     setCompositorAsSequence();
81     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
82     org.exolab.castor.mapping.FieldHandler handler = null;
83     org.exolab.castor.xml.FieldValidator fieldValidator = null;
84     // -- initialize attribute descriptors
85
86     // -- _gapChar
87     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88             java.lang.String.class, "_gapChar", "gapChar",
89             org.exolab.castor.xml.NodeType.Attribute);
90     desc.setImmutable(true);
91     handler = new org.exolab.castor.xml.XMLFieldHandler()
92     {
93       public java.lang.Object getValue(java.lang.Object object)
94               throws IllegalStateException
95       {
96         SequenceSet target = (SequenceSet) object;
97         return target.getGapChar();
98       }
99
100       public void setValue(java.lang.Object object, java.lang.Object value)
101               throws IllegalStateException, IllegalArgumentException
102       {
103         try
104         {
105           SequenceSet target = (SequenceSet) object;
106           target.setGapChar((java.lang.String) value);
107         } catch (java.lang.Exception ex)
108         {
109           throw new IllegalStateException(ex.toString());
110         }
111       }
112
113       public java.lang.Object newInstance(java.lang.Object parent)
114       {
115         return null;
116       }
117     };
118     desc.setHandler(handler);
119     desc.setRequired(true);
120     desc.setMultivalued(false);
121     addFieldDescriptor(desc);
122
123     // -- validation code for: _gapChar
124     fieldValidator = new org.exolab.castor.xml.FieldValidator();
125     fieldValidator.setMinOccurs(1);
126     { // -- local scope
127       org.exolab.castor.xml.validators.StringValidator typeValidator;
128       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
129       fieldValidator.setValidator(typeValidator);
130       typeValidator.setWhiteSpace("preserve");
131     }
132     desc.setValidator(fieldValidator);
133     // -- _datasetId
134     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
135             java.lang.String.class, "_datasetId", "datasetId",
136             org.exolab.castor.xml.NodeType.Attribute);
137     desc.setImmutable(true);
138     handler = new org.exolab.castor.xml.XMLFieldHandler()
139     {
140       public java.lang.Object getValue(java.lang.Object object)
141               throws IllegalStateException
142       {
143         SequenceSet target = (SequenceSet) object;
144         return target.getDatasetId();
145       }
146
147       public void setValue(java.lang.Object object, java.lang.Object value)
148               throws IllegalStateException, IllegalArgumentException
149       {
150         try
151         {
152           SequenceSet target = (SequenceSet) object;
153           target.setDatasetId((java.lang.String) value);
154         } catch (java.lang.Exception ex)
155         {
156           throw new IllegalStateException(ex.toString());
157         }
158       }
159
160       public java.lang.Object newInstance(java.lang.Object parent)
161       {
162         return null;
163       }
164     };
165     desc.setHandler(handler);
166     desc.setMultivalued(false);
167     addFieldDescriptor(desc);
168
169     // -- validation code for: _datasetId
170     fieldValidator = new org.exolab.castor.xml.FieldValidator();
171     { // -- local scope
172       org.exolab.castor.xml.validators.StringValidator typeValidator;
173       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
174       fieldValidator.setValidator(typeValidator);
175       typeValidator.setWhiteSpace("preserve");
176     }
177     desc.setValidator(fieldValidator);
178     // -- initialize element descriptors
179
180     // -- _sequenceList
181     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
182             jalview.schemabinding.version2.Sequence.class, "_sequenceList",
183             "Sequence", org.exolab.castor.xml.NodeType.Element);
184     handler = new org.exolab.castor.xml.XMLFieldHandler()
185     {
186       public java.lang.Object getValue(java.lang.Object object)
187               throws IllegalStateException
188       {
189         SequenceSet target = (SequenceSet) object;
190         return target.getSequence();
191       }
192
193       public void setValue(java.lang.Object object, java.lang.Object value)
194               throws IllegalStateException, IllegalArgumentException
195       {
196         try
197         {
198           SequenceSet target = (SequenceSet) object;
199           target.addSequence((jalview.schemabinding.version2.Sequence) value);
200         } catch (java.lang.Exception ex)
201         {
202           throw new IllegalStateException(ex.toString());
203         }
204       }
205
206       public void resetValue(Object object) throws IllegalStateException,
207               IllegalArgumentException
208       {
209         try
210         {
211           SequenceSet target = (SequenceSet) object;
212           target.removeAllSequence();
213         } catch (java.lang.Exception ex)
214         {
215           throw new IllegalStateException(ex.toString());
216         }
217       }
218
219       public java.lang.Object newInstance(java.lang.Object parent)
220       {
221         return new jalview.schemabinding.version2.Sequence();
222       }
223     };
224     desc.setHandler(handler);
225     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
226     desc.setMultivalued(true);
227     addFieldDescriptor(desc);
228
229     // -- validation code for: _sequenceList
230     fieldValidator = new org.exolab.castor.xml.FieldValidator();
231     fieldValidator.setMinOccurs(0);
232     { // -- local scope
233     }
234     desc.setValidator(fieldValidator);
235     // -- _annotationList
236     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
237             jalview.schemabinding.version2.Annotation.class,
238             "_annotationList", "Annotation",
239             org.exolab.castor.xml.NodeType.Element);
240     handler = new org.exolab.castor.xml.XMLFieldHandler()
241     {
242       public java.lang.Object getValue(java.lang.Object object)
243               throws IllegalStateException
244       {
245         SequenceSet target = (SequenceSet) object;
246         return target.getAnnotation();
247       }
248
249       public void setValue(java.lang.Object object, java.lang.Object value)
250               throws IllegalStateException, IllegalArgumentException
251       {
252         try
253         {
254           SequenceSet target = (SequenceSet) object;
255           target.addAnnotation((jalview.schemabinding.version2.Annotation) value);
256         } catch (java.lang.Exception ex)
257         {
258           throw new IllegalStateException(ex.toString());
259         }
260       }
261
262       public void resetValue(Object object) throws IllegalStateException,
263               IllegalArgumentException
264       {
265         try
266         {
267           SequenceSet target = (SequenceSet) object;
268           target.removeAllAnnotation();
269         } catch (java.lang.Exception ex)
270         {
271           throw new IllegalStateException(ex.toString());
272         }
273       }
274
275       public java.lang.Object newInstance(java.lang.Object parent)
276       {
277         return new jalview.schemabinding.version2.Annotation();
278       }
279     };
280     desc.setHandler(handler);
281     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
282     desc.setMultivalued(true);
283     addFieldDescriptor(desc);
284
285     // -- validation code for: _annotationList
286     fieldValidator = new org.exolab.castor.xml.FieldValidator();
287     fieldValidator.setMinOccurs(0);
288     { // -- local scope
289     }
290     desc.setValidator(fieldValidator);
291     // -- _sequenceSetPropertiesList
292     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
293             jalview.schemabinding.version2.SequenceSetProperties.class,
294             "_sequenceSetPropertiesList", "sequenceSetProperties",
295             org.exolab.castor.xml.NodeType.Element);
296     handler = new org.exolab.castor.xml.XMLFieldHandler()
297     {
298       public java.lang.Object getValue(java.lang.Object object)
299               throws IllegalStateException
300       {
301         SequenceSet target = (SequenceSet) object;
302         return target.getSequenceSetProperties();
303       }
304
305       public void setValue(java.lang.Object object, java.lang.Object value)
306               throws IllegalStateException, IllegalArgumentException
307       {
308         try
309         {
310           SequenceSet target = (SequenceSet) object;
311           target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value);
312         } catch (java.lang.Exception ex)
313         {
314           throw new IllegalStateException(ex.toString());
315         }
316       }
317
318       public void resetValue(Object object) throws IllegalStateException,
319               IllegalArgumentException
320       {
321         try
322         {
323           SequenceSet target = (SequenceSet) object;
324           target.removeAllSequenceSetProperties();
325         } catch (java.lang.Exception ex)
326         {
327           throw new IllegalStateException(ex.toString());
328         }
329       }
330
331       public java.lang.Object newInstance(java.lang.Object parent)
332       {
333         return new jalview.schemabinding.version2.SequenceSetProperties();
334       }
335     };
336     desc.setHandler(handler);
337     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
338     desc.setMultivalued(true);
339     addFieldDescriptor(desc);
340
341     // -- validation code for: _sequenceSetPropertiesList
342     fieldValidator = new org.exolab.castor.xml.FieldValidator();
343     fieldValidator.setMinOccurs(0);
344     { // -- local scope
345     }
346     desc.setValidator(fieldValidator);
347     // -- _alcodonFrameList
348     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
349             jalview.schemabinding.version2.AlcodonFrame.class,
350             "_alcodonFrameList", "AlcodonFrame",
351             org.exolab.castor.xml.NodeType.Element);
352     handler = new org.exolab.castor.xml.XMLFieldHandler()
353     {
354       public java.lang.Object getValue(java.lang.Object object)
355               throws IllegalStateException
356       {
357         SequenceSet target = (SequenceSet) object;
358         return target.getAlcodonFrame();
359       }
360
361       public void setValue(java.lang.Object object, java.lang.Object value)
362               throws IllegalStateException, IllegalArgumentException
363       {
364         try
365         {
366           SequenceSet target = (SequenceSet) object;
367           target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value);
368         } catch (java.lang.Exception ex)
369         {
370           throw new IllegalStateException(ex.toString());
371         }
372       }
373
374       public void resetValue(Object object) throws IllegalStateException,
375               IllegalArgumentException
376       {
377         try
378         {
379           SequenceSet target = (SequenceSet) object;
380           target.removeAllAlcodonFrame();
381         } catch (java.lang.Exception ex)
382         {
383           throw new IllegalStateException(ex.toString());
384         }
385       }
386
387       public java.lang.Object newInstance(java.lang.Object parent)
388       {
389         return new jalview.schemabinding.version2.AlcodonFrame();
390       }
391     };
392     desc.setHandler(handler);
393     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
394     desc.setMultivalued(true);
395     addFieldDescriptor(desc);
396
397     // -- validation code for: _alcodonFrameList
398     fieldValidator = new org.exolab.castor.xml.FieldValidator();
399     fieldValidator.setMinOccurs(0);
400     { // -- local scope
401     }
402     desc.setValidator(fieldValidator);
403   }
404
405   // -----------/
406   // - Methods -/
407   // -----------/
408
409   /**
410    * Method getAccessMode.
411    * 
412    * @return the access mode specified for this class.
413    */
414   public org.exolab.castor.mapping.AccessMode getAccessMode()
415   {
416     return null;
417   }
418
419   /**
420    * Method getIdentity.
421    * 
422    * @return the identity field, null if this class has no identity.
423    */
424   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
425   {
426     return super.getIdentity();
427   }
428
429   /**
430    * Method getJavaClass.
431    * 
432    * @return the Java class represented by this descriptor.
433    */
434   public java.lang.Class getJavaClass()
435   {
436     return jalview.schemabinding.version2.SequenceSet.class;
437   }
438
439   /**
440    * Method getNameSpacePrefix.
441    * 
442    * @return the namespace prefix to use when marshaling as XML.
443    */
444   public java.lang.String getNameSpacePrefix()
445   {
446     return _nsPrefix;
447   }
448
449   /**
450    * Method getNameSpaceURI.
451    * 
452    * @return the namespace URI used when marshaling and unmarshaling as XML.
453    */
454   public java.lang.String getNameSpaceURI()
455   {
456     return _nsURI;
457   }
458
459   /**
460    * Method getValidator.
461    * 
462    * @return a specific validator for the class described by this
463    *         ClassDescriptor.
464    */
465   public org.exolab.castor.xml.TypeValidator getValidator()
466   {
467     return this;
468   }
469
470   /**
471    * Method getXMLName.
472    * 
473    * @return the XML Name for the Class being described.
474    */
475   public java.lang.String getXMLName()
476   {
477     return _xmlName;
478   }
479
480   /**
481    * Method isElementDefinition.
482    * 
483    * @return true if XML schema definition of this Class is that of a global
484    *         element or element with anonymous type definition.
485    */
486   public boolean isElementDefinition()
487   {
488     return _elementDefinition;
489   }
490
491 }