update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceDescriptor.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.Sequence;
32
33 /**
34  * Class SequenceDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class SequenceDescriptor extends jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor {
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 SequenceDescriptor() {
71         super();
72         setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor());
73         _nsURI = "www.vamsas.ac.uk/jalview/version2";
74         _xmlName = "Sequence";
75         _elementDefinition = true;
76         
77         //-- set grouping compositor
78         setCompositorAsSequence();
79         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
80         org.exolab.castor.mapping.FieldHandler             handler        = null;
81         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
82         //-- initialize attribute descriptors
83         
84         //-- _dsseqid
85         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dsseqid", "dsseqid", org.exolab.castor.xml.NodeType.Attribute);
86         desc.setImmutable(true);
87         handler = new org.exolab.castor.xml.XMLFieldHandler() {
88             public java.lang.Object getValue( java.lang.Object object ) 
89                 throws IllegalStateException
90             {
91                 Sequence target = (Sequence) object;
92                 return target.getDsseqid();
93             }
94             public void setValue( java.lang.Object object, java.lang.Object value) 
95                 throws IllegalStateException, IllegalArgumentException
96             {
97                 try {
98                     Sequence target = (Sequence) object;
99                     target.setDsseqid( (java.lang.String) value);
100                 } catch (java.lang.Exception ex) {
101                     throw new IllegalStateException(ex.toString());
102                 }
103             }
104             public java.lang.Object newInstance(java.lang.Object parent) {
105                 return null;
106             }
107         };
108         desc.setHandler(handler);
109         desc.setMultivalued(false);
110         addFieldDescriptor(desc);
111         
112         //-- validation code for: _dsseqid
113         fieldValidator = new org.exolab.castor.xml.FieldValidator();
114         { //-- local scope
115             org.exolab.castor.xml.validators.StringValidator typeValidator;
116             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
117             fieldValidator.setValidator(typeValidator);
118             typeValidator.setWhiteSpace("preserve");
119         }
120         desc.setValidator(fieldValidator);
121         //-- initialize element descriptors
122         
123         //-- _DBRefList
124         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.DBRef.class, "_DBRefList", "DBRef", org.exolab.castor.xml.NodeType.Element);
125         handler = new org.exolab.castor.xml.XMLFieldHandler() {
126             public java.lang.Object getValue( java.lang.Object object ) 
127                 throws IllegalStateException
128             {
129                 Sequence target = (Sequence) object;
130                 return target.getDBRef();
131             }
132             public void setValue( java.lang.Object object, java.lang.Object value) 
133                 throws IllegalStateException, IllegalArgumentException
134             {
135                 try {
136                     Sequence target = (Sequence) object;
137                     target.addDBRef( (jalview.schemabinding.version2.DBRef) value);
138                 } catch (java.lang.Exception ex) {
139                     throw new IllegalStateException(ex.toString());
140                 }
141             }
142             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
143                 try {
144                     Sequence target = (Sequence) object;
145                     target.removeAllDBRef();
146                 } catch (java.lang.Exception ex) {
147                     throw new IllegalStateException(ex.toString());
148                 }
149             }
150             public java.lang.Object newInstance(java.lang.Object parent) {
151                 return new jalview.schemabinding.version2.DBRef();
152             }
153         };
154         desc.setHandler(handler);
155         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
156         desc.setMultivalued(true);
157         addFieldDescriptor(desc);
158         
159         //-- validation code for: _DBRefList
160         fieldValidator = new org.exolab.castor.xml.FieldValidator();
161         fieldValidator.setMinOccurs(0);
162         { //-- local scope
163         }
164         desc.setValidator(fieldValidator);
165     }
166
167
168       //-----------/
169      //- Methods -/
170     //-----------/
171
172     /**
173      * Method getAccessMode.
174      * 
175      * @return the access mode specified for this class.
176      */
177     public org.exolab.castor.mapping.AccessMode getAccessMode(
178     ) {
179         return null;
180     }
181
182     /**
183      * Method getIdentity.
184      * 
185      * @return the identity field, null if this class has no
186      * identity.
187      */
188     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
189     ) {
190         return super.getIdentity();
191     }
192
193     /**
194      * Method getJavaClass.
195      * 
196      * @return the Java class represented by this descriptor.
197      */
198     public java.lang.Class getJavaClass(
199     ) {
200         return jalview.schemabinding.version2.Sequence.class;
201     }
202
203     /**
204      * Method getNameSpacePrefix.
205      * 
206      * @return the namespace prefix to use when marshaling as XML.
207      */
208     public java.lang.String getNameSpacePrefix(
209     ) {
210         return _nsPrefix;
211     }
212
213     /**
214      * Method getNameSpaceURI.
215      * 
216      * @return the namespace URI used when marshaling and
217      * unmarshaling as XML.
218      */
219     public java.lang.String getNameSpaceURI(
220     ) {
221         return _nsURI;
222     }
223
224     /**
225      * Method getValidator.
226      * 
227      * @return a specific validator for the class described by this
228      * ClassDescriptor.
229      */
230     public org.exolab.castor.xml.TypeValidator getValidator(
231     ) {
232         return this;
233     }
234
235     /**
236      * Method getXMLName.
237      * 
238      * @return the XML Name for the Class being described.
239      */
240     public java.lang.String getXMLName(
241     ) {
242         return _xmlName;
243     }
244
245     /**
246      * Method isElementDefinition.
247      * 
248      * @return true if XML schema definition of this Class is that
249      * of a global
250      * element or element with anonymous type definition.
251      */
252     public boolean isElementDefinition(
253     ) {
254         return _elementDefinition;
255     }
256
257 }