1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) 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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2.descriptors;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import jalview.schemabinding.version2.AnnotationColourScheme;
37 * Class AnnotationColourSchemeDescriptor.
39 * @version $Revision$ $Date$
41 public class AnnotationColourSchemeDescriptor extends
42 org.exolab.castor.xml.util.XMLClassDescriptorImpl
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
50 * Field _elementDefinition.
52 private boolean _elementDefinition;
57 private java.lang.String _nsPrefix;
62 private java.lang.String _nsURI;
67 private java.lang.String _xmlName;
73 public AnnotationColourSchemeDescriptor()
76 _nsURI = "www.jalview.org";
77 _xmlName = "AnnotationColourScheme";
78 _elementDefinition = false;
79 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
80 org.exolab.castor.mapping.FieldHandler handler = null;
81 org.exolab.castor.xml.FieldValidator fieldValidator = null;
82 // -- initialize attribute descriptors
85 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
86 java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold",
87 org.exolab.castor.xml.NodeType.Attribute);
88 handler = new org.exolab.castor.xml.XMLFieldHandler()
90 public java.lang.Object getValue(java.lang.Object object)
91 throws IllegalStateException
93 AnnotationColourScheme target = (AnnotationColourScheme) object;
94 if (!target.hasAboveThreshold())
98 return new java.lang.Integer(target.getAboveThreshold());
101 public void setValue(java.lang.Object object, java.lang.Object value)
102 throws IllegalStateException, IllegalArgumentException
106 AnnotationColourScheme target = (AnnotationColourScheme) object;
107 // if null, use delete method for optional primitives
110 target.deleteAboveThreshold();
113 target.setAboveThreshold(((java.lang.Integer) value).intValue());
114 } catch (java.lang.Exception ex)
116 throw new IllegalStateException(ex.toString());
120 public java.lang.Object newInstance(java.lang.Object parent)
125 desc.setHandler(handler);
126 desc.setMultivalued(false);
127 addFieldDescriptor(desc);
129 // -- validation code for: _aboveThreshold
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
132 org.exolab.castor.xml.validators.IntValidator typeValidator;
133 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
134 fieldValidator.setValidator(typeValidator);
135 typeValidator.setMinInclusive(-2147483648);
136 typeValidator.setMaxInclusive(2147483647);
138 desc.setValidator(fieldValidator);
140 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
141 java.lang.String.class, "_annotation", "annotation",
142 org.exolab.castor.xml.NodeType.Attribute);
143 desc.setImmutable(true);
144 handler = new org.exolab.castor.xml.XMLFieldHandler()
146 public java.lang.Object getValue(java.lang.Object object)
147 throws IllegalStateException
149 AnnotationColourScheme target = (AnnotationColourScheme) object;
150 return target.getAnnotation();
153 public void setValue(java.lang.Object object, java.lang.Object value)
154 throws IllegalStateException, IllegalArgumentException
158 AnnotationColourScheme target = (AnnotationColourScheme) object;
159 target.setAnnotation((java.lang.String) value);
160 } catch (java.lang.Exception ex)
162 throw new IllegalStateException(ex.toString());
166 public java.lang.Object newInstance(java.lang.Object parent)
171 desc.setHandler(handler);
172 desc.setMultivalued(false);
173 addFieldDescriptor(desc);
175 // -- validation code for: _annotation
176 fieldValidator = new org.exolab.castor.xml.FieldValidator();
178 org.exolab.castor.xml.validators.StringValidator typeValidator;
179 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
180 fieldValidator.setValidator(typeValidator);
181 typeValidator.setWhiteSpace("preserve");
183 desc.setValidator(fieldValidator);
185 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
186 java.lang.Integer.TYPE, "_minColour", "minColour",
187 org.exolab.castor.xml.NodeType.Attribute);
188 handler = new org.exolab.castor.xml.XMLFieldHandler()
190 public java.lang.Object getValue(java.lang.Object object)
191 throws IllegalStateException
193 AnnotationColourScheme target = (AnnotationColourScheme) object;
194 if (!target.hasMinColour())
198 return new java.lang.Integer(target.getMinColour());
201 public void setValue(java.lang.Object object, java.lang.Object value)
202 throws IllegalStateException, IllegalArgumentException
206 AnnotationColourScheme target = (AnnotationColourScheme) object;
207 // if null, use delete method for optional primitives
210 target.deleteMinColour();
213 target.setMinColour(((java.lang.Integer) value).intValue());
214 } catch (java.lang.Exception ex)
216 throw new IllegalStateException(ex.toString());
220 public java.lang.Object newInstance(java.lang.Object parent)
225 desc.setHandler(handler);
226 desc.setMultivalued(false);
227 addFieldDescriptor(desc);
229 // -- validation code for: _minColour
230 fieldValidator = new org.exolab.castor.xml.FieldValidator();
232 org.exolab.castor.xml.validators.IntValidator typeValidator;
233 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
234 fieldValidator.setValidator(typeValidator);
235 typeValidator.setMinInclusive(-2147483648);
236 typeValidator.setMaxInclusive(2147483647);
238 desc.setValidator(fieldValidator);
240 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
241 java.lang.Integer.TYPE, "_maxColour", "maxColour",
242 org.exolab.castor.xml.NodeType.Attribute);
243 handler = new org.exolab.castor.xml.XMLFieldHandler()
245 public java.lang.Object getValue(java.lang.Object object)
246 throws IllegalStateException
248 AnnotationColourScheme target = (AnnotationColourScheme) object;
249 if (!target.hasMaxColour())
253 return new java.lang.Integer(target.getMaxColour());
256 public void setValue(java.lang.Object object, java.lang.Object value)
257 throws IllegalStateException, IllegalArgumentException
261 AnnotationColourScheme target = (AnnotationColourScheme) object;
262 // if null, use delete method for optional primitives
265 target.deleteMaxColour();
268 target.setMaxColour(((java.lang.Integer) value).intValue());
269 } catch (java.lang.Exception ex)
271 throw new IllegalStateException(ex.toString());
275 public java.lang.Object newInstance(java.lang.Object parent)
280 desc.setHandler(handler);
281 desc.setMultivalued(false);
282 addFieldDescriptor(desc);
284 // -- validation code for: _maxColour
285 fieldValidator = new org.exolab.castor.xml.FieldValidator();
287 org.exolab.castor.xml.validators.IntValidator typeValidator;
288 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
289 fieldValidator.setValidator(typeValidator);
290 typeValidator.setMinInclusive(-2147483648);
291 typeValidator.setMaxInclusive(2147483647);
293 desc.setValidator(fieldValidator);
295 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
296 java.lang.String.class, "_colourScheme", "colourScheme",
297 org.exolab.castor.xml.NodeType.Attribute);
298 desc.setImmutable(true);
299 handler = new org.exolab.castor.xml.XMLFieldHandler()
301 public java.lang.Object getValue(java.lang.Object object)
302 throws IllegalStateException
304 AnnotationColourScheme target = (AnnotationColourScheme) object;
305 return target.getColourScheme();
308 public void setValue(java.lang.Object object, java.lang.Object value)
309 throws IllegalStateException, IllegalArgumentException
313 AnnotationColourScheme target = (AnnotationColourScheme) object;
314 target.setColourScheme((java.lang.String) value);
315 } catch (java.lang.Exception ex)
317 throw new IllegalStateException(ex.toString());
321 public java.lang.Object newInstance(java.lang.Object parent)
326 desc.setHandler(handler);
327 desc.setMultivalued(false);
328 addFieldDescriptor(desc);
330 // -- validation code for: _colourScheme
331 fieldValidator = new org.exolab.castor.xml.FieldValidator();
333 org.exolab.castor.xml.validators.StringValidator typeValidator;
334 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
335 fieldValidator.setValidator(typeValidator);
336 typeValidator.setWhiteSpace("preserve");
338 desc.setValidator(fieldValidator);
340 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
341 java.lang.Float.TYPE, "_threshold", "threshold",
342 org.exolab.castor.xml.NodeType.Attribute);
343 handler = new org.exolab.castor.xml.XMLFieldHandler()
345 public java.lang.Object getValue(java.lang.Object object)
346 throws IllegalStateException
348 AnnotationColourScheme target = (AnnotationColourScheme) object;
349 if (!target.hasThreshold())
353 return new java.lang.Float(target.getThreshold());
356 public void setValue(java.lang.Object object, java.lang.Object value)
357 throws IllegalStateException, IllegalArgumentException
361 AnnotationColourScheme target = (AnnotationColourScheme) object;
362 // if null, use delete method for optional primitives
365 target.deleteThreshold();
368 target.setThreshold(((java.lang.Float) value).floatValue());
369 } catch (java.lang.Exception ex)
371 throw new IllegalStateException(ex.toString());
375 public java.lang.Object newInstance(java.lang.Object parent)
380 desc.setHandler(handler);
381 desc.setMultivalued(false);
382 addFieldDescriptor(desc);
384 // -- validation code for: _threshold
385 fieldValidator = new org.exolab.castor.xml.FieldValidator();
387 org.exolab.castor.xml.validators.FloatValidator typeValidator;
388 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
389 fieldValidator.setValidator(typeValidator);
390 typeValidator.setMinInclusive((float) -3.4028235E38);
391 typeValidator.setMaxInclusive((float) 3.4028235E38);
393 desc.setValidator(fieldValidator);
395 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
396 java.lang.Boolean.TYPE, "_perSequence", "perSequence",
397 org.exolab.castor.xml.NodeType.Attribute);
398 handler = new org.exolab.castor.xml.XMLFieldHandler()
400 public java.lang.Object getValue(java.lang.Object object)
401 throws IllegalStateException
403 AnnotationColourScheme target = (AnnotationColourScheme) object;
404 if (!target.hasPerSequence())
408 return (target.getPerSequence() ? java.lang.Boolean.TRUE
409 : java.lang.Boolean.FALSE);
412 public void setValue(java.lang.Object object, java.lang.Object value)
413 throws IllegalStateException, IllegalArgumentException
417 AnnotationColourScheme target = (AnnotationColourScheme) object;
418 // if null, use delete method for optional primitives
421 target.deletePerSequence();
424 target.setPerSequence(((java.lang.Boolean) value).booleanValue());
425 } catch (java.lang.Exception ex)
427 throw new IllegalStateException(ex.toString());
431 public java.lang.Object newInstance(java.lang.Object parent)
436 desc.setHandler(handler);
437 desc.setMultivalued(false);
438 addFieldDescriptor(desc);
440 // -- validation code for: _perSequence
441 fieldValidator = new org.exolab.castor.xml.FieldValidator();
443 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
444 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
445 fieldValidator.setValidator(typeValidator);
447 desc.setValidator(fieldValidator);
448 // -- _predefinedColours
449 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
450 java.lang.Boolean.TYPE, "_predefinedColours",
451 "predefinedColours", org.exolab.castor.xml.NodeType.Attribute);
452 handler = new org.exolab.castor.xml.XMLFieldHandler()
454 public java.lang.Object getValue(java.lang.Object object)
455 throws IllegalStateException
457 AnnotationColourScheme target = (AnnotationColourScheme) object;
458 if (!target.hasPredefinedColours())
462 return (target.getPredefinedColours() ? java.lang.Boolean.TRUE
463 : java.lang.Boolean.FALSE);
466 public void setValue(java.lang.Object object, java.lang.Object value)
467 throws IllegalStateException, IllegalArgumentException
471 AnnotationColourScheme target = (AnnotationColourScheme) object;
472 // if null, use delete method for optional primitives
475 target.deletePredefinedColours();
478 target.setPredefinedColours(((java.lang.Boolean) value)
480 } catch (java.lang.Exception ex)
482 throw new IllegalStateException(ex.toString());
486 public java.lang.Object newInstance(java.lang.Object parent)
491 desc.setHandler(handler);
492 desc.setMultivalued(false);
493 addFieldDescriptor(desc);
495 // -- validation code for: _predefinedColours
496 fieldValidator = new org.exolab.castor.xml.FieldValidator();
498 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
499 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
500 fieldValidator.setValidator(typeValidator);
502 desc.setValidator(fieldValidator);
503 // -- initialize element descriptors
512 * Method getAccessMode.
514 * @return the access mode specified for this class.
516 public org.exolab.castor.mapping.AccessMode getAccessMode()
522 * Method getIdentity.
524 * @return the identity field, null if this class has no identity.
526 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
528 return super.getIdentity();
532 * Method getJavaClass.
534 * @return the Java class represented by this descriptor.
536 public java.lang.Class getJavaClass()
538 return jalview.schemabinding.version2.AnnotationColourScheme.class;
542 * Method getNameSpacePrefix.
544 * @return the namespace prefix to use when marshaling as XML.
546 public java.lang.String getNameSpacePrefix()
552 * Method getNameSpaceURI.
554 * @return the namespace URI used when marshaling and unmarshaling as XML.
556 public java.lang.String getNameSpaceURI()
562 * Method getValidator.
564 * @return a specific validator for the class described by this
567 public org.exolab.castor.xml.TypeValidator getValidator()
575 * @return the XML Name for the Class being described.
577 public java.lang.String getXMLName()
583 * Method isElementDefinition.
585 * @return true if XML schema definition of this Class is that of a global
586 * element or element with anonymous type definition.
588 public boolean isElementDefinition()
590 return _elementDefinition;