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.AnnotationColours;
17 * Class AnnotationColoursDescriptor.
19 * @version $Revision$ $Date$
21 public class AnnotationColoursDescriptor 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 AnnotationColoursDescriptor() {
55 _nsURI = "www.jalview.org";
56 _xmlName = "AnnotationColours";
57 _elementDefinition = true;
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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) object;
114 return target.getAnnotation();
116 public void setValue( java.lang.Object object, java.lang.Object value)
117 throws IllegalStateException, IllegalArgumentException
120 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) object;
237 return target.getColourScheme();
239 public void setValue( java.lang.Object object, java.lang.Object value)
240 throws IllegalStateException, IllegalArgumentException
243 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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 AnnotationColours target = (AnnotationColours) 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);
309 //-- initialize element descriptors
319 * Method getAccessMode.
321 * @return the access mode specified for this class.
323 public org.exolab.castor.mapping.AccessMode getAccessMode(
329 * Method getIdentity.
331 * @return the identity field, null if this class has no
334 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
336 return super.getIdentity();
340 * Method getJavaClass.
342 * @return the Java class represented by this descriptor.
344 public java.lang.Class getJavaClass(
346 return jalview.schemabinding.version2.AnnotationColours.class;
350 * Method getNameSpacePrefix.
352 * @return the namespace prefix to use when marshaling as XML.
354 public java.lang.String getNameSpacePrefix(
360 * Method getNameSpaceURI.
362 * @return the namespace URI used when marshaling and
363 * unmarshaling as XML.
365 public java.lang.String getNameSpaceURI(
371 * Method getValidator.
373 * @return a specific validator for the class described by this
376 public org.exolab.castor.xml.TypeValidator getValidator(
384 * @return the XML Name for the Class being described.
386 public java.lang.String getXMLName(
392 * Method isElementDefinition.
394 * @return true if XML schema definition of this Class is that
396 * element or element with anonymous type definition.
398 public boolean isElementDefinition(
400 return _elementDefinition;