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 org.exolab.castor.xml.util.XMLClassDescriptorImpl {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
29 * Field _elementDefinition.
31 private boolean _elementDefinition;
36 private java.lang.String _nsPrefix;
41 private java.lang.String _nsURI;
46 private java.lang.String _xmlName;
53 public AnnotationColourSchemeDescriptor() {
55 _nsURI = "www.jalview.org";
56 _xmlName = "AnnotationColourScheme";
57 _elementDefinition = false;
58 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
59 org.exolab.castor.mapping.FieldHandler handler = null;
60 org.exolab.castor.xml.FieldValidator fieldValidator = null;
61 //-- initialize attribute descriptors
64 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", org.exolab.castor.xml.NodeType.Attribute);
65 handler = new org.exolab.castor.xml.XMLFieldHandler() {
66 public java.lang.Object getValue( java.lang.Object object )
67 throws IllegalStateException
69 AnnotationColourScheme target = (AnnotationColourScheme) object;
70 if (!target.hasAboveThreshold()) { return null; }
71 return new java.lang.Integer(target.getAboveThreshold());
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 AnnotationColourScheme target = (AnnotationColourScheme) object;
78 // if null, use delete method for optional primitives
80 target.deleteAboveThreshold();
83 target.setAboveThreshold( ((java.lang.Integer) value).intValue());
84 } catch (java.lang.Exception ex) {
85 throw new IllegalStateException(ex.toString());
88 public java.lang.Object newInstance(java.lang.Object parent) {
92 desc.setHandler(handler);
93 desc.setMultivalued(false);
94 addFieldDescriptor(desc);
96 //-- validation code for: _aboveThreshold
97 fieldValidator = new org.exolab.castor.xml.FieldValidator();
99 org.exolab.castor.xml.validators.IntValidator typeValidator;
100 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
101 fieldValidator.setValidator(typeValidator);
102 typeValidator.setMinInclusive(-2147483648);
103 typeValidator.setMaxInclusive(2147483647);
105 desc.setValidator(fieldValidator);
107 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotation", "annotation", org.exolab.castor.xml.NodeType.Attribute);
108 desc.setImmutable(true);
109 handler = new org.exolab.castor.xml.XMLFieldHandler() {
110 public java.lang.Object getValue( java.lang.Object object )
111 throws IllegalStateException
113 AnnotationColourScheme target = (AnnotationColourScheme) object;
114 return target.getAnnotation();
116 public void setValue( java.lang.Object object, java.lang.Object value)
117 throws IllegalStateException, IllegalArgumentException
120 AnnotationColourScheme target = (AnnotationColourScheme) object;
121 target.setAnnotation( (java.lang.String) value);
122 } catch (java.lang.Exception ex) {
123 throw new IllegalStateException(ex.toString());
126 public java.lang.Object newInstance(java.lang.Object parent) {
130 desc.setHandler(handler);
131 desc.setMultivalued(false);
132 addFieldDescriptor(desc);
134 //-- validation code for: _annotation
135 fieldValidator = new org.exolab.castor.xml.FieldValidator();
137 org.exolab.castor.xml.validators.StringValidator typeValidator;
138 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
139 fieldValidator.setValidator(typeValidator);
140 typeValidator.setWhiteSpace("preserve");
142 desc.setValidator(fieldValidator);
144 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minColour", "minColour", org.exolab.castor.xml.NodeType.Attribute);
145 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 if (!target.hasMinColour()) { return null; }
151 return new java.lang.Integer(target.getMinColour());
153 public void setValue( java.lang.Object object, java.lang.Object value)
154 throws IllegalStateException, IllegalArgumentException
157 AnnotationColourScheme target = (AnnotationColourScheme) object;
158 // if null, use delete method for optional primitives
160 target.deleteMinColour();
163 target.setMinColour( ((java.lang.Integer) value).intValue());
164 } catch (java.lang.Exception ex) {
165 throw new IllegalStateException(ex.toString());
168 public java.lang.Object newInstance(java.lang.Object parent) {
172 desc.setHandler(handler);
173 desc.setMultivalued(false);
174 addFieldDescriptor(desc);
176 //-- validation code for: _minColour
177 fieldValidator = new org.exolab.castor.xml.FieldValidator();
179 org.exolab.castor.xml.validators.IntValidator typeValidator;
180 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
181 fieldValidator.setValidator(typeValidator);
182 typeValidator.setMinInclusive(-2147483648);
183 typeValidator.setMaxInclusive(2147483647);
185 desc.setValidator(fieldValidator);
187 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxColour", "maxColour", org.exolab.castor.xml.NodeType.Attribute);
188 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.hasMaxColour()) { return null; }
194 return new java.lang.Integer(target.getMaxColour());
196 public void setValue( java.lang.Object object, java.lang.Object value)
197 throws IllegalStateException, IllegalArgumentException
200 AnnotationColourScheme target = (AnnotationColourScheme) object;
201 // if null, use delete method for optional primitives
203 target.deleteMaxColour();
206 target.setMaxColour( ((java.lang.Integer) value).intValue());
207 } catch (java.lang.Exception ex) {
208 throw new IllegalStateException(ex.toString());
211 public java.lang.Object newInstance(java.lang.Object parent) {
215 desc.setHandler(handler);
216 desc.setMultivalued(false);
217 addFieldDescriptor(desc);
219 //-- validation code for: _maxColour
220 fieldValidator = new org.exolab.castor.xml.FieldValidator();
222 org.exolab.castor.xml.validators.IntValidator typeValidator;
223 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
224 fieldValidator.setValidator(typeValidator);
225 typeValidator.setMinInclusive(-2147483648);
226 typeValidator.setMaxInclusive(2147483647);
228 desc.setValidator(fieldValidator);
230 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colourScheme", "colourScheme", org.exolab.castor.xml.NodeType.Attribute);
231 desc.setImmutable(true);
232 handler = new org.exolab.castor.xml.XMLFieldHandler() {
233 public java.lang.Object getValue( java.lang.Object object )
234 throws IllegalStateException
236 AnnotationColourScheme target = (AnnotationColourScheme) object;
237 return target.getColourScheme();
239 public void setValue( java.lang.Object object, java.lang.Object value)
240 throws IllegalStateException, IllegalArgumentException
243 AnnotationColourScheme target = (AnnotationColourScheme) object;
244 target.setColourScheme( (java.lang.String) value);
245 } catch (java.lang.Exception ex) {
246 throw new IllegalStateException(ex.toString());
249 public java.lang.Object newInstance(java.lang.Object parent) {
253 desc.setHandler(handler);
254 desc.setMultivalued(false);
255 addFieldDescriptor(desc);
257 //-- validation code for: _colourScheme
258 fieldValidator = new org.exolab.castor.xml.FieldValidator();
260 org.exolab.castor.xml.validators.StringValidator typeValidator;
261 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
262 fieldValidator.setValidator(typeValidator);
263 typeValidator.setWhiteSpace("preserve");
265 desc.setValidator(fieldValidator);
267 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute);
268 handler = new org.exolab.castor.xml.XMLFieldHandler() {
269 public java.lang.Object getValue( java.lang.Object object )
270 throws IllegalStateException
272 AnnotationColourScheme target = (AnnotationColourScheme) object;
273 if (!target.hasThreshold()) { return null; }
274 return new java.lang.Float(target.getThreshold());
276 public void setValue( java.lang.Object object, java.lang.Object value)
277 throws IllegalStateException, IllegalArgumentException
280 AnnotationColourScheme target = (AnnotationColourScheme) object;
281 // if null, use delete method for optional primitives
283 target.deleteThreshold();
286 target.setThreshold( ((java.lang.Float) value).floatValue());
287 } catch (java.lang.Exception ex) {
288 throw new IllegalStateException(ex.toString());
291 public java.lang.Object newInstance(java.lang.Object parent) {
295 desc.setHandler(handler);
296 desc.setMultivalued(false);
297 addFieldDescriptor(desc);
299 //-- validation code for: _threshold
300 fieldValidator = new org.exolab.castor.xml.FieldValidator();
302 org.exolab.castor.xml.validators.FloatValidator typeValidator;
303 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
304 fieldValidator.setValidator(typeValidator);
305 typeValidator.setMinInclusive((float) -3.4028235E38);
306 typeValidator.setMaxInclusive((float) 3.4028235E38);
308 desc.setValidator(fieldValidator);
310 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_perSequence", "perSequence", org.exolab.castor.xml.NodeType.Attribute);
311 handler = new org.exolab.castor.xml.XMLFieldHandler() {
312 public java.lang.Object getValue( java.lang.Object object )
313 throws IllegalStateException
315 AnnotationColourScheme target = (AnnotationColourScheme) object;
316 if (!target.hasPerSequence()) { return null; }
317 return (target.getPerSequence() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
319 public void setValue( java.lang.Object object, java.lang.Object value)
320 throws IllegalStateException, IllegalArgumentException
323 AnnotationColourScheme target = (AnnotationColourScheme) object;
324 // if null, use delete method for optional primitives
326 target.deletePerSequence();
329 target.setPerSequence( ((java.lang.Boolean) value).booleanValue());
330 } catch (java.lang.Exception ex) {
331 throw new IllegalStateException(ex.toString());
334 public java.lang.Object newInstance(java.lang.Object parent) {
338 desc.setHandler(handler);
339 desc.setMultivalued(false);
340 addFieldDescriptor(desc);
342 //-- validation code for: _perSequence
343 fieldValidator = new org.exolab.castor.xml.FieldValidator();
345 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
346 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
347 fieldValidator.setValidator(typeValidator);
349 desc.setValidator(fieldValidator);
350 //-- _predefinedColours
351 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_predefinedColours", "predefinedColours", org.exolab.castor.xml.NodeType.Attribute);
352 handler = new org.exolab.castor.xml.XMLFieldHandler() {
353 public java.lang.Object getValue( java.lang.Object object )
354 throws IllegalStateException
356 AnnotationColourScheme target = (AnnotationColourScheme) object;
357 if (!target.hasPredefinedColours()) { return null; }
358 return (target.getPredefinedColours() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
360 public void setValue( java.lang.Object object, java.lang.Object value)
361 throws IllegalStateException, IllegalArgumentException
364 AnnotationColourScheme target = (AnnotationColourScheme) object;
365 // if null, use delete method for optional primitives
367 target.deletePredefinedColours();
370 target.setPredefinedColours( ((java.lang.Boolean) value).booleanValue());
371 } catch (java.lang.Exception ex) {
372 throw new IllegalStateException(ex.toString());
375 public java.lang.Object newInstance(java.lang.Object parent) {
379 desc.setHandler(handler);
380 desc.setMultivalued(false);
381 addFieldDescriptor(desc);
383 //-- validation code for: _predefinedColours
384 fieldValidator = new org.exolab.castor.xml.FieldValidator();
386 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
387 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
388 fieldValidator.setValidator(typeValidator);
390 desc.setValidator(fieldValidator);
391 //-- initialize element descriptors
401 * Method getAccessMode.
403 * @return the access mode specified for this class.
405 public org.exolab.castor.mapping.AccessMode getAccessMode(
411 * Method getIdentity.
413 * @return the identity field, null if this class has no
416 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
418 return super.getIdentity();
422 * Method getJavaClass.
424 * @return the Java class represented by this descriptor.
426 public java.lang.Class getJavaClass(
428 return jalview.schemabinding.version2.AnnotationColourScheme.class;
432 * Method getNameSpacePrefix.
434 * @return the namespace prefix to use when marshaling as XML.
436 public java.lang.String getNameSpacePrefix(
442 * Method getNameSpaceURI.
444 * @return the namespace URI used when marshaling and
445 * unmarshaling as XML.
447 public java.lang.String getNameSpaceURI(
453 * Method getValidator.
455 * @return a specific validator for the class described by this
458 public org.exolab.castor.xml.TypeValidator getValidator(
466 * @return the XML Name for the Class being described.
468 public java.lang.String getXMLName(
474 * Method isElementDefinition.
476 * @return true if XML schema definition of this Class is that
478 * element or element with anonymous type definition.
480 public boolean isElementDefinition(
482 return _elementDefinition;