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.AnnotationColourScheme;
17 * Class AnnotationColourSchemeDescriptor.
19 * @version $Revision$ $Date$
21 public class AnnotationColourSchemeDescriptor 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 AnnotationColourSchemeDescriptor()
56 _nsURI = "www.jalview.org";
57 _xmlName = "AnnotationColourScheme";
58 _elementDefinition = false;
59 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60 org.exolab.castor.mapping.FieldHandler handler = null;
61 org.exolab.castor.xml.FieldValidator fieldValidator = null;
62 // -- initialize attribute descriptors
65 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66 java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold",
67 org.exolab.castor.xml.NodeType.Attribute);
68 handler = new org.exolab.castor.xml.XMLFieldHandler()
70 public java.lang.Object getValue(java.lang.Object object)
71 throws IllegalStateException
73 AnnotationColourScheme target = (AnnotationColourScheme) object;
74 if (!target.hasAboveThreshold())
78 return new java.lang.Integer(target.getAboveThreshold());
81 public void setValue(java.lang.Object object, java.lang.Object value)
82 throws IllegalStateException, IllegalArgumentException
86 AnnotationColourScheme target = (AnnotationColourScheme) object;
87 // if null, use delete method for optional primitives
90 target.deleteAboveThreshold();
93 target.setAboveThreshold(((java.lang.Integer) value).intValue());
94 } catch (java.lang.Exception ex)
96 throw new IllegalStateException(ex.toString());
100 public java.lang.Object newInstance(java.lang.Object parent)
105 desc.setHandler(handler);
106 desc.setMultivalued(false);
107 addFieldDescriptor(desc);
109 // -- validation code for: _aboveThreshold
110 fieldValidator = new org.exolab.castor.xml.FieldValidator();
112 org.exolab.castor.xml.validators.IntValidator typeValidator;
113 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
114 fieldValidator.setValidator(typeValidator);
115 typeValidator.setMinInclusive(-2147483648);
116 typeValidator.setMaxInclusive(2147483647);
118 desc.setValidator(fieldValidator);
120 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
121 java.lang.String.class, "_annotation", "annotation",
122 org.exolab.castor.xml.NodeType.Attribute);
123 desc.setImmutable(true);
124 handler = new org.exolab.castor.xml.XMLFieldHandler()
126 public java.lang.Object getValue(java.lang.Object object)
127 throws IllegalStateException
129 AnnotationColourScheme target = (AnnotationColourScheme) object;
130 return target.getAnnotation();
133 public void setValue(java.lang.Object object, java.lang.Object value)
134 throws IllegalStateException, IllegalArgumentException
138 AnnotationColourScheme target = (AnnotationColourScheme) object;
139 target.setAnnotation((java.lang.String) value);
140 } catch (java.lang.Exception ex)
142 throw new IllegalStateException(ex.toString());
146 public java.lang.Object newInstance(java.lang.Object parent)
151 desc.setHandler(handler);
152 desc.setMultivalued(false);
153 addFieldDescriptor(desc);
155 // -- validation code for: _annotation
156 fieldValidator = new org.exolab.castor.xml.FieldValidator();
158 org.exolab.castor.xml.validators.StringValidator typeValidator;
159 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
160 fieldValidator.setValidator(typeValidator);
161 typeValidator.setWhiteSpace("preserve");
163 desc.setValidator(fieldValidator);
165 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
166 java.lang.Integer.TYPE, "_minColour", "minColour",
167 org.exolab.castor.xml.NodeType.Attribute);
168 handler = new org.exolab.castor.xml.XMLFieldHandler()
170 public java.lang.Object getValue(java.lang.Object object)
171 throws IllegalStateException
173 AnnotationColourScheme target = (AnnotationColourScheme) object;
174 if (!target.hasMinColour())
178 return new java.lang.Integer(target.getMinColour());
181 public void setValue(java.lang.Object object, java.lang.Object value)
182 throws IllegalStateException, IllegalArgumentException
186 AnnotationColourScheme target = (AnnotationColourScheme) object;
187 // if null, use delete method for optional primitives
190 target.deleteMinColour();
193 target.setMinColour(((java.lang.Integer) value).intValue());
194 } catch (java.lang.Exception ex)
196 throw new IllegalStateException(ex.toString());
200 public java.lang.Object newInstance(java.lang.Object parent)
205 desc.setHandler(handler);
206 desc.setMultivalued(false);
207 addFieldDescriptor(desc);
209 // -- validation code for: _minColour
210 fieldValidator = new org.exolab.castor.xml.FieldValidator();
212 org.exolab.castor.xml.validators.IntValidator typeValidator;
213 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
214 fieldValidator.setValidator(typeValidator);
215 typeValidator.setMinInclusive(-2147483648);
216 typeValidator.setMaxInclusive(2147483647);
218 desc.setValidator(fieldValidator);
220 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
221 java.lang.Integer.TYPE, "_maxColour", "maxColour",
222 org.exolab.castor.xml.NodeType.Attribute);
223 handler = new org.exolab.castor.xml.XMLFieldHandler()
225 public java.lang.Object getValue(java.lang.Object object)
226 throws IllegalStateException
228 AnnotationColourScheme target = (AnnotationColourScheme) object;
229 if (!target.hasMaxColour())
233 return new java.lang.Integer(target.getMaxColour());
236 public void setValue(java.lang.Object object, java.lang.Object value)
237 throws IllegalStateException, IllegalArgumentException
241 AnnotationColourScheme target = (AnnotationColourScheme) object;
242 // if null, use delete method for optional primitives
245 target.deleteMaxColour();
248 target.setMaxColour(((java.lang.Integer) value).intValue());
249 } catch (java.lang.Exception ex)
251 throw new IllegalStateException(ex.toString());
255 public java.lang.Object newInstance(java.lang.Object parent)
260 desc.setHandler(handler);
261 desc.setMultivalued(false);
262 addFieldDescriptor(desc);
264 // -- validation code for: _maxColour
265 fieldValidator = new org.exolab.castor.xml.FieldValidator();
267 org.exolab.castor.xml.validators.IntValidator typeValidator;
268 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
269 fieldValidator.setValidator(typeValidator);
270 typeValidator.setMinInclusive(-2147483648);
271 typeValidator.setMaxInclusive(2147483647);
273 desc.setValidator(fieldValidator);
275 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
276 java.lang.String.class, "_colourScheme", "colourScheme",
277 org.exolab.castor.xml.NodeType.Attribute);
278 desc.setImmutable(true);
279 handler = new org.exolab.castor.xml.XMLFieldHandler()
281 public java.lang.Object getValue(java.lang.Object object)
282 throws IllegalStateException
284 AnnotationColourScheme target = (AnnotationColourScheme) object;
285 return target.getColourScheme();
288 public void setValue(java.lang.Object object, java.lang.Object value)
289 throws IllegalStateException, IllegalArgumentException
293 AnnotationColourScheme target = (AnnotationColourScheme) object;
294 target.setColourScheme((java.lang.String) value);
295 } catch (java.lang.Exception ex)
297 throw new IllegalStateException(ex.toString());
301 public java.lang.Object newInstance(java.lang.Object parent)
306 desc.setHandler(handler);
307 desc.setMultivalued(false);
308 addFieldDescriptor(desc);
310 // -- validation code for: _colourScheme
311 fieldValidator = new org.exolab.castor.xml.FieldValidator();
313 org.exolab.castor.xml.validators.StringValidator typeValidator;
314 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
315 fieldValidator.setValidator(typeValidator);
316 typeValidator.setWhiteSpace("preserve");
318 desc.setValidator(fieldValidator);
320 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
321 java.lang.Float.TYPE, "_threshold", "threshold",
322 org.exolab.castor.xml.NodeType.Attribute);
323 handler = new org.exolab.castor.xml.XMLFieldHandler()
325 public java.lang.Object getValue(java.lang.Object object)
326 throws IllegalStateException
328 AnnotationColourScheme target = (AnnotationColourScheme) object;
329 if (!target.hasThreshold())
333 return new java.lang.Float(target.getThreshold());
336 public void setValue(java.lang.Object object, java.lang.Object value)
337 throws IllegalStateException, IllegalArgumentException
341 AnnotationColourScheme target = (AnnotationColourScheme) object;
342 // if null, use delete method for optional primitives
345 target.deleteThreshold();
348 target.setThreshold(((java.lang.Float) value).floatValue());
349 } catch (java.lang.Exception ex)
351 throw new IllegalStateException(ex.toString());
355 public java.lang.Object newInstance(java.lang.Object parent)
360 desc.setHandler(handler);
361 desc.setMultivalued(false);
362 addFieldDescriptor(desc);
364 // -- validation code for: _threshold
365 fieldValidator = new org.exolab.castor.xml.FieldValidator();
367 org.exolab.castor.xml.validators.FloatValidator typeValidator;
368 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
369 fieldValidator.setValidator(typeValidator);
370 typeValidator.setMinInclusive((float) -3.4028235E38);
371 typeValidator.setMaxInclusive((float) 3.4028235E38);
373 desc.setValidator(fieldValidator);
375 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
376 java.lang.Boolean.TYPE, "_perSequence", "perSequence",
377 org.exolab.castor.xml.NodeType.Attribute);
378 handler = new org.exolab.castor.xml.XMLFieldHandler()
380 public java.lang.Object getValue(java.lang.Object object)
381 throws IllegalStateException
383 AnnotationColourScheme target = (AnnotationColourScheme) object;
384 if (!target.hasPerSequence())
388 return (target.getPerSequence() ? java.lang.Boolean.TRUE
389 : java.lang.Boolean.FALSE);
392 public void setValue(java.lang.Object object, java.lang.Object value)
393 throws IllegalStateException, IllegalArgumentException
397 AnnotationColourScheme target = (AnnotationColourScheme) object;
398 // if null, use delete method for optional primitives
401 target.deletePerSequence();
404 target.setPerSequence(((java.lang.Boolean) value).booleanValue());
405 } catch (java.lang.Exception ex)
407 throw new IllegalStateException(ex.toString());
411 public java.lang.Object newInstance(java.lang.Object parent)
416 desc.setHandler(handler);
417 desc.setMultivalued(false);
418 addFieldDescriptor(desc);
420 // -- validation code for: _perSequence
421 fieldValidator = new org.exolab.castor.xml.FieldValidator();
423 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
424 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
425 fieldValidator.setValidator(typeValidator);
427 desc.setValidator(fieldValidator);
428 // -- _predefinedColours
429 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
430 java.lang.Boolean.TYPE, "_predefinedColours",
431 "predefinedColours", org.exolab.castor.xml.NodeType.Attribute);
432 handler = new org.exolab.castor.xml.XMLFieldHandler()
434 public java.lang.Object getValue(java.lang.Object object)
435 throws IllegalStateException
437 AnnotationColourScheme target = (AnnotationColourScheme) object;
438 if (!target.hasPredefinedColours())
442 return (target.getPredefinedColours() ? java.lang.Boolean.TRUE
443 : java.lang.Boolean.FALSE);
446 public void setValue(java.lang.Object object, java.lang.Object value)
447 throws IllegalStateException, IllegalArgumentException
451 AnnotationColourScheme target = (AnnotationColourScheme) object;
452 // if null, use delete method for optional primitives
455 target.deletePredefinedColours();
458 target.setPredefinedColours(((java.lang.Boolean) value)
460 } catch (java.lang.Exception ex)
462 throw new IllegalStateException(ex.toString());
466 public java.lang.Object newInstance(java.lang.Object parent)
471 desc.setHandler(handler);
472 desc.setMultivalued(false);
473 addFieldDescriptor(desc);
475 // -- validation code for: _predefinedColours
476 fieldValidator = new org.exolab.castor.xml.FieldValidator();
478 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
479 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
480 fieldValidator.setValidator(typeValidator);
482 desc.setValidator(fieldValidator);
483 // -- initialize element descriptors
492 * Method getAccessMode.
494 * @return the access mode specified for this class.
496 public org.exolab.castor.mapping.AccessMode getAccessMode()
502 * Method getIdentity.
504 * @return the identity field, null if this class has no identity.
506 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
508 return super.getIdentity();
512 * Method getJavaClass.
514 * @return the Java class represented by this descriptor.
516 public java.lang.Class getJavaClass()
518 return jalview.schemabinding.version2.AnnotationColourScheme.class;
522 * Method getNameSpacePrefix.
524 * @return the namespace prefix to use when marshaling as XML.
526 public java.lang.String getNameSpacePrefix()
532 * Method getNameSpaceURI.
534 * @return the namespace URI used when marshaling and unmarshaling as XML.
536 public java.lang.String getNameSpaceURI()
542 * Method getValidator.
544 * @return a specific validator for the class described by this
547 public org.exolab.castor.xml.TypeValidator getValidator()
555 * @return the XML Name for the Class being described.
557 public java.lang.String getXMLName()
563 * Method isElementDefinition.
565 * @return true if XML schema definition of this Class is that of a global
566 * element or element with anonymous type definition.
568 public boolean isElementDefinition()
570 return _elementDefinition;