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.ThresholdLine;
17 * Class ThresholdLineDescriptor.
19 * @version $Revision$ $Date$
21 public class ThresholdLineDescriptor 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 ThresholdLineDescriptor() {
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
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
70 ThresholdLine target = (ThresholdLine) object;
71 return target.getLabel();
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 ThresholdLine target = (ThresholdLine) object;
78 target.setLabel( (java.lang.String) value);
79 } catch (java.lang.Exception ex) {
80 throw new IllegalStateException(ex.toString());
83 public java.lang.Object newInstance(java.lang.Object parent) {
87 desc.setHandler(handler);
88 desc.setMultivalued(false);
89 addFieldDescriptor(desc);
91 //-- validation code for: _label
92 fieldValidator = new org.exolab.castor.xml.FieldValidator();
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");
99 desc.setValidator(fieldValidator);
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
106 ThresholdLine target = (ThresholdLine) object;
107 if (!target.hasValue()) { return null; }
108 return new java.lang.Float(target.getValue());
110 public void setValue( java.lang.Object object, java.lang.Object value)
111 throws IllegalStateException, IllegalArgumentException
114 ThresholdLine target = (ThresholdLine) object;
115 // if null, use delete method for optional primitives
117 target.deleteValue();
120 target.setValue( ((java.lang.Float) value).floatValue());
121 } catch (java.lang.Exception ex) {
122 throw new IllegalStateException(ex.toString());
125 public java.lang.Object newInstance(java.lang.Object parent) {
129 desc.setHandler(handler);
130 desc.setMultivalued(false);
131 addFieldDescriptor(desc);
133 //-- validation code for: _value
134 fieldValidator = new org.exolab.castor.xml.FieldValidator();
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);
142 desc.setValidator(fieldValidator);
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
149 ThresholdLine target = (ThresholdLine) object;
150 if (!target.hasColour()) { return null; }
151 return new java.lang.Integer(target.getColour());
153 public void setValue( java.lang.Object object, java.lang.Object value)
154 throws IllegalStateException, IllegalArgumentException
157 ThresholdLine target = (ThresholdLine) object;
158 // if null, use delete method for optional primitives
160 target.deleteColour();
163 target.setColour( ((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: _colour
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);
186 //-- initialize element descriptors
196 * Method getAccessMode.
198 * @return the access mode specified for this class.
200 public org.exolab.castor.mapping.AccessMode getAccessMode(
206 * Method getIdentity.
208 * @return the identity field, null if this class has no
211 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
213 return super.getIdentity();
217 * Method getJavaClass.
219 * @return the Java class represented by this descriptor.
221 public java.lang.Class getJavaClass(
223 return jalview.schemabinding.version2.ThresholdLine.class;
227 * Method getNameSpacePrefix.
229 * @return the namespace prefix to use when marshaling as XML.
231 public java.lang.String getNameSpacePrefix(
237 * Method getNameSpaceURI.
239 * @return the namespace URI used when marshaling and
240 * unmarshaling as XML.
242 public java.lang.String getNameSpaceURI(
248 * Method getValidator.
250 * @return a specific validator for the class described by this
253 public org.exolab.castor.xml.TypeValidator getValidator(
261 * @return the XML Name for the Class being described.
263 public java.lang.String getXMLName(
269 * Method isElementDefinition.
271 * @return true if XML schema definition of this Class is that
273 * element or element with anonymous type definition.
275 public boolean isElementDefinition(
277 return _elementDefinition;