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
22 org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public ThresholdLineDescriptor()
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57 _xmlName = "thresholdLine";
58 _elementDefinition = true;
59 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60 org.exolab.castor.mapping.FieldHandler handler = null;
61 org.exolab.castor.xml.FieldValidator fieldValidator = null;
62 // -- initialize attribute descriptors
65 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66 java.lang.String.class, "_label", "label",
67 org.exolab.castor.xml.NodeType.Attribute);
68 desc.setImmutable(true);
69 handler = new org.exolab.castor.xml.XMLFieldHandler()
71 public java.lang.Object getValue(java.lang.Object object)
72 throws IllegalStateException
74 ThresholdLine target = (ThresholdLine) object;
75 return target.getLabel();
78 public void setValue(java.lang.Object object, java.lang.Object value)
79 throws IllegalStateException, IllegalArgumentException
83 ThresholdLine target = (ThresholdLine) object;
84 target.setLabel((java.lang.String) value);
85 } catch (java.lang.Exception ex)
87 throw new IllegalStateException(ex.toString());
91 public java.lang.Object newInstance(java.lang.Object parent)
96 desc.setHandler(handler);
97 desc.setMultivalued(false);
98 addFieldDescriptor(desc);
100 // -- validation code for: _label
101 fieldValidator = new org.exolab.castor.xml.FieldValidator();
103 org.exolab.castor.xml.validators.StringValidator typeValidator;
104 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
105 fieldValidator.setValidator(typeValidator);
106 typeValidator.setWhiteSpace("preserve");
108 desc.setValidator(fieldValidator);
110 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
111 java.lang.Float.TYPE, "_value", "value",
112 org.exolab.castor.xml.NodeType.Attribute);
113 handler = new org.exolab.castor.xml.XMLFieldHandler()
115 public java.lang.Object getValue(java.lang.Object object)
116 throws IllegalStateException
118 ThresholdLine target = (ThresholdLine) object;
119 if (!target.hasValue())
123 return new java.lang.Float(target.getValue());
126 public void setValue(java.lang.Object object, java.lang.Object value)
127 throws IllegalStateException, IllegalArgumentException
131 ThresholdLine target = (ThresholdLine) object;
132 // if null, use delete method for optional primitives
135 target.deleteValue();
138 target.setValue(((java.lang.Float) value).floatValue());
139 } catch (java.lang.Exception ex)
141 throw new IllegalStateException(ex.toString());
145 public java.lang.Object newInstance(java.lang.Object parent)
150 desc.setHandler(handler);
151 desc.setMultivalued(false);
152 addFieldDescriptor(desc);
154 // -- validation code for: _value
155 fieldValidator = new org.exolab.castor.xml.FieldValidator();
157 org.exolab.castor.xml.validators.FloatValidator typeValidator;
158 typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
159 fieldValidator.setValidator(typeValidator);
160 typeValidator.setMinInclusive((float) -3.4028235E38);
161 typeValidator.setMaxInclusive((float) 3.4028235E38);
163 desc.setValidator(fieldValidator);
165 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
166 java.lang.Integer.TYPE, "_colour", "colour",
167 org.exolab.castor.xml.NodeType.Attribute);
168 handler = new org.exolab.castor.xml.XMLFieldHandler()
170 public java.lang.Object getValue(java.lang.Object object)
171 throws IllegalStateException
173 ThresholdLine target = (ThresholdLine) object;
174 if (!target.hasColour())
178 return new java.lang.Integer(target.getColour());
181 public void setValue(java.lang.Object object, java.lang.Object value)
182 throws IllegalStateException, IllegalArgumentException
186 ThresholdLine target = (ThresholdLine) object;
187 // if null, use delete method for optional primitives
190 target.deleteColour();
193 target.setColour(((java.lang.Integer) value).intValue());
194 } catch (java.lang.Exception ex)
196 throw new IllegalStateException(ex.toString());
200 public java.lang.Object newInstance(java.lang.Object parent)
205 desc.setHandler(handler);
206 desc.setMultivalued(false);
207 addFieldDescriptor(desc);
209 // -- validation code for: _colour
210 fieldValidator = new org.exolab.castor.xml.FieldValidator();
212 org.exolab.castor.xml.validators.IntValidator typeValidator;
213 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
214 fieldValidator.setValidator(typeValidator);
215 typeValidator.setMinInclusive(-2147483648);
216 typeValidator.setMaxInclusive(2147483647);
218 desc.setValidator(fieldValidator);
219 // -- initialize element descriptors
228 * Method getAccessMode.
230 * @return the access mode specified for this class.
232 public org.exolab.castor.mapping.AccessMode getAccessMode()
238 * Method getIdentity.
240 * @return the identity field, null if this class has no identity.
242 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
244 return super.getIdentity();
248 * Method getJavaClass.
250 * @return the Java class represented by this descriptor.
252 public java.lang.Class getJavaClass()
254 return jalview.schemabinding.version2.ThresholdLine.class;
258 * Method getNameSpacePrefix.
260 * @return the namespace prefix to use when marshaling as XML.
262 public java.lang.String getNameSpacePrefix()
268 * Method getNameSpaceURI.
270 * @return the namespace URI used when marshaling and unmarshaling as XML.
272 public java.lang.String getNameSpaceURI()
278 * Method getValidator.
280 * @return a specific validator for the class described by this
283 public org.exolab.castor.xml.TypeValidator getValidator()
291 * @return the XML Name for the Class being described.
293 public java.lang.String getXMLName()
299 * Method isElementDefinition.
301 * @return true if XML schema definition of this Class is that of a global
302 * element or element with anonymous type definition.
304 public boolean isElementDefinition()
306 return _elementDefinition;