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.Alcodon;
17 * Class AlcodonDescriptor.
19 * @version $Revision$ $Date$
21 public class AlcodonDescriptor 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 AlcodonDescriptor()
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
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.Long.TYPE, "_pos1", "pos1",
67 org.exolab.castor.xml.NodeType.Attribute);
68 handler = new org.exolab.castor.xml.XMLFieldHandler()
70 public java.lang.Object getValue(java.lang.Object object)
71 throws IllegalStateException
73 Alcodon target = (Alcodon) object;
74 if (!target.hasPos1())
78 return new java.lang.Long(target.getPos1());
81 public void setValue(java.lang.Object object, java.lang.Object value)
82 throws IllegalStateException, IllegalArgumentException
86 Alcodon target = (Alcodon) object;
87 // if null, use delete method for optional primitives
93 target.setPos1(((java.lang.Long) value).longValue());
94 } catch (java.lang.Exception ex)
96 throw new IllegalStateException(ex.toString());
100 public java.lang.Object newInstance(java.lang.Object parent)
105 desc.setHandler(handler);
106 desc.setMultivalued(false);
107 addFieldDescriptor(desc);
109 // -- validation code for: _pos1
110 fieldValidator = new org.exolab.castor.xml.FieldValidator();
112 org.exolab.castor.xml.validators.LongValidator typeValidator;
113 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
114 fieldValidator.setValidator(typeValidator);
116 desc.setValidator(fieldValidator);
118 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
119 java.lang.Long.TYPE, "_pos2", "pos2",
120 org.exolab.castor.xml.NodeType.Attribute);
121 handler = new org.exolab.castor.xml.XMLFieldHandler()
123 public java.lang.Object getValue(java.lang.Object object)
124 throws IllegalStateException
126 Alcodon target = (Alcodon) object;
127 if (!target.hasPos2())
131 return new java.lang.Long(target.getPos2());
134 public void setValue(java.lang.Object object, java.lang.Object value)
135 throws IllegalStateException, IllegalArgumentException
139 Alcodon target = (Alcodon) object;
140 // if null, use delete method for optional primitives
146 target.setPos2(((java.lang.Long) value).longValue());
147 } catch (java.lang.Exception ex)
149 throw new IllegalStateException(ex.toString());
153 public java.lang.Object newInstance(java.lang.Object parent)
158 desc.setHandler(handler);
159 desc.setMultivalued(false);
160 addFieldDescriptor(desc);
162 // -- validation code for: _pos2
163 fieldValidator = new org.exolab.castor.xml.FieldValidator();
165 org.exolab.castor.xml.validators.LongValidator typeValidator;
166 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
167 fieldValidator.setValidator(typeValidator);
169 desc.setValidator(fieldValidator);
171 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
172 java.lang.Long.TYPE, "_pos3", "pos3",
173 org.exolab.castor.xml.NodeType.Attribute);
174 handler = new org.exolab.castor.xml.XMLFieldHandler()
176 public java.lang.Object getValue(java.lang.Object object)
177 throws IllegalStateException
179 Alcodon target = (Alcodon) object;
180 if (!target.hasPos3())
184 return new java.lang.Long(target.getPos3());
187 public void setValue(java.lang.Object object, java.lang.Object value)
188 throws IllegalStateException, IllegalArgumentException
192 Alcodon target = (Alcodon) object;
193 // if null, use delete method for optional primitives
199 target.setPos3(((java.lang.Long) value).longValue());
200 } catch (java.lang.Exception ex)
202 throw new IllegalStateException(ex.toString());
206 public java.lang.Object newInstance(java.lang.Object parent)
211 desc.setHandler(handler);
212 desc.setMultivalued(false);
213 addFieldDescriptor(desc);
215 // -- validation code for: _pos3
216 fieldValidator = new org.exolab.castor.xml.FieldValidator();
218 org.exolab.castor.xml.validators.LongValidator typeValidator;
219 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
220 fieldValidator.setValidator(typeValidator);
222 desc.setValidator(fieldValidator);
223 // -- initialize element descriptors
232 * Method getAccessMode.
234 * @return the access mode specified for this class.
236 public org.exolab.castor.mapping.AccessMode getAccessMode()
242 * Method getIdentity.
244 * @return the identity field, null if this class has no identity.
246 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
248 return super.getIdentity();
252 * Method getJavaClass.
254 * @return the Java class represented by this descriptor.
256 public java.lang.Class getJavaClass()
258 return jalview.schemabinding.version2.Alcodon.class;
262 * Method getNameSpacePrefix.
264 * @return the namespace prefix to use when marshaling as XML.
266 public java.lang.String getNameSpacePrefix()
272 * Method getNameSpaceURI.
274 * @return the namespace URI used when marshaling and unmarshaling as XML.
276 public java.lang.String getNameSpaceURI()
282 * Method getValidator.
284 * @return a specific validator for the class described by this
287 public org.exolab.castor.xml.TypeValidator getValidator()
295 * @return the XML Name for the Class being described.
297 public java.lang.String getXMLName()
303 * Method isElementDefinition.
305 * @return true if XML schema definition of this Class is that of a global
306 * element or element with anonymous type definition.
308 public boolean isElementDefinition()
310 return _elementDefinition;