2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 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 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.schemabinding.version2.descriptors;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import jalview.schemabinding.version2.SequenceSet;
28 * Class SequenceSetDescriptor.
30 * @version $Revision$ $Date$
32 public class SequenceSetDescriptor extends
33 org.exolab.castor.xml.util.XMLClassDescriptorImpl
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
41 * Field _elementDefinition.
43 private boolean _elementDefinition;
48 private java.lang.String _nsPrefix;
53 private java.lang.String _nsURI;
58 private java.lang.String _xmlName;
64 public SequenceSetDescriptor()
67 _nsURI = "www.vamsas.ac.uk/jalview/version2";
68 _xmlName = "SequenceSet";
69 _elementDefinition = true;
71 // -- set grouping compositor
72 setCompositorAsSequence();
73 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
74 org.exolab.castor.mapping.FieldHandler handler = null;
75 org.exolab.castor.xml.FieldValidator fieldValidator = null;
76 // -- initialize attribute descriptors
79 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
80 java.lang.String.class, "_gapChar", "gapChar",
81 org.exolab.castor.xml.NodeType.Attribute);
82 desc.setImmutable(true);
83 handler = new org.exolab.castor.xml.XMLFieldHandler()
85 public java.lang.Object getValue(java.lang.Object object)
86 throws IllegalStateException
88 SequenceSet target = (SequenceSet) object;
89 return target.getGapChar();
92 public void setValue(java.lang.Object object, java.lang.Object value)
93 throws IllegalStateException, IllegalArgumentException
97 SequenceSet target = (SequenceSet) object;
98 target.setGapChar((java.lang.String) value);
99 } catch (java.lang.Exception ex)
101 throw new IllegalStateException(ex.toString());
105 public java.lang.Object newInstance(java.lang.Object parent)
110 desc.setHandler(handler);
111 desc.setRequired(true);
112 desc.setMultivalued(false);
113 addFieldDescriptor(desc);
115 // -- validation code for: _gapChar
116 fieldValidator = new org.exolab.castor.xml.FieldValidator();
117 fieldValidator.setMinOccurs(1);
119 org.exolab.castor.xml.validators.StringValidator typeValidator;
120 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
121 fieldValidator.setValidator(typeValidator);
122 typeValidator.setWhiteSpace("preserve");
124 desc.setValidator(fieldValidator);
126 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
127 java.lang.String.class, "_datasetId", "datasetId",
128 org.exolab.castor.xml.NodeType.Attribute);
129 desc.setImmutable(true);
130 handler = new org.exolab.castor.xml.XMLFieldHandler()
132 public java.lang.Object getValue(java.lang.Object object)
133 throws IllegalStateException
135 SequenceSet target = (SequenceSet) object;
136 return target.getDatasetId();
139 public void setValue(java.lang.Object object, java.lang.Object value)
140 throws IllegalStateException, IllegalArgumentException
144 SequenceSet target = (SequenceSet) object;
145 target.setDatasetId((java.lang.String) value);
146 } catch (java.lang.Exception ex)
148 throw new IllegalStateException(ex.toString());
152 public java.lang.Object newInstance(java.lang.Object parent)
157 desc.setHandler(handler);
158 desc.setMultivalued(false);
159 addFieldDescriptor(desc);
161 // -- validation code for: _datasetId
162 fieldValidator = new org.exolab.castor.xml.FieldValidator();
164 org.exolab.castor.xml.validators.StringValidator typeValidator;
165 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
166 fieldValidator.setValidator(typeValidator);
167 typeValidator.setWhiteSpace("preserve");
169 desc.setValidator(fieldValidator);
170 // -- initialize element descriptors
173 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
174 jalview.schemabinding.version2.Sequence.class, "_sequenceList",
175 "Sequence", org.exolab.castor.xml.NodeType.Element);
176 handler = new org.exolab.castor.xml.XMLFieldHandler()
178 public java.lang.Object getValue(java.lang.Object object)
179 throws IllegalStateException
181 SequenceSet target = (SequenceSet) object;
182 return target.getSequence();
185 public void setValue(java.lang.Object object, java.lang.Object value)
186 throws IllegalStateException, IllegalArgumentException
190 SequenceSet target = (SequenceSet) object;
191 target.addSequence((jalview.schemabinding.version2.Sequence) value);
192 } catch (java.lang.Exception ex)
194 throw new IllegalStateException(ex.toString());
198 public void resetValue(Object object) throws IllegalStateException,
199 IllegalArgumentException
203 SequenceSet target = (SequenceSet) object;
204 target.removeAllSequence();
205 } catch (java.lang.Exception ex)
207 throw new IllegalStateException(ex.toString());
211 public java.lang.Object newInstance(java.lang.Object parent)
213 return new jalview.schemabinding.version2.Sequence();
216 desc.setHandler(handler);
217 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
218 desc.setMultivalued(true);
219 addFieldDescriptor(desc);
221 // -- validation code for: _sequenceList
222 fieldValidator = new org.exolab.castor.xml.FieldValidator();
223 fieldValidator.setMinOccurs(0);
226 desc.setValidator(fieldValidator);
227 // -- _annotationList
228 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
229 jalview.schemabinding.version2.Annotation.class,
230 "_annotationList", "Annotation",
231 org.exolab.castor.xml.NodeType.Element);
232 handler = new org.exolab.castor.xml.XMLFieldHandler()
234 public java.lang.Object getValue(java.lang.Object object)
235 throws IllegalStateException
237 SequenceSet target = (SequenceSet) object;
238 return target.getAnnotation();
241 public void setValue(java.lang.Object object, java.lang.Object value)
242 throws IllegalStateException, IllegalArgumentException
246 SequenceSet target = (SequenceSet) object;
247 target.addAnnotation((jalview.schemabinding.version2.Annotation) value);
248 } catch (java.lang.Exception ex)
250 throw new IllegalStateException(ex.toString());
254 public void resetValue(Object object) throws IllegalStateException,
255 IllegalArgumentException
259 SequenceSet target = (SequenceSet) object;
260 target.removeAllAnnotation();
261 } catch (java.lang.Exception ex)
263 throw new IllegalStateException(ex.toString());
267 public java.lang.Object newInstance(java.lang.Object parent)
269 return new jalview.schemabinding.version2.Annotation();
272 desc.setHandler(handler);
273 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
274 desc.setMultivalued(true);
275 addFieldDescriptor(desc);
277 // -- validation code for: _annotationList
278 fieldValidator = new org.exolab.castor.xml.FieldValidator();
279 fieldValidator.setMinOccurs(0);
282 desc.setValidator(fieldValidator);
283 // -- _sequenceSetPropertiesList
284 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
285 jalview.schemabinding.version2.SequenceSetProperties.class,
286 "_sequenceSetPropertiesList", "sequenceSetProperties",
287 org.exolab.castor.xml.NodeType.Element);
288 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.getSequenceSetProperties();
297 public void setValue(java.lang.Object object, java.lang.Object value)
298 throws IllegalStateException, IllegalArgumentException
302 SequenceSet target = (SequenceSet) object;
303 target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value);
304 } catch (java.lang.Exception ex)
306 throw new IllegalStateException(ex.toString());
310 public void resetValue(Object object) throws IllegalStateException,
311 IllegalArgumentException
315 SequenceSet target = (SequenceSet) object;
316 target.removeAllSequenceSetProperties();
317 } catch (java.lang.Exception ex)
319 throw new IllegalStateException(ex.toString());
323 public java.lang.Object newInstance(java.lang.Object parent)
325 return new jalview.schemabinding.version2.SequenceSetProperties();
328 desc.setHandler(handler);
329 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
330 desc.setMultivalued(true);
331 addFieldDescriptor(desc);
333 // -- validation code for: _sequenceSetPropertiesList
334 fieldValidator = new org.exolab.castor.xml.FieldValidator();
335 fieldValidator.setMinOccurs(0);
338 desc.setValidator(fieldValidator);
339 // -- _alcodonFrameList
340 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
341 jalview.schemabinding.version2.AlcodonFrame.class,
342 "_alcodonFrameList", "AlcodonFrame",
343 org.exolab.castor.xml.NodeType.Element);
344 handler = new org.exolab.castor.xml.XMLFieldHandler()
346 public java.lang.Object getValue(java.lang.Object object)
347 throws IllegalStateException
349 SequenceSet target = (SequenceSet) object;
350 return target.getAlcodonFrame();
353 public void setValue(java.lang.Object object, java.lang.Object value)
354 throws IllegalStateException, IllegalArgumentException
358 SequenceSet target = (SequenceSet) object;
359 target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value);
360 } catch (java.lang.Exception ex)
362 throw new IllegalStateException(ex.toString());
366 public void resetValue(Object object) throws IllegalStateException,
367 IllegalArgumentException
371 SequenceSet target = (SequenceSet) object;
372 target.removeAllAlcodonFrame();
373 } catch (java.lang.Exception ex)
375 throw new IllegalStateException(ex.toString());
379 public java.lang.Object newInstance(java.lang.Object parent)
381 return new jalview.schemabinding.version2.AlcodonFrame();
384 desc.setHandler(handler);
385 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
386 desc.setMultivalued(true);
387 addFieldDescriptor(desc);
389 // -- validation code for: _alcodonFrameList
390 fieldValidator = new org.exolab.castor.xml.FieldValidator();
391 fieldValidator.setMinOccurs(0);
394 desc.setValidator(fieldValidator);
402 * Method getAccessMode.
404 * @return the access mode specified for this class.
406 public org.exolab.castor.mapping.AccessMode getAccessMode()
412 * Method getIdentity.
414 * @return the identity field, null if this class has no identity.
416 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
418 return super.getIdentity();
422 * Method getJavaClass.
424 * @return the Java class represented by this descriptor.
426 public java.lang.Class getJavaClass()
428 return jalview.schemabinding.version2.SequenceSet.class;
432 * Method getNameSpacePrefix.
434 * @return the namespace prefix to use when marshaling as XML.
436 public java.lang.String getNameSpacePrefix()
442 * Method getNameSpaceURI.
444 * @return the namespace URI used when marshaling and unmarshaling as XML.
446 public java.lang.String getNameSpaceURI()
452 * Method getValidator.
454 * @return a specific validator for the class described by this
457 public org.exolab.castor.xml.TypeValidator getValidator()
465 * @return the XML Name for the Class being described.
467 public java.lang.String getXMLName()
473 * Method isElementDefinition.
475 * @return true if XML schema definition of this Class is that of a global
476 * element or element with anonymous type definition.
478 public boolean isElementDefinition()
480 return _elementDefinition;