2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemabinding.version2.descriptors;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import jalview.schemabinding.version2.SequenceSet;
30 * Class SequenceSetDescriptor.
32 * @version $Revision$ $Date$
34 public class SequenceSetDescriptor extends
35 org.exolab.castor.xml.util.XMLClassDescriptorImpl
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
43 * Field _elementDefinition.
45 private boolean _elementDefinition;
50 private java.lang.String _nsPrefix;
55 private java.lang.String _nsURI;
60 private java.lang.String _xmlName;
66 public SequenceSetDescriptor()
69 _nsURI = "www.vamsas.ac.uk/jalview/version2";
70 _xmlName = "SequenceSet";
71 _elementDefinition = true;
73 // -- set grouping compositor
74 setCompositorAsSequence();
75 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
76 org.exolab.castor.mapping.FieldHandler handler = null;
77 org.exolab.castor.xml.FieldValidator fieldValidator = null;
78 // -- initialize attribute descriptors
81 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
82 java.lang.String.class, "_gapChar", "gapChar",
83 org.exolab.castor.xml.NodeType.Attribute);
84 desc.setImmutable(true);
85 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();
94 public void setValue(java.lang.Object object, java.lang.Object value)
95 throws IllegalStateException, IllegalArgumentException
99 SequenceSet target = (SequenceSet) object;
100 target.setGapChar((java.lang.String) value);
101 } catch (java.lang.Exception ex)
103 throw new IllegalStateException(ex.toString());
107 public java.lang.Object newInstance(java.lang.Object parent)
112 desc.setHandler(handler);
113 desc.setRequired(true);
114 desc.setMultivalued(false);
115 addFieldDescriptor(desc);
117 // -- validation code for: _gapChar
118 fieldValidator = new org.exolab.castor.xml.FieldValidator();
119 fieldValidator.setMinOccurs(1);
121 org.exolab.castor.xml.validators.StringValidator typeValidator;
122 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
123 fieldValidator.setValidator(typeValidator);
124 typeValidator.setWhiteSpace("preserve");
126 desc.setValidator(fieldValidator);
128 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
129 java.lang.String.class, "_datasetId", "datasetId",
130 org.exolab.castor.xml.NodeType.Attribute);
131 desc.setImmutable(true);
132 handler = new org.exolab.castor.xml.XMLFieldHandler()
134 public java.lang.Object getValue(java.lang.Object object)
135 throws IllegalStateException
137 SequenceSet target = (SequenceSet) object;
138 return target.getDatasetId();
141 public void setValue(java.lang.Object object, java.lang.Object value)
142 throws IllegalStateException, IllegalArgumentException
146 SequenceSet target = (SequenceSet) object;
147 target.setDatasetId((java.lang.String) value);
148 } catch (java.lang.Exception ex)
150 throw new IllegalStateException(ex.toString());
154 public java.lang.Object newInstance(java.lang.Object parent)
159 desc.setHandler(handler);
160 desc.setMultivalued(false);
161 addFieldDescriptor(desc);
163 // -- validation code for: _datasetId
164 fieldValidator = new org.exolab.castor.xml.FieldValidator();
166 org.exolab.castor.xml.validators.StringValidator typeValidator;
167 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
168 fieldValidator.setValidator(typeValidator);
169 typeValidator.setWhiteSpace("preserve");
171 desc.setValidator(fieldValidator);
172 // -- initialize element descriptors
175 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
176 jalview.schemabinding.version2.Sequence.class, "_sequenceList",
177 "Sequence", org.exolab.castor.xml.NodeType.Element);
178 handler = new org.exolab.castor.xml.XMLFieldHandler()
180 public java.lang.Object getValue(java.lang.Object object)
181 throws IllegalStateException
183 SequenceSet target = (SequenceSet) object;
184 return target.getSequence();
187 public void setValue(java.lang.Object object, java.lang.Object value)
188 throws IllegalStateException, IllegalArgumentException
192 SequenceSet target = (SequenceSet) object;
193 target.addSequence((jalview.schemabinding.version2.Sequence) value);
194 } catch (java.lang.Exception ex)
196 throw new IllegalStateException(ex.toString());
200 public void resetValue(Object object) throws IllegalStateException,
201 IllegalArgumentException
205 SequenceSet target = (SequenceSet) object;
206 target.removeAllSequence();
207 } catch (java.lang.Exception ex)
209 throw new IllegalStateException(ex.toString());
213 public java.lang.Object newInstance(java.lang.Object parent)
215 return new jalview.schemabinding.version2.Sequence();
218 desc.setHandler(handler);
219 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
220 desc.setMultivalued(true);
221 addFieldDescriptor(desc);
223 // -- validation code for: _sequenceList
224 fieldValidator = new org.exolab.castor.xml.FieldValidator();
225 fieldValidator.setMinOccurs(0);
228 desc.setValidator(fieldValidator);
229 // -- _annotationList
230 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
231 jalview.schemabinding.version2.Annotation.class,
232 "_annotationList", "Annotation",
233 org.exolab.castor.xml.NodeType.Element);
234 handler = new org.exolab.castor.xml.XMLFieldHandler()
236 public java.lang.Object getValue(java.lang.Object object)
237 throws IllegalStateException
239 SequenceSet target = (SequenceSet) object;
240 return target.getAnnotation();
243 public void setValue(java.lang.Object object, java.lang.Object value)
244 throws IllegalStateException, IllegalArgumentException
248 SequenceSet target = (SequenceSet) object;
249 target.addAnnotation((jalview.schemabinding.version2.Annotation) value);
250 } catch (java.lang.Exception ex)
252 throw new IllegalStateException(ex.toString());
256 public void resetValue(Object object) throws IllegalStateException,
257 IllegalArgumentException
261 SequenceSet target = (SequenceSet) object;
262 target.removeAllAnnotation();
263 } catch (java.lang.Exception ex)
265 throw new IllegalStateException(ex.toString());
269 public java.lang.Object newInstance(java.lang.Object parent)
271 return new jalview.schemabinding.version2.Annotation();
274 desc.setHandler(handler);
275 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
276 desc.setMultivalued(true);
277 addFieldDescriptor(desc);
279 // -- validation code for: _annotationList
280 fieldValidator = new org.exolab.castor.xml.FieldValidator();
281 fieldValidator.setMinOccurs(0);
284 desc.setValidator(fieldValidator);
285 // -- _sequenceSetPropertiesList
286 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
287 jalview.schemabinding.version2.SequenceSetProperties.class,
288 "_sequenceSetPropertiesList", "sequenceSetProperties",
289 org.exolab.castor.xml.NodeType.Element);
290 handler = new org.exolab.castor.xml.XMLFieldHandler()
292 public java.lang.Object getValue(java.lang.Object object)
293 throws IllegalStateException
295 SequenceSet target = (SequenceSet) object;
296 return target.getSequenceSetProperties();
299 public void setValue(java.lang.Object object, java.lang.Object value)
300 throws IllegalStateException, IllegalArgumentException
304 SequenceSet target = (SequenceSet) object;
305 target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value);
306 } catch (java.lang.Exception ex)
308 throw new IllegalStateException(ex.toString());
312 public void resetValue(Object object) throws IllegalStateException,
313 IllegalArgumentException
317 SequenceSet target = (SequenceSet) object;
318 target.removeAllSequenceSetProperties();
319 } catch (java.lang.Exception ex)
321 throw new IllegalStateException(ex.toString());
325 public java.lang.Object newInstance(java.lang.Object parent)
327 return new jalview.schemabinding.version2.SequenceSetProperties();
330 desc.setHandler(handler);
331 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
332 desc.setMultivalued(true);
333 addFieldDescriptor(desc);
335 // -- validation code for: _sequenceSetPropertiesList
336 fieldValidator = new org.exolab.castor.xml.FieldValidator();
337 fieldValidator.setMinOccurs(0);
340 desc.setValidator(fieldValidator);
341 // -- _alcodonFrameList
342 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
343 jalview.schemabinding.version2.AlcodonFrame.class,
344 "_alcodonFrameList", "AlcodonFrame",
345 org.exolab.castor.xml.NodeType.Element);
346 handler = new org.exolab.castor.xml.XMLFieldHandler()
348 public java.lang.Object getValue(java.lang.Object object)
349 throws IllegalStateException
351 SequenceSet target = (SequenceSet) object;
352 return target.getAlcodonFrame();
355 public void setValue(java.lang.Object object, java.lang.Object value)
356 throws IllegalStateException, IllegalArgumentException
360 SequenceSet target = (SequenceSet) object;
361 target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value);
362 } catch (java.lang.Exception ex)
364 throw new IllegalStateException(ex.toString());
368 public void resetValue(Object object) throws IllegalStateException,
369 IllegalArgumentException
373 SequenceSet target = (SequenceSet) object;
374 target.removeAllAlcodonFrame();
375 } catch (java.lang.Exception ex)
377 throw new IllegalStateException(ex.toString());
381 public java.lang.Object newInstance(java.lang.Object parent)
383 return new jalview.schemabinding.version2.AlcodonFrame();
386 desc.setHandler(handler);
387 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
388 desc.setMultivalued(true);
389 addFieldDescriptor(desc);
391 // -- validation code for: _alcodonFrameList
392 fieldValidator = new org.exolab.castor.xml.FieldValidator();
393 fieldValidator.setMinOccurs(0);
396 desc.setValidator(fieldValidator);
404 * Method getAccessMode.
406 * @return the access mode specified for this class.
408 public org.exolab.castor.mapping.AccessMode getAccessMode()
414 * Method getIdentity.
416 * @return the identity field, null if this class has no identity.
418 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
420 return super.getIdentity();
424 * Method getJavaClass.
426 * @return the Java class represented by this descriptor.
428 public java.lang.Class getJavaClass()
430 return jalview.schemabinding.version2.SequenceSet.class;
434 * Method getNameSpacePrefix.
436 * @return the namespace prefix to use when marshaling as XML.
438 public java.lang.String getNameSpacePrefix()
444 * Method getNameSpaceURI.
446 * @return the namespace URI used when marshaling and unmarshaling as XML.
448 public java.lang.String getNameSpaceURI()
454 * Method getValidator.
456 * @return a specific validator for the class described by this
459 public org.exolab.castor.xml.TypeValidator getValidator()
467 * @return the XML Name for the Class being described.
469 public java.lang.String getXMLName()
475 * Method isElementDefinition.
477 * @return true if XML schema definition of this Class is that of a global
478 * element or element with anonymous type definition.
480 public boolean isElementDefinition()
482 return _elementDefinition;