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
5 * This file is part of Jalview.
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.
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.
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 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.SequenceSet;
34 * Class SequenceSetDescriptor.
36 * @version $Revision$ $Date$
38 public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public SequenceSetDescriptor() {
72 _nsURI = "www.vamsas.ac.uk/jalview/version2";
73 _xmlName = "SequenceSet";
74 _elementDefinition = true;
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
84 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", 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
90 SequenceSet target = (SequenceSet) object;
91 return target.getGapChar();
93 public void setValue( java.lang.Object object, java.lang.Object value)
94 throws IllegalStateException, IllegalArgumentException
97 SequenceSet target = (SequenceSet) object;
98 target.setGapChar( (java.lang.String) value);
99 } catch (java.lang.Exception ex) {
100 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent) {
107 desc.setHandler(handler);
108 desc.setRequired(true);
109 desc.setMultivalued(false);
110 addFieldDescriptor(desc);
112 //-- validation code for: _gapChar
113 fieldValidator = new org.exolab.castor.xml.FieldValidator();
114 fieldValidator.setMinOccurs(1);
116 org.exolab.castor.xml.validators.StringValidator typeValidator;
117 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
118 fieldValidator.setValidator(typeValidator);
119 typeValidator.setWhiteSpace("preserve");
121 desc.setValidator(fieldValidator);
123 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_datasetId", "datasetId", org.exolab.castor.xml.NodeType.Attribute);
124 desc.setImmutable(true);
125 handler = new org.exolab.castor.xml.XMLFieldHandler() {
126 public java.lang.Object getValue( java.lang.Object object )
127 throws IllegalStateException
129 SequenceSet target = (SequenceSet) object;
130 return target.getDatasetId();
132 public void setValue( java.lang.Object object, java.lang.Object value)
133 throws IllegalStateException, IllegalArgumentException
136 SequenceSet target = (SequenceSet) object;
137 target.setDatasetId( (java.lang.String) value);
138 } catch (java.lang.Exception ex) {
139 throw new IllegalStateException(ex.toString());
142 public java.lang.Object newInstance(java.lang.Object parent) {
146 desc.setHandler(handler);
147 desc.setMultivalued(false);
148 addFieldDescriptor(desc);
150 //-- validation code for: _datasetId
151 fieldValidator = new org.exolab.castor.xml.FieldValidator();
153 org.exolab.castor.xml.validators.StringValidator typeValidator;
154 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
155 fieldValidator.setValidator(typeValidator);
156 typeValidator.setWhiteSpace("preserve");
158 desc.setValidator(fieldValidator);
159 //-- initialize element descriptors
162 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequenceList", "Sequence", org.exolab.castor.xml.NodeType.Element);
163 handler = new org.exolab.castor.xml.XMLFieldHandler() {
164 public java.lang.Object getValue( java.lang.Object object )
165 throws IllegalStateException
167 SequenceSet target = (SequenceSet) object;
168 return target.getSequence();
170 public void setValue( java.lang.Object object, java.lang.Object value)
171 throws IllegalStateException, IllegalArgumentException
174 SequenceSet target = (SequenceSet) object;
175 target.addSequence( (jalview.schemabinding.version2.Sequence) value);
176 } catch (java.lang.Exception ex) {
177 throw new IllegalStateException(ex.toString());
180 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
182 SequenceSet target = (SequenceSet) object;
183 target.removeAllSequence();
184 } catch (java.lang.Exception ex) {
185 throw new IllegalStateException(ex.toString());
188 public java.lang.Object newInstance(java.lang.Object parent) {
189 return new jalview.schemabinding.version2.Sequence();
192 desc.setHandler(handler);
193 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
194 desc.setMultivalued(true);
195 addFieldDescriptor(desc);
197 //-- validation code for: _sequenceList
198 fieldValidator = new org.exolab.castor.xml.FieldValidator();
199 fieldValidator.setMinOccurs(0);
202 desc.setValidator(fieldValidator);
204 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Annotation.class, "_annotationList", "Annotation", org.exolab.castor.xml.NodeType.Element);
205 handler = new org.exolab.castor.xml.XMLFieldHandler() {
206 public java.lang.Object getValue( java.lang.Object object )
207 throws IllegalStateException
209 SequenceSet target = (SequenceSet) object;
210 return target.getAnnotation();
212 public void setValue( java.lang.Object object, java.lang.Object value)
213 throws IllegalStateException, IllegalArgumentException
216 SequenceSet target = (SequenceSet) object;
217 target.addAnnotation( (jalview.schemabinding.version2.Annotation) value);
218 } catch (java.lang.Exception ex) {
219 throw new IllegalStateException(ex.toString());
222 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
224 SequenceSet target = (SequenceSet) object;
225 target.removeAllAnnotation();
226 } catch (java.lang.Exception ex) {
227 throw new IllegalStateException(ex.toString());
230 public java.lang.Object newInstance(java.lang.Object parent) {
231 return new jalview.schemabinding.version2.Annotation();
234 desc.setHandler(handler);
235 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
236 desc.setMultivalued(true);
237 addFieldDescriptor(desc);
239 //-- validation code for: _annotationList
240 fieldValidator = new org.exolab.castor.xml.FieldValidator();
241 fieldValidator.setMinOccurs(0);
244 desc.setValidator(fieldValidator);
245 //-- _sequenceSetPropertiesList
246 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSetProperties.class, "_sequenceSetPropertiesList", "sequenceSetProperties", org.exolab.castor.xml.NodeType.Element);
247 handler = new org.exolab.castor.xml.XMLFieldHandler() {
248 public java.lang.Object getValue( java.lang.Object object )
249 throws IllegalStateException
251 SequenceSet target = (SequenceSet) object;
252 return target.getSequenceSetProperties();
254 public void setValue( java.lang.Object object, java.lang.Object value)
255 throws IllegalStateException, IllegalArgumentException
258 SequenceSet target = (SequenceSet) object;
259 target.addSequenceSetProperties( (jalview.schemabinding.version2.SequenceSetProperties) value);
260 } catch (java.lang.Exception ex) {
261 throw new IllegalStateException(ex.toString());
264 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
266 SequenceSet target = (SequenceSet) object;
267 target.removeAllSequenceSetProperties();
268 } catch (java.lang.Exception ex) {
269 throw new IllegalStateException(ex.toString());
272 public java.lang.Object newInstance(java.lang.Object parent) {
273 return new jalview.schemabinding.version2.SequenceSetProperties();
276 desc.setHandler(handler);
277 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
278 desc.setMultivalued(true);
279 addFieldDescriptor(desc);
281 //-- validation code for: _sequenceSetPropertiesList
282 fieldValidator = new org.exolab.castor.xml.FieldValidator();
283 fieldValidator.setMinOccurs(0);
286 desc.setValidator(fieldValidator);
287 //-- _alcodonFrameList
288 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AlcodonFrame.class, "_alcodonFrameList", "AlcodonFrame", org.exolab.castor.xml.NodeType.Element);
289 handler = new org.exolab.castor.xml.XMLFieldHandler() {
290 public java.lang.Object getValue( java.lang.Object object )
291 throws IllegalStateException
293 SequenceSet target = (SequenceSet) object;
294 return target.getAlcodonFrame();
296 public void setValue( java.lang.Object object, java.lang.Object value)
297 throws IllegalStateException, IllegalArgumentException
300 SequenceSet target = (SequenceSet) object;
301 target.addAlcodonFrame( (jalview.schemabinding.version2.AlcodonFrame) value);
302 } catch (java.lang.Exception ex) {
303 throw new IllegalStateException(ex.toString());
306 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
308 SequenceSet target = (SequenceSet) object;
309 target.removeAllAlcodonFrame();
310 } catch (java.lang.Exception ex) {
311 throw new IllegalStateException(ex.toString());
314 public java.lang.Object newInstance(java.lang.Object parent) {
315 return new jalview.schemabinding.version2.AlcodonFrame();
318 desc.setHandler(handler);
319 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
320 desc.setMultivalued(true);
321 addFieldDescriptor(desc);
323 //-- validation code for: _alcodonFrameList
324 fieldValidator = new org.exolab.castor.xml.FieldValidator();
325 fieldValidator.setMinOccurs(0);
328 desc.setValidator(fieldValidator);
337 * Method getAccessMode.
339 * @return the access mode specified for this class.
341 public org.exolab.castor.mapping.AccessMode getAccessMode(
347 * Method getIdentity.
349 * @return the identity field, null if this class has no
352 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
354 return super.getIdentity();
358 * Method getJavaClass.
360 * @return the Java class represented by this descriptor.
362 public java.lang.Class getJavaClass(
364 return jalview.schemabinding.version2.SequenceSet.class;
368 * Method getNameSpacePrefix.
370 * @return the namespace prefix to use when marshaling as XML.
372 public java.lang.String getNameSpacePrefix(
378 * Method getNameSpaceURI.
380 * @return the namespace URI used when marshaling and
381 * unmarshaling as XML.
383 public java.lang.String getNameSpaceURI(
389 * Method getValidator.
391 * @return a specific validator for the class described by this
394 public org.exolab.castor.xml.TypeValidator getValidator(
402 * @return the XML Name for the Class being described.
404 public java.lang.String getXMLName(
410 * Method isElementDefinition.
412 * @return true if XML schema definition of this Class is that
414 * element or element with anonymous type definition.
416 public boolean isElementDefinition(
418 return _elementDefinition;