904bd47ece5b2d2db460dee770b3bb3612fb8564
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceTypeDescriptor.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.SequenceType;
34
35 /**
36  * Class SequenceTypeDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class SequenceTypeDescriptor 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 SequenceTypeDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _xmlName = "SequenceType";
77     _elementDefinition = false;
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     // -- _id
87     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88             java.lang.String.class, "_id", "id",
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         SequenceType target = (SequenceType) object;
97         return target.getId();
98       }
99
100       public void setValue(java.lang.Object object, java.lang.Object value)
101               throws IllegalStateException, IllegalArgumentException
102       {
103         try
104         {
105           SequenceType target = (SequenceType) object;
106           target.setId((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.setMultivalued(false);
120     addFieldDescriptor(desc);
121
122     // -- validation code for: _id
123     fieldValidator = new org.exolab.castor.xml.FieldValidator();
124     { // -- local scope
125       org.exolab.castor.xml.validators.StringValidator typeValidator;
126       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
127       fieldValidator.setValidator(typeValidator);
128       typeValidator.setWhiteSpace("preserve");
129     }
130     desc.setValidator(fieldValidator);
131     // -- _description
132     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
133             java.lang.String.class, "_description", "description",
134             org.exolab.castor.xml.NodeType.Attribute);
135     desc.setImmutable(true);
136     handler = new org.exolab.castor.xml.XMLFieldHandler()
137     {
138       public java.lang.Object getValue(java.lang.Object object)
139               throws IllegalStateException
140       {
141         SequenceType target = (SequenceType) object;
142         return target.getDescription();
143       }
144
145       public void setValue(java.lang.Object object, java.lang.Object value)
146               throws IllegalStateException, IllegalArgumentException
147       {
148         try
149         {
150           SequenceType target = (SequenceType) object;
151           target.setDescription((java.lang.String) value);
152         } catch (java.lang.Exception ex)
153         {
154           throw new IllegalStateException(ex.toString());
155         }
156       }
157
158       public java.lang.Object newInstance(java.lang.Object parent)
159       {
160         return null;
161       }
162     };
163     desc.setHandler(handler);
164     desc.setMultivalued(false);
165     addFieldDescriptor(desc);
166
167     // -- validation code for: _description
168     fieldValidator = new org.exolab.castor.xml.FieldValidator();
169     { // -- local scope
170       org.exolab.castor.xml.validators.StringValidator typeValidator;
171       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
172       fieldValidator.setValidator(typeValidator);
173       typeValidator.setWhiteSpace("preserve");
174     }
175     desc.setValidator(fieldValidator);
176     // -- initialize element descriptors
177
178     // -- _sequence
179     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
180             java.lang.String.class, "_sequence", "sequence",
181             org.exolab.castor.xml.NodeType.Element);
182     desc.setImmutable(true);
183     handler = new org.exolab.castor.xml.XMLFieldHandler()
184     {
185       public java.lang.Object getValue(java.lang.Object object)
186               throws IllegalStateException
187       {
188         SequenceType target = (SequenceType) object;
189         return target.getSequence();
190       }
191
192       public void setValue(java.lang.Object object, java.lang.Object value)
193               throws IllegalStateException, IllegalArgumentException
194       {
195         try
196         {
197           SequenceType target = (SequenceType) object;
198           target.setSequence((java.lang.String) value);
199         } catch (java.lang.Exception ex)
200         {
201           throw new IllegalStateException(ex.toString());
202         }
203       }
204
205       public java.lang.Object newInstance(java.lang.Object parent)
206       {
207         return null;
208       }
209     };
210     desc.setHandler(handler);
211     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
212     desc.setMultivalued(false);
213     addFieldDescriptor(desc);
214
215     // -- validation code for: _sequence
216     fieldValidator = new org.exolab.castor.xml.FieldValidator();
217     { // -- local scope
218       org.exolab.castor.xml.validators.StringValidator typeValidator;
219       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
220       fieldValidator.setValidator(typeValidator);
221       typeValidator.setWhiteSpace("preserve");
222     }
223     desc.setValidator(fieldValidator);
224     // -- _name
225     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
226             java.lang.String.class, "_name", "name",
227             org.exolab.castor.xml.NodeType.Element);
228     desc.setImmutable(true);
229     handler = new org.exolab.castor.xml.XMLFieldHandler()
230     {
231       public java.lang.Object getValue(java.lang.Object object)
232               throws IllegalStateException
233       {
234         SequenceType target = (SequenceType) object;
235         return target.getName();
236       }
237
238       public void setValue(java.lang.Object object, java.lang.Object value)
239               throws IllegalStateException, IllegalArgumentException
240       {
241         try
242         {
243           SequenceType target = (SequenceType) object;
244           target.setName((java.lang.String) value);
245         } catch (java.lang.Exception ex)
246         {
247           throw new IllegalStateException(ex.toString());
248         }
249       }
250
251       public java.lang.Object newInstance(java.lang.Object parent)
252       {
253         return null;
254       }
255     };
256     desc.setHandler(handler);
257     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
258     desc.setMultivalued(false);
259     addFieldDescriptor(desc);
260
261     // -- validation code for: _name
262     fieldValidator = new org.exolab.castor.xml.FieldValidator();
263     { // -- local scope
264       org.exolab.castor.xml.validators.StringValidator typeValidator;
265       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
266       fieldValidator.setValidator(typeValidator);
267       typeValidator.setWhiteSpace("preserve");
268     }
269     desc.setValidator(fieldValidator);
270   }
271
272   // -----------/
273   // - Methods -/
274   // -----------/
275
276   /**
277    * Method getAccessMode.
278    * 
279    * @return the access mode specified for this class.
280    */
281   public org.exolab.castor.mapping.AccessMode getAccessMode()
282   {
283     return null;
284   }
285
286   /**
287    * Method getIdentity.
288    * 
289    * @return the identity field, null if this class has no identity.
290    */
291   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
292   {
293     return super.getIdentity();
294   }
295
296   /**
297    * Method getJavaClass.
298    * 
299    * @return the Java class represented by this descriptor.
300    */
301   public java.lang.Class getJavaClass()
302   {
303     return jalview.schemabinding.version2.SequenceType.class;
304   }
305
306   /**
307    * Method getNameSpacePrefix.
308    * 
309    * @return the namespace prefix to use when marshaling as XML.
310    */
311   public java.lang.String getNameSpacePrefix()
312   {
313     return _nsPrefix;
314   }
315
316   /**
317    * Method getNameSpaceURI.
318    * 
319    * @return the namespace URI used when marshaling and unmarshaling as XML.
320    */
321   public java.lang.String getNameSpaceURI()
322   {
323     return _nsURI;
324   }
325
326   /**
327    * Method getValidator.
328    * 
329    * @return a specific validator for the class described by this
330    *         ClassDescriptor.
331    */
332   public org.exolab.castor.xml.TypeValidator getValidator()
333   {
334     return this;
335   }
336
337   /**
338    * Method getXMLName.
339    * 
340    * @return the XML Name for the Class being described.
341    */
342   public java.lang.String getXMLName()
343   {
344     return _xmlName;
345   }
346
347   /**
348    * Method isElementDefinition.
349    * 
350    * @return true if XML schema definition of this Class is that of a global
351    *         element or element with anonymous type definition.
352    */
353   public boolean isElementDefinition()
354   {
355     return _elementDefinition;
356   }
357
358 }