2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2.descriptors;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import jalview.schemabinding.version2.JSeq;
17 * Class JSeqDescriptor.
19 * @version $Revision$ $Date$
21 public class JSeqDescriptor extends
22 org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public JSeqDescriptor()
56 _nsURI = "www.jalview.org";
58 _elementDefinition = true;
60 // -- set grouping compositor
61 setCompositorAsSequence();
62 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63 org.exolab.castor.mapping.FieldHandler handler = null;
64 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65 // -- initialize attribute descriptors
68 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69 java.lang.Integer.TYPE, "_colour", "colour",
70 org.exolab.castor.xml.NodeType.Attribute);
71 handler = new org.exolab.castor.xml.XMLFieldHandler()
73 public java.lang.Object getValue(java.lang.Object object)
74 throws IllegalStateException
76 JSeq target = (JSeq) object;
77 if (!target.hasColour())
81 return new java.lang.Integer(target.getColour());
84 public void setValue(java.lang.Object object, java.lang.Object value)
85 throws IllegalStateException, IllegalArgumentException
89 JSeq target = (JSeq) object;
90 // if null, use delete method for optional primitives
93 target.deleteColour();
96 target.setColour(((java.lang.Integer) value).intValue());
97 } catch (java.lang.Exception ex)
99 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent)
108 desc.setHandler(handler);
109 desc.setMultivalued(false);
110 addFieldDescriptor(desc);
112 // -- validation code for: _colour
113 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115 org.exolab.castor.xml.validators.IntValidator typeValidator;
116 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
117 fieldValidator.setValidator(typeValidator);
118 typeValidator.setMinInclusive(-2147483648);
119 typeValidator.setMaxInclusive(2147483647);
121 desc.setValidator(fieldValidator);
123 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
124 java.lang.Integer.TYPE, "_start", "start",
125 org.exolab.castor.xml.NodeType.Attribute);
126 handler = new org.exolab.castor.xml.XMLFieldHandler()
128 public java.lang.Object getValue(java.lang.Object object)
129 throws IllegalStateException
131 JSeq target = (JSeq) object;
132 if (!target.hasStart())
136 return new java.lang.Integer(target.getStart());
139 public void setValue(java.lang.Object object, java.lang.Object value)
140 throws IllegalStateException, IllegalArgumentException
144 JSeq target = (JSeq) object;
145 // ignore null values for non optional primitives
151 target.setStart(((java.lang.Integer) value).intValue());
152 } catch (java.lang.Exception ex)
154 throw new IllegalStateException(ex.toString());
158 public java.lang.Object newInstance(java.lang.Object parent)
163 desc.setHandler(handler);
164 desc.setRequired(true);
165 desc.setMultivalued(false);
166 addFieldDescriptor(desc);
168 // -- validation code for: _start
169 fieldValidator = new org.exolab.castor.xml.FieldValidator();
170 fieldValidator.setMinOccurs(1);
172 org.exolab.castor.xml.validators.IntValidator typeValidator;
173 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
174 fieldValidator.setValidator(typeValidator);
175 typeValidator.setMinInclusive(-2147483648);
176 typeValidator.setMaxInclusive(2147483647);
178 desc.setValidator(fieldValidator);
180 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
181 java.lang.Integer.TYPE, "_end", "end",
182 org.exolab.castor.xml.NodeType.Attribute);
183 handler = new org.exolab.castor.xml.XMLFieldHandler()
185 public java.lang.Object getValue(java.lang.Object object)
186 throws IllegalStateException
188 JSeq target = (JSeq) object;
189 if (!target.hasEnd())
193 return new java.lang.Integer(target.getEnd());
196 public void setValue(java.lang.Object object, java.lang.Object value)
197 throws IllegalStateException, IllegalArgumentException
201 JSeq target = (JSeq) object;
202 // ignore null values for non optional primitives
208 target.setEnd(((java.lang.Integer) value).intValue());
209 } catch (java.lang.Exception ex)
211 throw new IllegalStateException(ex.toString());
215 public java.lang.Object newInstance(java.lang.Object parent)
220 desc.setHandler(handler);
221 desc.setRequired(true);
222 desc.setMultivalued(false);
223 addFieldDescriptor(desc);
225 // -- validation code for: _end
226 fieldValidator = new org.exolab.castor.xml.FieldValidator();
227 fieldValidator.setMinOccurs(1);
229 org.exolab.castor.xml.validators.IntValidator typeValidator;
230 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
231 fieldValidator.setValidator(typeValidator);
232 typeValidator.setMinInclusive(-2147483648);
233 typeValidator.setMaxInclusive(2147483647);
235 desc.setValidator(fieldValidator);
237 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
238 java.lang.String.class, "_id", "id",
239 org.exolab.castor.xml.NodeType.Attribute);
240 desc.setImmutable(true);
241 handler = new org.exolab.castor.xml.XMLFieldHandler()
243 public java.lang.Object getValue(java.lang.Object object)
244 throws IllegalStateException
246 JSeq target = (JSeq) object;
247 return target.getId();
250 public void setValue(java.lang.Object object, java.lang.Object value)
251 throws IllegalStateException, IllegalArgumentException
255 JSeq target = (JSeq) object;
256 target.setId((java.lang.String) value);
257 } catch (java.lang.Exception ex)
259 throw new IllegalStateException(ex.toString());
263 public java.lang.Object newInstance(java.lang.Object parent)
268 desc.setHandler(handler);
269 desc.setRequired(true);
270 desc.setMultivalued(false);
271 addFieldDescriptor(desc);
273 // -- validation code for: _id
274 fieldValidator = new org.exolab.castor.xml.FieldValidator();
275 fieldValidator.setMinOccurs(1);
277 org.exolab.castor.xml.validators.StringValidator typeValidator;
278 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
279 fieldValidator.setValidator(typeValidator);
280 typeValidator.setWhiteSpace("preserve");
282 desc.setValidator(fieldValidator);
284 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
285 java.lang.Boolean.TYPE, "_hidden", "hidden",
286 org.exolab.castor.xml.NodeType.Attribute);
287 handler = new org.exolab.castor.xml.XMLFieldHandler()
289 public java.lang.Object getValue(java.lang.Object object)
290 throws IllegalStateException
292 JSeq target = (JSeq) object;
293 if (!target.hasHidden())
297 return (target.getHidden() ? java.lang.Boolean.TRUE
298 : java.lang.Boolean.FALSE);
301 public void setValue(java.lang.Object object, java.lang.Object value)
302 throws IllegalStateException, IllegalArgumentException
306 JSeq target = (JSeq) object;
307 // if null, use delete method for optional primitives
310 target.deleteHidden();
313 target.setHidden(((java.lang.Boolean) value).booleanValue());
314 } catch (java.lang.Exception ex)
316 throw new IllegalStateException(ex.toString());
320 public java.lang.Object newInstance(java.lang.Object parent)
325 desc.setHandler(handler);
326 desc.setMultivalued(false);
327 addFieldDescriptor(desc);
329 // -- validation code for: _hidden
330 fieldValidator = new org.exolab.castor.xml.FieldValidator();
332 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
333 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
334 fieldValidator.setValidator(typeValidator);
336 desc.setValidator(fieldValidator);
337 // -- initialize element descriptors
340 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
341 jalview.schemabinding.version2.Features.class, "_featuresList",
342 "features", org.exolab.castor.xml.NodeType.Element);
343 handler = new org.exolab.castor.xml.XMLFieldHandler()
345 public java.lang.Object getValue(java.lang.Object object)
346 throws IllegalStateException
348 JSeq target = (JSeq) object;
349 return target.getFeatures();
352 public void setValue(java.lang.Object object, java.lang.Object value)
353 throws IllegalStateException, IllegalArgumentException
357 JSeq target = (JSeq) object;
358 target.addFeatures((jalview.schemabinding.version2.Features) value);
359 } catch (java.lang.Exception ex)
361 throw new IllegalStateException(ex.toString());
365 public void resetValue(Object object) throws IllegalStateException,
366 IllegalArgumentException
370 JSeq target = (JSeq) object;
371 target.removeAllFeatures();
372 } catch (java.lang.Exception ex)
374 throw new IllegalStateException(ex.toString());
378 public java.lang.Object newInstance(java.lang.Object parent)
380 return new jalview.schemabinding.version2.Features();
383 desc.setHandler(handler);
384 desc.setNameSpaceURI("www.jalview.org");
385 desc.setMultivalued(true);
386 addFieldDescriptor(desc);
388 // -- validation code for: _featuresList
389 fieldValidator = new org.exolab.castor.xml.FieldValidator();
390 fieldValidator.setMinOccurs(0);
393 desc.setValidator(fieldValidator);
395 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
396 jalview.schemabinding.version2.Pdbids.class, "_pdbidsList",
397 "pdbids", org.exolab.castor.xml.NodeType.Element);
398 handler = new org.exolab.castor.xml.XMLFieldHandler()
400 public java.lang.Object getValue(java.lang.Object object)
401 throws IllegalStateException
403 JSeq target = (JSeq) object;
404 return target.getPdbids();
407 public void setValue(java.lang.Object object, java.lang.Object value)
408 throws IllegalStateException, IllegalArgumentException
412 JSeq target = (JSeq) object;
413 target.addPdbids((jalview.schemabinding.version2.Pdbids) value);
414 } catch (java.lang.Exception ex)
416 throw new IllegalStateException(ex.toString());
420 public void resetValue(Object object) throws IllegalStateException,
421 IllegalArgumentException
425 JSeq target = (JSeq) object;
426 target.removeAllPdbids();
427 } catch (java.lang.Exception ex)
429 throw new IllegalStateException(ex.toString());
433 public java.lang.Object newInstance(java.lang.Object parent)
435 return new jalview.schemabinding.version2.Pdbids();
438 desc.setHandler(handler);
439 desc.setNameSpaceURI("www.jalview.org");
440 desc.setMultivalued(true);
441 addFieldDescriptor(desc);
443 // -- validation code for: _pdbidsList
444 fieldValidator = new org.exolab.castor.xml.FieldValidator();
445 fieldValidator.setMinOccurs(0);
448 desc.setValidator(fieldValidator);
449 // -- _hiddenSequencesList
450 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
451 java.lang.Integer.TYPE, "_hiddenSequencesList",
452 "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
453 handler = new org.exolab.castor.xml.XMLFieldHandler()
455 public java.lang.Object getValue(java.lang.Object object)
456 throws IllegalStateException
458 JSeq target = (JSeq) object;
459 return target.getHiddenSequences();
462 public void setValue(java.lang.Object object, java.lang.Object value)
463 throws IllegalStateException, IllegalArgumentException
467 JSeq target = (JSeq) object;
468 // ignore null values for non optional primitives
474 target.addHiddenSequences(((java.lang.Integer) value).intValue());
475 } catch (java.lang.Exception ex)
477 throw new IllegalStateException(ex.toString());
481 public void resetValue(Object object) throws IllegalStateException,
482 IllegalArgumentException
486 JSeq target = (JSeq) object;
487 target.removeAllHiddenSequences();
488 } catch (java.lang.Exception ex)
490 throw new IllegalStateException(ex.toString());
494 public java.lang.Object newInstance(java.lang.Object parent)
499 desc.setHandler(handler);
500 desc.setNameSpaceURI("www.jalview.org");
501 desc.setMultivalued(true);
502 addFieldDescriptor(desc);
504 // -- validation code for: _hiddenSequencesList
505 fieldValidator = new org.exolab.castor.xml.FieldValidator();
506 fieldValidator.setMinOccurs(0);
508 org.exolab.castor.xml.validators.IntValidator typeValidator;
509 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
510 fieldValidator.setValidator(typeValidator);
511 typeValidator.setMinInclusive(-2147483648);
512 typeValidator.setMaxInclusive(2147483647);
514 desc.setValidator(fieldValidator);
516 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
517 jalview.schemabinding.version2.RnaViewer.class,
518 "_rnaViewerList", "rnaViewer",
519 org.exolab.castor.xml.NodeType.Element);
520 handler = new org.exolab.castor.xml.XMLFieldHandler()
522 public java.lang.Object getValue(java.lang.Object object)
523 throws IllegalStateException
525 JSeq target = (JSeq) object;
526 return target.getRnaViewer();
529 public void setValue(java.lang.Object object, java.lang.Object value)
530 throws IllegalStateException, IllegalArgumentException
534 JSeq target = (JSeq) object;
535 target.addRnaViewer((jalview.schemabinding.version2.RnaViewer) value);
536 } catch (java.lang.Exception ex)
538 throw new IllegalStateException(ex.toString());
542 public void resetValue(Object object) throws IllegalStateException,
543 IllegalArgumentException
547 JSeq target = (JSeq) object;
548 target.removeAllRnaViewer();
549 } catch (java.lang.Exception ex)
551 throw new IllegalStateException(ex.toString());
555 public java.lang.Object newInstance(java.lang.Object parent)
557 return new jalview.schemabinding.version2.RnaViewer();
560 desc.setHandler(handler);
561 desc.setNameSpaceURI("www.jalview.org");
562 desc.setMultivalued(true);
563 addFieldDescriptor(desc);
565 // -- validation code for: _rnaViewerList
566 fieldValidator = new org.exolab.castor.xml.FieldValidator();
567 fieldValidator.setMinOccurs(0);
570 desc.setValidator(fieldValidator);
578 * Method getAccessMode.
580 * @return the access mode specified for this class.
582 public org.exolab.castor.mapping.AccessMode getAccessMode()
588 * Method getIdentity.
590 * @return the identity field, null if this class has no identity.
592 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
594 return super.getIdentity();
598 * Method getJavaClass.
600 * @return the Java class represented by this descriptor.
602 public java.lang.Class getJavaClass()
604 return jalview.schemabinding.version2.JSeq.class;
608 * Method getNameSpacePrefix.
610 * @return the namespace prefix to use when marshaling as XML.
612 public java.lang.String getNameSpacePrefix()
618 * Method getNameSpaceURI.
620 * @return the namespace URI used when marshaling and unmarshaling as XML.
622 public java.lang.String getNameSpaceURI()
628 * Method getValidator.
630 * @return a specific validator for the class described by this
633 public org.exolab.castor.xml.TypeValidator getValidator()
641 * @return the XML Name for the Class being described.
643 public java.lang.String getXMLName()
649 * Method isElementDefinition.
651 * @return true if XML schema definition of this Class is that of a global
652 * element or element with anonymous type definition.
654 public boolean isElementDefinition()
656 return _elementDefinition;