1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.AnnotationColours;
34 * Class AnnotationColoursDescriptor.
36 * @version $Revision$ $Date$
38 public class AnnotationColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public AnnotationColoursDescriptor() {
72 _nsURI = "www.jalview.org";
73 _xmlName = "AnnotationColours";
74 _elementDefinition = true;
75 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
76 org.exolab.castor.mapping.FieldHandler handler = null;
77 org.exolab.castor.xml.FieldValidator fieldValidator = null;
78 //-- initialize attribute descriptors
81 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", org.exolab.castor.xml.NodeType.Attribute);
82 handler = new org.exolab.castor.xml.XMLFieldHandler() {
83 public java.lang.Object getValue( java.lang.Object object )
84 throws IllegalStateException
86 AnnotationColours target = (AnnotationColours) object;
87 if (!target.hasAboveThreshold()) { return null; }
88 return new java.lang.Integer(target.getAboveThreshold());
90 public void setValue( java.lang.Object object, java.lang.Object value)
91 throws IllegalStateException, IllegalArgumentException
94 AnnotationColours target = (AnnotationColours) object;
95 // if null, use delete method for optional primitives
97 target.deleteAboveThreshold();
100 target.setAboveThreshold( ((java.lang.Integer) value).intValue());
101 } catch (java.lang.Exception ex) {
102 throw new IllegalStateException(ex.toString());
105 public java.lang.Object newInstance(java.lang.Object parent) {
109 desc.setHandler(handler);
110 desc.setMultivalued(false);
111 addFieldDescriptor(desc);
113 //-- validation code for: _aboveThreshold
114 fieldValidator = new org.exolab.castor.xml.FieldValidator();
116 org.exolab.castor.xml.validators.IntValidator typeValidator;
117 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
118 fieldValidator.setValidator(typeValidator);
119 typeValidator.setMinInclusive(-2147483648);
120 typeValidator.setMaxInclusive(2147483647);
122 desc.setValidator(fieldValidator);
124 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotation", "annotation", org.exolab.castor.xml.NodeType.Attribute);
125 desc.setImmutable(true);
126 handler = new org.exolab.castor.xml.XMLFieldHandler() {
127 public java.lang.Object getValue( java.lang.Object object )
128 throws IllegalStateException
130 AnnotationColours target = (AnnotationColours) object;
131 return target.getAnnotation();
133 public void setValue( java.lang.Object object, java.lang.Object value)
134 throws IllegalStateException, IllegalArgumentException
137 AnnotationColours target = (AnnotationColours) object;
138 target.setAnnotation( (java.lang.String) value);
139 } catch (java.lang.Exception ex) {
140 throw new IllegalStateException(ex.toString());
143 public java.lang.Object newInstance(java.lang.Object parent) {
147 desc.setHandler(handler);
148 desc.setMultivalued(false);
149 addFieldDescriptor(desc);
151 //-- validation code for: _annotation
152 fieldValidator = new org.exolab.castor.xml.FieldValidator();
154 org.exolab.castor.xml.validators.StringValidator typeValidator;
155 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
156 fieldValidator.setValidator(typeValidator);
157 typeValidator.setWhiteSpace("preserve");
159 desc.setValidator(fieldValidator);
161 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minColour", "minColour", org.exolab.castor.xml.NodeType.Attribute);
162 handler = new org.exolab.castor.xml.XMLFieldHandler() {
163 public java.lang.Object getValue( java.lang.Object object )
164 throws IllegalStateException
166 AnnotationColours target = (AnnotationColours) object;
167 if (!target.hasMinColour()) { return null; }
168 return new java.lang.Integer(target.getMinColour());
170 public void setValue( java.lang.Object object, java.lang.Object value)
171 throws IllegalStateException, IllegalArgumentException
174 AnnotationColours target = (AnnotationColours) object;
175 // if null, use delete method for optional primitives
177 target.deleteMinColour();
180 target.setMinColour( ((java.lang.Integer) value).intValue());
181 } catch (java.lang.Exception ex) {
182 throw new IllegalStateException(ex.toString());
185 public java.lang.Object newInstance(java.lang.Object parent) {
189 desc.setHandler(handler);
190 desc.setMultivalued(false);
191 addFieldDescriptor(desc);
193 //-- validation code for: _minColour
194 fieldValidator = new org.exolab.castor.xml.FieldValidator();
196 org.exolab.castor.xml.validators.IntValidator typeValidator;
197 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
198 fieldValidator.setValidator(typeValidator);
199 typeValidator.setMinInclusive(-2147483648);
200 typeValidator.setMaxInclusive(2147483647);
202 desc.setValidator(fieldValidator);
204 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxColour", "maxColour", org.exolab.castor.xml.NodeType.Attribute);
205 handler = new org.exolab.castor.xml.XMLFieldHandler() {
206 public java.lang.Object getValue( java.lang.Object object )
207 throws IllegalStateException
209 AnnotationColours target = (AnnotationColours) object;
210 if (!target.hasMaxColour()) { return null; }
211 return new java.lang.Integer(target.getMaxColour());
213 public void setValue( java.lang.Object object, java.lang.Object value)
214 throws IllegalStateException, IllegalArgumentException
217 AnnotationColours target = (AnnotationColours) object;
218 // if null, use delete method for optional primitives
220 target.deleteMaxColour();
223 target.setMaxColour( ((java.lang.Integer) value).intValue());
224 } catch (java.lang.Exception ex) {
225 throw new IllegalStateException(ex.toString());
228 public java.lang.Object newInstance(java.lang.Object parent) {
232 desc.setHandler(handler);
233 desc.setMultivalued(false);
234 addFieldDescriptor(desc);
236 //-- validation code for: _maxColour
237 fieldValidator = new org.exolab.castor.xml.FieldValidator();
239 org.exolab.castor.xml.validators.IntValidator typeValidator;
240 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
241 fieldValidator.setValidator(typeValidator);
242 typeValidator.setMinInclusive(-2147483648);
243 typeValidator.setMaxInclusive(2147483647);
245 desc.setValidator(fieldValidator);
247 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colourScheme", "colourScheme", org.exolab.castor.xml.NodeType.Attribute);
248 desc.setImmutable(true);
249 handler = new org.exolab.castor.xml.XMLFieldHandler() {
250 public java.lang.Object getValue( java.lang.Object object )
251 throws IllegalStateException
253 AnnotationColours target = (AnnotationColours) object;
254 return target.getColourScheme();
256 public void setValue( java.lang.Object object, java.lang.Object value)
257 throws IllegalStateException, IllegalArgumentException
260 AnnotationColours target = (AnnotationColours) object;
261 target.setColourScheme( (java.lang.String) value);
262 } catch (java.lang.Exception ex) {
263 throw new IllegalStateException(ex.toString());
266 public java.lang.Object newInstance(java.lang.Object parent) {
270 desc.setHandler(handler);
271 desc.setMultivalued(false);
272 addFieldDescriptor(desc);
274 //-- validation code for: _colourScheme
275 fieldValidator = new org.exolab.castor.xml.FieldValidator();
277 org.exolab.castor.xml.validators.StringValidator typeValidator;
278 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
279 fieldValidator.setValidator(typeValidator);
280 typeValidator.setWhiteSpace("preserve");
282 desc.setValidator(fieldValidator);
284 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute);
285 handler = new org.exolab.castor.xml.XMLFieldHandler() {
286 public java.lang.Object getValue( java.lang.Object object )
287 throws IllegalStateException
289 AnnotationColours target = (AnnotationColours) object;
290 if (!target.hasThreshold()) { return null; }
291 return new java.lang.Float(target.getThreshold());
293 public void setValue( java.lang.Object object, java.lang.Object value)
294 throws IllegalStateException, IllegalArgumentException
297 AnnotationColours target = (AnnotationColours) object;
298 // if null, use delete method for optional primitives
300 target.deleteThreshold();
303 target.setThreshold( ((java.lang.Float) value).floatValue());
304 } catch (java.lang.Exception ex) {
305 throw new IllegalStateException(ex.toString());
308 public java.lang.Object newInstance(java.lang.Object parent) {
312 desc.setHandler(handler);
313 desc.setMultivalued(false);
314 addFieldDescriptor(desc);
316 //-- validation code for: _threshold
317 fieldValidator = new org.exolab.castor.xml.FieldValidator();
319 org.exolab.castor.xml.validators.FloatValidator typeValidator;
320 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
321 fieldValidator.setValidator(typeValidator);
322 typeValidator.setMinInclusive((float) -3.4028235E38);
323 typeValidator.setMaxInclusive((float) 3.4028235E38);
325 desc.setValidator(fieldValidator);
326 //-- initialize element descriptors
336 * Method getAccessMode.
338 * @return the access mode specified for this class.
340 public org.exolab.castor.mapping.AccessMode getAccessMode(
346 * Method getIdentity.
348 * @return the identity field, null if this class has no
351 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
353 return super.getIdentity();
357 * Method getJavaClass.
359 * @return the Java class represented by this descriptor.
361 public java.lang.Class getJavaClass(
363 return jalview.schemabinding.version2.AnnotationColours.class;
367 * Method getNameSpacePrefix.
369 * @return the namespace prefix to use when marshaling as XML.
371 public java.lang.String getNameSpacePrefix(
377 * Method getNameSpaceURI.
379 * @return the namespace URI used when marshaling and
380 * unmarshaling as XML.
382 public java.lang.String getNameSpaceURI(
388 * Method getValidator.
390 * @return a specific validator for the class described by this
393 public org.exolab.castor.xml.TypeValidator getValidator(
401 * @return the XML Name for the Class being described.
403 public java.lang.String getXMLName(
409 * Method isElementDefinition.
411 * @return true if XML schema definition of this Class is that
413 * element or element with anonymous type definition.
415 public boolean isElementDefinition(
417 return _elementDefinition;