update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceTypeDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2.descriptors;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import jalview.schemabinding.version2.SequenceType;
32
33 /**
34  * Class SequenceTypeDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
39
40
41       //--------------------------/
42      //- Class/Member Variables -/
43     //--------------------------/
44
45     /**
46      * Field _elementDefinition.
47      */
48     private boolean _elementDefinition;
49
50     /**
51      * Field _nsPrefix.
52      */
53     private java.lang.String _nsPrefix;
54
55     /**
56      * Field _nsURI.
57      */
58     private java.lang.String _nsURI;
59
60     /**
61      * Field _xmlName.
62      */
63     private java.lang.String _xmlName;
64
65
66       //----------------/
67      //- Constructors -/
68     //----------------/
69
70     public SequenceTypeDescriptor() {
71         super();
72         _nsURI = "www.vamsas.ac.uk/jalview/version2";
73         _xmlName = "SequenceType";
74         _elementDefinition = false;
75         
76         //-- set grouping compositor
77         setCompositorAsSequence();
78         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
79         org.exolab.castor.mapping.FieldHandler             handler        = null;
80         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
81         //-- initialize attribute descriptors
82         
83         //-- _id
84         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
85         desc.setImmutable(true);
86         handler = new org.exolab.castor.xml.XMLFieldHandler() {
87             public java.lang.Object getValue( java.lang.Object object ) 
88                 throws IllegalStateException
89             {
90                 SequenceType target = (SequenceType) object;
91                 return target.getId();
92             }
93             public void setValue( java.lang.Object object, java.lang.Object value) 
94                 throws IllegalStateException, IllegalArgumentException
95             {
96                 try {
97                     SequenceType target = (SequenceType) object;
98                     target.setId( (java.lang.String) value);
99                 } catch (java.lang.Exception ex) {
100                     throw new IllegalStateException(ex.toString());
101                 }
102             }
103             public java.lang.Object newInstance(java.lang.Object parent) {
104                 return null;
105             }
106         };
107         desc.setHandler(handler);
108         desc.setMultivalued(false);
109         addFieldDescriptor(desc);
110         
111         //-- validation code for: _id
112         fieldValidator = new org.exolab.castor.xml.FieldValidator();
113         { //-- local scope
114             org.exolab.castor.xml.validators.StringValidator typeValidator;
115             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
116             fieldValidator.setValidator(typeValidator);
117             typeValidator.setWhiteSpace("preserve");
118         }
119         desc.setValidator(fieldValidator);
120         //-- _description
121         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Attribute);
122         desc.setImmutable(true);
123         handler = new org.exolab.castor.xml.XMLFieldHandler() {
124             public java.lang.Object getValue( java.lang.Object object ) 
125                 throws IllegalStateException
126             {
127                 SequenceType target = (SequenceType) object;
128                 return target.getDescription();
129             }
130             public void setValue( java.lang.Object object, java.lang.Object value) 
131                 throws IllegalStateException, IllegalArgumentException
132             {
133                 try {
134                     SequenceType target = (SequenceType) object;
135                     target.setDescription( (java.lang.String) value);
136                 } catch (java.lang.Exception ex) {
137                     throw new IllegalStateException(ex.toString());
138                 }
139             }
140             public java.lang.Object newInstance(java.lang.Object parent) {
141                 return null;
142             }
143         };
144         desc.setHandler(handler);
145         desc.setMultivalued(false);
146         addFieldDescriptor(desc);
147         
148         //-- validation code for: _description
149         fieldValidator = new org.exolab.castor.xml.FieldValidator();
150         { //-- local scope
151             org.exolab.castor.xml.validators.StringValidator typeValidator;
152             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
153             fieldValidator.setValidator(typeValidator);
154             typeValidator.setWhiteSpace("preserve");
155         }
156         desc.setValidator(fieldValidator);
157         //-- initialize element descriptors
158         
159         //-- _sequence
160         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequence", "sequence", org.exolab.castor.xml.NodeType.Element);
161         desc.setImmutable(true);
162         handler = new org.exolab.castor.xml.XMLFieldHandler() {
163             public java.lang.Object getValue( java.lang.Object object ) 
164                 throws IllegalStateException
165             {
166                 SequenceType target = (SequenceType) object;
167                 return target.getSequence();
168             }
169             public void setValue( java.lang.Object object, java.lang.Object value) 
170                 throws IllegalStateException, IllegalArgumentException
171             {
172                 try {
173                     SequenceType target = (SequenceType) object;
174                     target.setSequence( (java.lang.String) value);
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 null;
181             }
182         };
183         desc.setHandler(handler);
184         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
185         desc.setMultivalued(false);
186         addFieldDescriptor(desc);
187         
188         //-- validation code for: _sequence
189         fieldValidator = new org.exolab.castor.xml.FieldValidator();
190         { //-- local scope
191             org.exolab.castor.xml.validators.StringValidator typeValidator;
192             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
193             fieldValidator.setValidator(typeValidator);
194             typeValidator.setWhiteSpace("preserve");
195         }
196         desc.setValidator(fieldValidator);
197         //-- _name
198         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element);
199         desc.setImmutable(true);
200         handler = new org.exolab.castor.xml.XMLFieldHandler() {
201             public java.lang.Object getValue( java.lang.Object object ) 
202                 throws IllegalStateException
203             {
204                 SequenceType target = (SequenceType) object;
205                 return target.getName();
206             }
207             public void setValue( java.lang.Object object, java.lang.Object value) 
208                 throws IllegalStateException, IllegalArgumentException
209             {
210                 try {
211                     SequenceType target = (SequenceType) object;
212                     target.setName( (java.lang.String) value);
213                 } catch (java.lang.Exception ex) {
214                     throw new IllegalStateException(ex.toString());
215                 }
216             }
217             public java.lang.Object newInstance(java.lang.Object parent) {
218                 return null;
219             }
220         };
221         desc.setHandler(handler);
222         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
223         desc.setMultivalued(false);
224         addFieldDescriptor(desc);
225         
226         //-- validation code for: _name
227         fieldValidator = new org.exolab.castor.xml.FieldValidator();
228         { //-- local scope
229             org.exolab.castor.xml.validators.StringValidator typeValidator;
230             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
231             fieldValidator.setValidator(typeValidator);
232             typeValidator.setWhiteSpace("preserve");
233         }
234         desc.setValidator(fieldValidator);
235     }
236
237
238       //-----------/
239      //- Methods -/
240     //-----------/
241
242     /**
243      * Method getAccessMode.
244      * 
245      * @return the access mode specified for this class.
246      */
247     public org.exolab.castor.mapping.AccessMode getAccessMode(
248     ) {
249         return null;
250     }
251
252     /**
253      * Method getIdentity.
254      * 
255      * @return the identity field, null if this class has no
256      * identity.
257      */
258     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
259     ) {
260         return super.getIdentity();
261     }
262
263     /**
264      * Method getJavaClass.
265      * 
266      * @return the Java class represented by this descriptor.
267      */
268     public java.lang.Class getJavaClass(
269     ) {
270         return jalview.schemabinding.version2.SequenceType.class;
271     }
272
273     /**
274      * Method getNameSpacePrefix.
275      * 
276      * @return the namespace prefix to use when marshaling as XML.
277      */
278     public java.lang.String getNameSpacePrefix(
279     ) {
280         return _nsPrefix;
281     }
282
283     /**
284      * Method getNameSpaceURI.
285      * 
286      * @return the namespace URI used when marshaling and
287      * unmarshaling as XML.
288      */
289     public java.lang.String getNameSpaceURI(
290     ) {
291         return _nsURI;
292     }
293
294     /**
295      * Method getValidator.
296      * 
297      * @return a specific validator for the class described by this
298      * ClassDescriptor.
299      */
300     public org.exolab.castor.xml.TypeValidator getValidator(
301     ) {
302         return this;
303     }
304
305     /**
306      * Method getXMLName.
307      * 
308      * @return the XML Name for the Class being described.
309      */
310     public java.lang.String getXMLName(
311     ) {
312         return _xmlName;
313     }
314
315     /**
316      * Method isElementDefinition.
317      * 
318      * @return true if XML schema definition of this Class is that
319      * of a global
320      * element or element with anonymous type definition.
321      */
322     public boolean isElementDefinition(
323     ) {
324         return _elementDefinition;
325     }
326
327 }