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