851ccb21fa932ac77b9ed1338617e202ca32d54b
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / ThresholdLineDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.ThresholdLine;
15
16 /**
17  * Class ThresholdLineDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class ThresholdLineDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * Field _elementDefinition.
30      */
31     private boolean _elementDefinition;
32
33     /**
34      * Field _nsPrefix.
35      */
36     private java.lang.String _nsPrefix;
37
38     /**
39      * Field _nsURI.
40      */
41     private java.lang.String _nsURI;
42
43     /**
44      * Field _xmlName.
45      */
46     private java.lang.String _xmlName;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public ThresholdLineDescriptor() {
54         super();
55         _nsURI = "www.vamsas.ac.uk/jalview/version2";
56         _xmlName = "thresholdLine";
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
62         
63         //-- _label
64         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", org.exolab.castor.xml.NodeType.Attribute);
65         desc.setImmutable(true);
66         handler = new org.exolab.castor.xml.XMLFieldHandler() {
67             public java.lang.Object getValue( java.lang.Object object ) 
68                 throws IllegalStateException
69             {
70                 ThresholdLine target = (ThresholdLine) object;
71                 return target.getLabel();
72             }
73             public void setValue( java.lang.Object object, java.lang.Object value) 
74                 throws IllegalStateException, IllegalArgumentException
75             {
76                 try {
77                     ThresholdLine target = (ThresholdLine) object;
78                     target.setLabel( (java.lang.String) value);
79                 } catch (java.lang.Exception ex) {
80                     throw new IllegalStateException(ex.toString());
81                 }
82             }
83             public java.lang.Object newInstance(java.lang.Object parent) {
84                 return null;
85             }
86         };
87         desc.setHandler(handler);
88         desc.setMultivalued(false);
89         addFieldDescriptor(desc);
90         
91         //-- validation code for: _label
92         fieldValidator = new org.exolab.castor.xml.FieldValidator();
93         { //-- local scope
94             org.exolab.castor.xml.validators.StringValidator typeValidator;
95             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
96             fieldValidator.setValidator(typeValidator);
97             typeValidator.setWhiteSpace("preserve");
98         }
99         desc.setValidator(fieldValidator);
100         //-- _value
101         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
102         handler = new org.exolab.castor.xml.XMLFieldHandler() {
103             public java.lang.Object getValue( java.lang.Object object ) 
104                 throws IllegalStateException
105             {
106                 ThresholdLine target = (ThresholdLine) object;
107                 if (!target.hasValue()) { return null; }
108                 return new java.lang.Float(target.getValue());
109             }
110             public void setValue( java.lang.Object object, java.lang.Object value) 
111                 throws IllegalStateException, IllegalArgumentException
112             {
113                 try {
114                     ThresholdLine target = (ThresholdLine) object;
115                     // if null, use delete method for optional primitives 
116                     if (value == null) {
117                         target.deleteValue();
118                         return;
119                     }
120                     target.setValue( ((java.lang.Float) value).floatValue());
121                 } catch (java.lang.Exception ex) {
122                     throw new IllegalStateException(ex.toString());
123                 }
124             }
125             public java.lang.Object newInstance(java.lang.Object parent) {
126                 return null;
127             }
128         };
129         desc.setHandler(handler);
130         desc.setMultivalued(false);
131         addFieldDescriptor(desc);
132         
133         //-- validation code for: _value
134         fieldValidator = new org.exolab.castor.xml.FieldValidator();
135         { //-- local scope
136             org.exolab.castor.xml.validators.FloatValidator typeValidator;
137             typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
138             fieldValidator.setValidator(typeValidator);
139             typeValidator.setMinInclusive((float) -3.4028235E38);
140             typeValidator.setMaxInclusive((float) 3.4028235E38);
141         }
142         desc.setValidator(fieldValidator);
143         //-- _colour
144         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", 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
148             {
149                 ThresholdLine target = (ThresholdLine) object;
150                 if (!target.hasColour()) { return null; }
151                 return new java.lang.Integer(target.getColour());
152             }
153             public void setValue( java.lang.Object object, java.lang.Object value) 
154                 throws IllegalStateException, IllegalArgumentException
155             {
156                 try {
157                     ThresholdLine target = (ThresholdLine) object;
158                     // if null, use delete method for optional primitives 
159                     if (value == null) {
160                         target.deleteColour();
161                         return;
162                     }
163                     target.setColour( ((java.lang.Integer) value).intValue());
164                 } catch (java.lang.Exception ex) {
165                     throw new IllegalStateException(ex.toString());
166                 }
167             }
168             public java.lang.Object newInstance(java.lang.Object parent) {
169                 return null;
170             }
171         };
172         desc.setHandler(handler);
173         desc.setMultivalued(false);
174         addFieldDescriptor(desc);
175         
176         //-- validation code for: _colour
177         fieldValidator = new org.exolab.castor.xml.FieldValidator();
178         { //-- local scope
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);
184         }
185         desc.setValidator(fieldValidator);
186         //-- initialize element descriptors
187         
188     }
189
190
191       //-----------/
192      //- Methods -/
193     //-----------/
194
195     /**
196      * Method getAccessMode.
197      * 
198      * @return the access mode specified for this class.
199      */
200     public org.exolab.castor.mapping.AccessMode getAccessMode(
201     ) {
202         return null;
203     }
204
205     /**
206      * Method getIdentity.
207      * 
208      * @return the identity field, null if this class has no
209      * identity.
210      */
211     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
212     ) {
213         return super.getIdentity();
214     }
215
216     /**
217      * Method getJavaClass.
218      * 
219      * @return the Java class represented by this descriptor.
220      */
221     public java.lang.Class getJavaClass(
222     ) {
223         return jalview.schemabinding.version2.ThresholdLine.class;
224     }
225
226     /**
227      * Method getNameSpacePrefix.
228      * 
229      * @return the namespace prefix to use when marshaling as XML.
230      */
231     public java.lang.String getNameSpacePrefix(
232     ) {
233         return _nsPrefix;
234     }
235
236     /**
237      * Method getNameSpaceURI.
238      * 
239      * @return the namespace URI used when marshaling and
240      * unmarshaling as XML.
241      */
242     public java.lang.String getNameSpaceURI(
243     ) {
244         return _nsURI;
245     }
246
247     /**
248      * Method getValidator.
249      * 
250      * @return a specific validator for the class described by this
251      * ClassDescriptor.
252      */
253     public org.exolab.castor.xml.TypeValidator getValidator(
254     ) {
255         return this;
256     }
257
258     /**
259      * Method getXMLName.
260      * 
261      * @return the XML Name for the Class being described.
262      */
263     public java.lang.String getXMLName(
264     ) {
265         return _xmlName;
266     }
267
268     /**
269      * Method isElementDefinition.
270      * 
271      * @return true if XML schema definition of this Class is that
272      * of a global
273      * element or element with anonymous type definition.
274      */
275     public boolean isElementDefinition(
276     ) {
277         return _elementDefinition;
278     }
279
280 }