update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / DBRefDescriptor.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.DBRef;
32
33 /**
34  * Class DBRefDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class DBRefDescriptor 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 DBRefDescriptor() {
71         super();
72         _nsURI = "www.vamsas.ac.uk/jalview/version2";
73         _xmlName = "DBRef";
74         _elementDefinition = true;
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         //-- _source
84         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_source", "source", 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                 DBRef target = (DBRef) object;
91                 return target.getSource();
92             }
93             public void setValue( java.lang.Object object, java.lang.Object value) 
94                 throws IllegalStateException, IllegalArgumentException
95             {
96                 try {
97                     DBRef target = (DBRef) object;
98                     target.setSource( (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: _source
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         //-- _version
121         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", 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                 DBRef target = (DBRef) object;
128                 return target.getVersion();
129             }
130             public void setValue( java.lang.Object object, java.lang.Object value) 
131                 throws IllegalStateException, IllegalArgumentException
132             {
133                 try {
134                     DBRef target = (DBRef) object;
135                     target.setVersion( (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: _version
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         //-- _accessionId
158         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_accessionId", "accessionId", org.exolab.castor.xml.NodeType.Attribute);
159         desc.setImmutable(true);
160         handler = new org.exolab.castor.xml.XMLFieldHandler() {
161             public java.lang.Object getValue( java.lang.Object object ) 
162                 throws IllegalStateException
163             {
164                 DBRef target = (DBRef) object;
165                 return target.getAccessionId();
166             }
167             public void setValue( java.lang.Object object, java.lang.Object value) 
168                 throws IllegalStateException, IllegalArgumentException
169             {
170                 try {
171                     DBRef target = (DBRef) object;
172                     target.setAccessionId( (java.lang.String) value);
173                 } catch (java.lang.Exception ex) {
174                     throw new IllegalStateException(ex.toString());
175                 }
176             }
177             public java.lang.Object newInstance(java.lang.Object parent) {
178                 return null;
179             }
180         };
181         desc.setHandler(handler);
182         desc.setMultivalued(false);
183         addFieldDescriptor(desc);
184         
185         //-- validation code for: _accessionId
186         fieldValidator = new org.exolab.castor.xml.FieldValidator();
187         { //-- local scope
188             org.exolab.castor.xml.validators.StringValidator typeValidator;
189             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
190             fieldValidator.setValidator(typeValidator);
191             typeValidator.setWhiteSpace("preserve");
192         }
193         desc.setValidator(fieldValidator);
194         //-- initialize element descriptors
195         
196         //-- _mapping
197         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Mapping.class, "_mapping", "Mapping", org.exolab.castor.xml.NodeType.Element);
198         handler = new org.exolab.castor.xml.XMLFieldHandler() {
199             public java.lang.Object getValue( java.lang.Object object ) 
200                 throws IllegalStateException
201             {
202                 DBRef target = (DBRef) object;
203                 return target.getMapping();
204             }
205             public void setValue( java.lang.Object object, java.lang.Object value) 
206                 throws IllegalStateException, IllegalArgumentException
207             {
208                 try {
209                     DBRef target = (DBRef) object;
210                     target.setMapping( (jalview.schemabinding.version2.Mapping) value);
211                 } catch (java.lang.Exception ex) {
212                     throw new IllegalStateException(ex.toString());
213                 }
214             }
215             public java.lang.Object newInstance(java.lang.Object parent) {
216                 return new jalview.schemabinding.version2.Mapping();
217             }
218         };
219         desc.setHandler(handler);
220         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
221         desc.setMultivalued(false);
222         addFieldDescriptor(desc);
223         
224         //-- validation code for: _mapping
225         fieldValidator = new org.exolab.castor.xml.FieldValidator();
226         { //-- local scope
227         }
228         desc.setValidator(fieldValidator);
229     }
230
231
232       //-----------/
233      //- Methods -/
234     //-----------/
235
236     /**
237      * Method getAccessMode.
238      * 
239      * @return the access mode specified for this class.
240      */
241     public org.exolab.castor.mapping.AccessMode getAccessMode(
242     ) {
243         return null;
244     }
245
246     /**
247      * Method getIdentity.
248      * 
249      * @return the identity field, null if this class has no
250      * identity.
251      */
252     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
253     ) {
254         return super.getIdentity();
255     }
256
257     /**
258      * Method getJavaClass.
259      * 
260      * @return the Java class represented by this descriptor.
261      */
262     public java.lang.Class getJavaClass(
263     ) {
264         return jalview.schemabinding.version2.DBRef.class;
265     }
266
267     /**
268      * Method getNameSpacePrefix.
269      * 
270      * @return the namespace prefix to use when marshaling as XML.
271      */
272     public java.lang.String getNameSpacePrefix(
273     ) {
274         return _nsPrefix;
275     }
276
277     /**
278      * Method getNameSpaceURI.
279      * 
280      * @return the namespace URI used when marshaling and
281      * unmarshaling as XML.
282      */
283     public java.lang.String getNameSpaceURI(
284     ) {
285         return _nsURI;
286     }
287
288     /**
289      * Method getValidator.
290      * 
291      * @return a specific validator for the class described by this
292      * ClassDescriptor.
293      */
294     public org.exolab.castor.xml.TypeValidator getValidator(
295     ) {
296         return this;
297     }
298
299     /**
300      * Method getXMLName.
301      * 
302      * @return the XML Name for the Class being described.
303      */
304     public java.lang.String getXMLName(
305     ) {
306         return _xmlName;
307     }
308
309     /**
310      * Method isElementDefinition.
311      * 
312      * @return true if XML schema definition of this Class is that
313      * of a global
314      * element or element with anonymous type definition.
315      */
316     public boolean isElementDefinition(
317     ) {
318         return _elementDefinition;
319     }
320
321 }