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.AnnotationColourScheme;
36 * Class AnnotationColourSchemeDescriptor.
38 * @version $Revision$ $Date$
40 public class AnnotationColourSchemeDescriptor 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 AnnotationColourSchemeDescriptor()
75 _nsURI = "www.jalview.org";
76 _xmlName = "AnnotationColourScheme";
77 _elementDefinition = false;
78 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
79 org.exolab.castor.mapping.FieldHandler handler = null;
80 org.exolab.castor.xml.FieldValidator fieldValidator = null;
81 // -- initialize attribute descriptors
84 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
85 java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold",
86 org.exolab.castor.xml.NodeType.Attribute);
87 handler = new org.exolab.castor.xml.XMLFieldHandler()
89 public java.lang.Object getValue(java.lang.Object object)
90 throws IllegalStateException
92 AnnotationColourScheme target = (AnnotationColourScheme) object;
93 if (!target.hasAboveThreshold())
97 return new java.lang.Integer(target.getAboveThreshold());
100 public void setValue(java.lang.Object object, java.lang.Object value)
101 throws IllegalStateException, IllegalArgumentException
105 AnnotationColourScheme target = (AnnotationColourScheme) object;
106 // if null, use delete method for optional primitives
109 target.deleteAboveThreshold();
112 target.setAboveThreshold(((java.lang.Integer) value).intValue());
113 } catch (java.lang.Exception ex)
115 throw new IllegalStateException(ex.toString());
119 public java.lang.Object newInstance(java.lang.Object parent)
124 desc.setHandler(handler);
125 desc.setMultivalued(false);
126 addFieldDescriptor(desc);
128 // -- validation code for: _aboveThreshold
129 fieldValidator = new org.exolab.castor.xml.FieldValidator();
131 org.exolab.castor.xml.validators.IntValidator typeValidator;
132 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
133 fieldValidator.setValidator(typeValidator);
134 typeValidator.setMinInclusive(-2147483648);
135 typeValidator.setMaxInclusive(2147483647);
137 desc.setValidator(fieldValidator);
139 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
140 java.lang.String.class, "_annotation", "annotation",
141 org.exolab.castor.xml.NodeType.Attribute);
142 desc.setImmutable(true);
143 handler = new org.exolab.castor.xml.XMLFieldHandler()
145 public java.lang.Object getValue(java.lang.Object object)
146 throws IllegalStateException
148 AnnotationColourScheme target = (AnnotationColourScheme) object;
149 return target.getAnnotation();
152 public void setValue(java.lang.Object object, java.lang.Object value)
153 throws IllegalStateException, IllegalArgumentException
157 AnnotationColourScheme target = (AnnotationColourScheme) object;
158 target.setAnnotation((java.lang.String) value);
159 } catch (java.lang.Exception ex)
161 throw new IllegalStateException(ex.toString());
165 public java.lang.Object newInstance(java.lang.Object parent)
170 desc.setHandler(handler);
171 desc.setMultivalued(false);
172 addFieldDescriptor(desc);
174 // -- validation code for: _annotation
175 fieldValidator = new org.exolab.castor.xml.FieldValidator();
177 org.exolab.castor.xml.validators.StringValidator typeValidator;
178 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
179 fieldValidator.setValidator(typeValidator);
180 typeValidator.setWhiteSpace("preserve");
182 desc.setValidator(fieldValidator);
184 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
185 java.lang.Integer.TYPE, "_minColour", "minColour",
186 org.exolab.castor.xml.NodeType.Attribute);
187 handler = new org.exolab.castor.xml.XMLFieldHandler()
189 public java.lang.Object getValue(java.lang.Object object)
190 throws IllegalStateException
192 AnnotationColourScheme target = (AnnotationColourScheme) object;
193 if (!target.hasMinColour())
197 return new java.lang.Integer(target.getMinColour());
200 public void setValue(java.lang.Object object, java.lang.Object value)
201 throws IllegalStateException, IllegalArgumentException
205 AnnotationColourScheme target = (AnnotationColourScheme) object;
206 // if null, use delete method for optional primitives
209 target.deleteMinColour();
212 target.setMinColour(((java.lang.Integer) value).intValue());
213 } catch (java.lang.Exception ex)
215 throw new IllegalStateException(ex.toString());
219 public java.lang.Object newInstance(java.lang.Object parent)
224 desc.setHandler(handler);
225 desc.setMultivalued(false);
226 addFieldDescriptor(desc);
228 // -- validation code for: _minColour
229 fieldValidator = new org.exolab.castor.xml.FieldValidator();
231 org.exolab.castor.xml.validators.IntValidator typeValidator;
232 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
233 fieldValidator.setValidator(typeValidator);
234 typeValidator.setMinInclusive(-2147483648);
235 typeValidator.setMaxInclusive(2147483647);
237 desc.setValidator(fieldValidator);
239 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
240 java.lang.Integer.TYPE, "_maxColour", "maxColour",
241 org.exolab.castor.xml.NodeType.Attribute);
242 handler = new org.exolab.castor.xml.XMLFieldHandler()
244 public java.lang.Object getValue(java.lang.Object object)
245 throws IllegalStateException
247 AnnotationColourScheme target = (AnnotationColourScheme) object;
248 if (!target.hasMaxColour())
252 return new java.lang.Integer(target.getMaxColour());
255 public void setValue(java.lang.Object object, java.lang.Object value)
256 throws IllegalStateException, IllegalArgumentException
260 AnnotationColourScheme target = (AnnotationColourScheme) object;
261 // if null, use delete method for optional primitives
264 target.deleteMaxColour();
267 target.setMaxColour(((java.lang.Integer) value).intValue());
268 } catch (java.lang.Exception ex)
270 throw new IllegalStateException(ex.toString());
274 public java.lang.Object newInstance(java.lang.Object parent)
279 desc.setHandler(handler);
280 desc.setMultivalued(false);
281 addFieldDescriptor(desc);
283 // -- validation code for: _maxColour
284 fieldValidator = new org.exolab.castor.xml.FieldValidator();
286 org.exolab.castor.xml.validators.IntValidator typeValidator;
287 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
288 fieldValidator.setValidator(typeValidator);
289 typeValidator.setMinInclusive(-2147483648);
290 typeValidator.setMaxInclusive(2147483647);
292 desc.setValidator(fieldValidator);
294 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
295 java.lang.String.class, "_colourScheme", "colourScheme",
296 org.exolab.castor.xml.NodeType.Attribute);
297 desc.setImmutable(true);
298 handler = new org.exolab.castor.xml.XMLFieldHandler()
300 public java.lang.Object getValue(java.lang.Object object)
301 throws IllegalStateException
303 AnnotationColourScheme target = (AnnotationColourScheme) object;
304 return target.getColourScheme();
307 public void setValue(java.lang.Object object, java.lang.Object value)
308 throws IllegalStateException, IllegalArgumentException
312 AnnotationColourScheme target = (AnnotationColourScheme) object;
313 target.setColourScheme((java.lang.String) value);
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: _colourScheme
330 fieldValidator = new org.exolab.castor.xml.FieldValidator();
332 org.exolab.castor.xml.validators.StringValidator typeValidator;
333 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
334 fieldValidator.setValidator(typeValidator);
335 typeValidator.setWhiteSpace("preserve");
337 desc.setValidator(fieldValidator);
339 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
340 java.lang.Float.TYPE, "_threshold", "threshold",
341 org.exolab.castor.xml.NodeType.Attribute);
342 handler = new org.exolab.castor.xml.XMLFieldHandler()
344 public java.lang.Object getValue(java.lang.Object object)
345 throws IllegalStateException
347 AnnotationColourScheme target = (AnnotationColourScheme) object;
348 if (!target.hasThreshold())
352 return new java.lang.Float(target.getThreshold());
355 public void setValue(java.lang.Object object, java.lang.Object value)
356 throws IllegalStateException, IllegalArgumentException
360 AnnotationColourScheme target = (AnnotationColourScheme) object;
361 // if null, use delete method for optional primitives
364 target.deleteThreshold();
367 target.setThreshold(((java.lang.Float) value).floatValue());
368 } catch (java.lang.Exception ex)
370 throw new IllegalStateException(ex.toString());
374 public java.lang.Object newInstance(java.lang.Object parent)
379 desc.setHandler(handler);
380 desc.setMultivalued(false);
381 addFieldDescriptor(desc);
383 // -- validation code for: _threshold
384 fieldValidator = new org.exolab.castor.xml.FieldValidator();
386 org.exolab.castor.xml.validators.FloatValidator typeValidator;
387 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
388 fieldValidator.setValidator(typeValidator);
389 typeValidator.setMinInclusive((float) -3.4028235E38);
390 typeValidator.setMaxInclusive((float) 3.4028235E38);
392 desc.setValidator(fieldValidator);
394 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
395 java.lang.Boolean.TYPE, "_perSequence", "perSequence",
396 org.exolab.castor.xml.NodeType.Attribute);
397 handler = new org.exolab.castor.xml.XMLFieldHandler()
399 public java.lang.Object getValue(java.lang.Object object)
400 throws IllegalStateException
402 AnnotationColourScheme target = (AnnotationColourScheme) object;
403 if (!target.hasPerSequence())
407 return (target.getPerSequence() ? java.lang.Boolean.TRUE
408 : java.lang.Boolean.FALSE);
411 public void setValue(java.lang.Object object, java.lang.Object value)
412 throws IllegalStateException, IllegalArgumentException
416 AnnotationColourScheme target = (AnnotationColourScheme) object;
417 // if null, use delete method for optional primitives
420 target.deletePerSequence();
423 target.setPerSequence(((java.lang.Boolean) value).booleanValue());
424 } catch (java.lang.Exception ex)
426 throw new IllegalStateException(ex.toString());
430 public java.lang.Object newInstance(java.lang.Object parent)
435 desc.setHandler(handler);
436 desc.setMultivalued(false);
437 addFieldDescriptor(desc);
439 // -- validation code for: _perSequence
440 fieldValidator = new org.exolab.castor.xml.FieldValidator();
442 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
443 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
444 fieldValidator.setValidator(typeValidator);
446 desc.setValidator(fieldValidator);
447 // -- _predefinedColours
448 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
449 java.lang.Boolean.TYPE, "_predefinedColours",
450 "predefinedColours", org.exolab.castor.xml.NodeType.Attribute);
451 handler = new org.exolab.castor.xml.XMLFieldHandler()
453 public java.lang.Object getValue(java.lang.Object object)
454 throws IllegalStateException
456 AnnotationColourScheme target = (AnnotationColourScheme) object;
457 if (!target.hasPredefinedColours())
461 return (target.getPredefinedColours() ? java.lang.Boolean.TRUE
462 : java.lang.Boolean.FALSE);
465 public void setValue(java.lang.Object object, java.lang.Object value)
466 throws IllegalStateException, IllegalArgumentException
470 AnnotationColourScheme target = (AnnotationColourScheme) object;
471 // if null, use delete method for optional primitives
474 target.deletePredefinedColours();
477 target.setPredefinedColours(((java.lang.Boolean) value)
479 } catch (java.lang.Exception ex)
481 throw new IllegalStateException(ex.toString());
485 public java.lang.Object newInstance(java.lang.Object parent)
490 desc.setHandler(handler);
491 desc.setMultivalued(false);
492 addFieldDescriptor(desc);
494 // -- validation code for: _predefinedColours
495 fieldValidator = new org.exolab.castor.xml.FieldValidator();
497 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
498 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
499 fieldValidator.setValidator(typeValidator);
501 desc.setValidator(fieldValidator);
502 // -- initialize element descriptors
511 * Method getAccessMode.
513 * @return the access mode specified for this class.
515 public org.exolab.castor.mapping.AccessMode getAccessMode()
521 * Method getIdentity.
523 * @return the identity field, null if this class has no identity.
525 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
527 return super.getIdentity();
531 * Method getJavaClass.
533 * @return the Java class represented by this descriptor.
535 public java.lang.Class getJavaClass()
537 return jalview.schemabinding.version2.AnnotationColourScheme.class;
541 * Method getNameSpacePrefix.
543 * @return the namespace prefix to use when marshaling as XML.
545 public java.lang.String getNameSpacePrefix()
551 * Method getNameSpaceURI.
553 * @return the namespace URI used when marshaling and unmarshaling as XML.
555 public java.lang.String getNameSpaceURI()
561 * Method getValidator.
563 * @return a specific validator for the class described by this
566 public org.exolab.castor.xml.TypeValidator getValidator()
574 * @return the XML Name for the Class being described.
576 public java.lang.String getXMLName()
582 * Method isElementDefinition.
584 * @return true if XML schema definition of this Class is that of a global
585 * element or element with anonymous type definition.
587 public boolean isElementDefinition()
589 return _elementDefinition;