1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
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.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2.descriptors;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import jalview.schemabinding.version2.JSeq;
36 * Class JSeqDescriptor.
38 * @version $Revision$ $Date$
40 public class JSeqDescriptor extends
41 org.exolab.castor.xml.util.XMLClassDescriptorImpl
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
49 * Field _elementDefinition.
51 private boolean _elementDefinition;
56 private java.lang.String _nsPrefix;
61 private java.lang.String _nsURI;
66 private java.lang.String _xmlName;
72 public JSeqDescriptor()
75 _nsURI = "www.jalview.org";
77 _elementDefinition = true;
79 // -- set grouping compositor
80 setCompositorAsSequence();
81 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
82 org.exolab.castor.mapping.FieldHandler handler = null;
83 org.exolab.castor.xml.FieldValidator fieldValidator = null;
84 // -- initialize attribute descriptors
87 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88 java.lang.Integer.TYPE, "_colour", "colour",
89 org.exolab.castor.xml.NodeType.Attribute);
90 handler = new org.exolab.castor.xml.XMLFieldHandler()
92 public java.lang.Object getValue(java.lang.Object object)
93 throws IllegalStateException
95 JSeq target = (JSeq) object;
96 if (!target.hasColour())
100 return new java.lang.Integer(target.getColour());
103 public void setValue(java.lang.Object object, java.lang.Object value)
104 throws IllegalStateException, IllegalArgumentException
108 JSeq target = (JSeq) object;
109 // if null, use delete method for optional primitives
112 target.deleteColour();
115 target.setColour(((java.lang.Integer) value).intValue());
116 } catch (java.lang.Exception ex)
118 throw new IllegalStateException(ex.toString());
122 public java.lang.Object newInstance(java.lang.Object parent)
127 desc.setHandler(handler);
128 desc.setMultivalued(false);
129 addFieldDescriptor(desc);
131 // -- validation code for: _colour
132 fieldValidator = new org.exolab.castor.xml.FieldValidator();
134 org.exolab.castor.xml.validators.IntValidator typeValidator;
135 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
136 fieldValidator.setValidator(typeValidator);
137 typeValidator.setMinInclusive(-2147483648);
138 typeValidator.setMaxInclusive(2147483647);
140 desc.setValidator(fieldValidator);
142 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
143 java.lang.Integer.TYPE, "_start", "start",
144 org.exolab.castor.xml.NodeType.Attribute);
145 handler = new org.exolab.castor.xml.XMLFieldHandler()
147 public java.lang.Object getValue(java.lang.Object object)
148 throws IllegalStateException
150 JSeq target = (JSeq) object;
151 if (!target.hasStart())
155 return new java.lang.Integer(target.getStart());
158 public void setValue(java.lang.Object object, java.lang.Object value)
159 throws IllegalStateException, IllegalArgumentException
163 JSeq target = (JSeq) object;
164 // ignore null values for non optional primitives
170 target.setStart(((java.lang.Integer) value).intValue());
171 } catch (java.lang.Exception ex)
173 throw new IllegalStateException(ex.toString());
177 public java.lang.Object newInstance(java.lang.Object parent)
182 desc.setHandler(handler);
183 desc.setRequired(true);
184 desc.setMultivalued(false);
185 addFieldDescriptor(desc);
187 // -- validation code for: _start
188 fieldValidator = new org.exolab.castor.xml.FieldValidator();
189 fieldValidator.setMinOccurs(1);
191 org.exolab.castor.xml.validators.IntValidator typeValidator;
192 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
193 fieldValidator.setValidator(typeValidator);
194 typeValidator.setMinInclusive(-2147483648);
195 typeValidator.setMaxInclusive(2147483647);
197 desc.setValidator(fieldValidator);
199 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
200 java.lang.Integer.TYPE, "_end", "end",
201 org.exolab.castor.xml.NodeType.Attribute);
202 handler = new org.exolab.castor.xml.XMLFieldHandler()
204 public java.lang.Object getValue(java.lang.Object object)
205 throws IllegalStateException
207 JSeq target = (JSeq) object;
208 if (!target.hasEnd())
212 return new java.lang.Integer(target.getEnd());
215 public void setValue(java.lang.Object object, java.lang.Object value)
216 throws IllegalStateException, IllegalArgumentException
220 JSeq target = (JSeq) object;
221 // ignore null values for non optional primitives
227 target.setEnd(((java.lang.Integer) value).intValue());
228 } catch (java.lang.Exception ex)
230 throw new IllegalStateException(ex.toString());
234 public java.lang.Object newInstance(java.lang.Object parent)
239 desc.setHandler(handler);
240 desc.setRequired(true);
241 desc.setMultivalued(false);
242 addFieldDescriptor(desc);
244 // -- validation code for: _end
245 fieldValidator = new org.exolab.castor.xml.FieldValidator();
246 fieldValidator.setMinOccurs(1);
248 org.exolab.castor.xml.validators.IntValidator typeValidator;
249 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
250 fieldValidator.setValidator(typeValidator);
251 typeValidator.setMinInclusive(-2147483648);
252 typeValidator.setMaxInclusive(2147483647);
254 desc.setValidator(fieldValidator);
256 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
257 java.lang.String.class, "_id", "id",
258 org.exolab.castor.xml.NodeType.Attribute);
259 desc.setImmutable(true);
260 handler = new org.exolab.castor.xml.XMLFieldHandler()
262 public java.lang.Object getValue(java.lang.Object object)
263 throws IllegalStateException
265 JSeq target = (JSeq) object;
266 return target.getId();
269 public void setValue(java.lang.Object object, java.lang.Object value)
270 throws IllegalStateException, IllegalArgumentException
274 JSeq target = (JSeq) object;
275 target.setId((java.lang.String) value);
276 } catch (java.lang.Exception ex)
278 throw new IllegalStateException(ex.toString());
282 public java.lang.Object newInstance(java.lang.Object parent)
287 desc.setHandler(handler);
288 desc.setRequired(true);
289 desc.setMultivalued(false);
290 addFieldDescriptor(desc);
292 // -- validation code for: _id
293 fieldValidator = new org.exolab.castor.xml.FieldValidator();
294 fieldValidator.setMinOccurs(1);
296 org.exolab.castor.xml.validators.StringValidator typeValidator;
297 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
298 fieldValidator.setValidator(typeValidator);
299 typeValidator.setWhiteSpace("preserve");
301 desc.setValidator(fieldValidator);
303 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
304 java.lang.Boolean.TYPE, "_hidden", "hidden",
305 org.exolab.castor.xml.NodeType.Attribute);
306 handler = new org.exolab.castor.xml.XMLFieldHandler()
308 public java.lang.Object getValue(java.lang.Object object)
309 throws IllegalStateException
311 JSeq target = (JSeq) object;
312 if (!target.hasHidden())
316 return (target.getHidden() ? java.lang.Boolean.TRUE
317 : java.lang.Boolean.FALSE);
320 public void setValue(java.lang.Object object, java.lang.Object value)
321 throws IllegalStateException, IllegalArgumentException
325 JSeq target = (JSeq) object;
326 // if null, use delete method for optional primitives
329 target.deleteHidden();
332 target.setHidden(((java.lang.Boolean) value).booleanValue());
333 } catch (java.lang.Exception ex)
335 throw new IllegalStateException(ex.toString());
339 public java.lang.Object newInstance(java.lang.Object parent)
344 desc.setHandler(handler);
345 desc.setMultivalued(false);
346 addFieldDescriptor(desc);
348 // -- validation code for: _hidden
349 fieldValidator = new org.exolab.castor.xml.FieldValidator();
351 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
352 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
353 fieldValidator.setValidator(typeValidator);
355 desc.setValidator(fieldValidator);
356 // -- initialize element descriptors
359 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
360 jalview.schemabinding.version2.Features.class, "_featuresList",
361 "features", org.exolab.castor.xml.NodeType.Element);
362 handler = new org.exolab.castor.xml.XMLFieldHandler()
364 public java.lang.Object getValue(java.lang.Object object)
365 throws IllegalStateException
367 JSeq target = (JSeq) object;
368 return target.getFeatures();
371 public void setValue(java.lang.Object object, java.lang.Object value)
372 throws IllegalStateException, IllegalArgumentException
376 JSeq target = (JSeq) object;
377 target.addFeatures((jalview.schemabinding.version2.Features) value);
378 } catch (java.lang.Exception ex)
380 throw new IllegalStateException(ex.toString());
384 public void resetValue(Object object) throws IllegalStateException,
385 IllegalArgumentException
389 JSeq target = (JSeq) object;
390 target.removeAllFeatures();
391 } catch (java.lang.Exception ex)
393 throw new IllegalStateException(ex.toString());
397 public java.lang.Object newInstance(java.lang.Object parent)
399 return new jalview.schemabinding.version2.Features();
402 desc.setHandler(handler);
403 desc.setNameSpaceURI("www.jalview.org");
404 desc.setMultivalued(true);
405 addFieldDescriptor(desc);
407 // -- validation code for: _featuresList
408 fieldValidator = new org.exolab.castor.xml.FieldValidator();
409 fieldValidator.setMinOccurs(0);
412 desc.setValidator(fieldValidator);
414 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
415 jalview.schemabinding.version2.Pdbids.class, "_pdbidsList",
416 "pdbids", org.exolab.castor.xml.NodeType.Element);
417 handler = new org.exolab.castor.xml.XMLFieldHandler()
419 public java.lang.Object getValue(java.lang.Object object)
420 throws IllegalStateException
422 JSeq target = (JSeq) object;
423 return target.getPdbids();
426 public void setValue(java.lang.Object object, java.lang.Object value)
427 throws IllegalStateException, IllegalArgumentException
431 JSeq target = (JSeq) object;
432 target.addPdbids((jalview.schemabinding.version2.Pdbids) value);
433 } catch (java.lang.Exception ex)
435 throw new IllegalStateException(ex.toString());
439 public void resetValue(Object object) throws IllegalStateException,
440 IllegalArgumentException
444 JSeq target = (JSeq) object;
445 target.removeAllPdbids();
446 } catch (java.lang.Exception ex)
448 throw new IllegalStateException(ex.toString());
452 public java.lang.Object newInstance(java.lang.Object parent)
454 return new jalview.schemabinding.version2.Pdbids();
457 desc.setHandler(handler);
458 desc.setNameSpaceURI("www.jalview.org");
459 desc.setMultivalued(true);
460 addFieldDescriptor(desc);
462 // -- validation code for: _pdbidsList
463 fieldValidator = new org.exolab.castor.xml.FieldValidator();
464 fieldValidator.setMinOccurs(0);
467 desc.setValidator(fieldValidator);
468 // -- _hiddenSequencesList
469 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
470 java.lang.Integer.TYPE, "_hiddenSequencesList",
471 "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
472 handler = new org.exolab.castor.xml.XMLFieldHandler()
474 public java.lang.Object getValue(java.lang.Object object)
475 throws IllegalStateException
477 JSeq target = (JSeq) object;
478 return target.getHiddenSequences();
481 public void setValue(java.lang.Object object, java.lang.Object value)
482 throws IllegalStateException, IllegalArgumentException
486 JSeq target = (JSeq) object;
487 // ignore null values for non optional primitives
493 target.addHiddenSequences(((java.lang.Integer) value).intValue());
494 } catch (java.lang.Exception ex)
496 throw new IllegalStateException(ex.toString());
500 public void resetValue(Object object) throws IllegalStateException,
501 IllegalArgumentException
505 JSeq target = (JSeq) object;
506 target.removeAllHiddenSequences();
507 } catch (java.lang.Exception ex)
509 throw new IllegalStateException(ex.toString());
513 public java.lang.Object newInstance(java.lang.Object parent)
518 desc.setHandler(handler);
519 desc.setNameSpaceURI("www.jalview.org");
520 desc.setMultivalued(true);
521 addFieldDescriptor(desc);
523 // -- validation code for: _hiddenSequencesList
524 fieldValidator = new org.exolab.castor.xml.FieldValidator();
525 fieldValidator.setMinOccurs(0);
527 org.exolab.castor.xml.validators.IntValidator typeValidator;
528 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
529 fieldValidator.setValidator(typeValidator);
530 typeValidator.setMinInclusive(-2147483648);
531 typeValidator.setMaxInclusive(2147483647);
533 desc.setValidator(fieldValidator);
541 * Method getAccessMode.
543 * @return the access mode specified for this class.
545 public org.exolab.castor.mapping.AccessMode getAccessMode()
551 * Method getIdentity.
553 * @return the identity field, null if this class has no identity.
555 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
557 return super.getIdentity();
561 * Method getJavaClass.
563 * @return the Java class represented by this descriptor.
565 public java.lang.Class getJavaClass()
567 return jalview.schemabinding.version2.JSeq.class;
571 * Method getNameSpacePrefix.
573 * @return the namespace prefix to use when marshaling as XML.
575 public java.lang.String getNameSpacePrefix()
581 * Method getNameSpaceURI.
583 * @return the namespace URI used when marshaling and unmarshaling as XML.
585 public java.lang.String getNameSpaceURI()
591 * Method getValidator.
593 * @return a specific validator for the class described by this
596 public org.exolab.castor.xml.TypeValidator getValidator()
604 * @return the XML Name for the Class being described.
606 public java.lang.String getXMLName()
612 * Method isElementDefinition.
614 * @return true if XML schema definition of this Class is that of a global
615 * element or element with anonymous type definition.
617 public boolean isElementDefinition()
619 return _elementDefinition;