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 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 AlcodonDescriptor() {
55 _nsURI = "www.vamsas.ac.uk/jalview/version2";
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.Long.TYPE, "_pos1", "pos1", org.exolab.castor.xml.NodeType.Attribute);
65 handler = new org.exolab.castor.xml.XMLFieldHandler() {
66 public java.lang.Object getValue( java.lang.Object object )
67 throws IllegalStateException
69 Alcodon target = (Alcodon) object;
70 if (!target.hasPos1()) { return null; }
71 return new java.lang.Long(target.getPos1());
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 Alcodon target = (Alcodon) object;
78 // if null, use delete method for optional primitives
83 target.setPos1( ((java.lang.Long) value).longValue());
84 } catch (java.lang.Exception ex) {
85 throw new IllegalStateException(ex.toString());
88 public java.lang.Object newInstance(java.lang.Object parent) {
92 desc.setHandler(handler);
93 desc.setMultivalued(false);
94 addFieldDescriptor(desc);
96 //-- validation code for: _pos1
97 fieldValidator = new org.exolab.castor.xml.FieldValidator();
99 org.exolab.castor.xml.validators.LongValidator typeValidator;
100 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
101 fieldValidator.setValidator(typeValidator);
103 desc.setValidator(fieldValidator);
105 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos2", "pos2", org.exolab.castor.xml.NodeType.Attribute);
106 handler = new org.exolab.castor.xml.XMLFieldHandler() {
107 public java.lang.Object getValue( java.lang.Object object )
108 throws IllegalStateException
110 Alcodon target = (Alcodon) object;
111 if (!target.hasPos2()) { return null; }
112 return new java.lang.Long(target.getPos2());
114 public void setValue( java.lang.Object object, java.lang.Object value)
115 throws IllegalStateException, IllegalArgumentException
118 Alcodon target = (Alcodon) object;
119 // if null, use delete method for optional primitives
124 target.setPos2( ((java.lang.Long) value).longValue());
125 } catch (java.lang.Exception ex) {
126 throw new IllegalStateException(ex.toString());
129 public java.lang.Object newInstance(java.lang.Object parent) {
133 desc.setHandler(handler);
134 desc.setMultivalued(false);
135 addFieldDescriptor(desc);
137 //-- validation code for: _pos2
138 fieldValidator = new org.exolab.castor.xml.FieldValidator();
140 org.exolab.castor.xml.validators.LongValidator typeValidator;
141 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
142 fieldValidator.setValidator(typeValidator);
144 desc.setValidator(fieldValidator);
146 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos3", "pos3", org.exolab.castor.xml.NodeType.Attribute);
147 handler = new org.exolab.castor.xml.XMLFieldHandler() {
148 public java.lang.Object getValue( java.lang.Object object )
149 throws IllegalStateException
151 Alcodon target = (Alcodon) object;
152 if (!target.hasPos3()) { return null; }
153 return new java.lang.Long(target.getPos3());
155 public void setValue( java.lang.Object object, java.lang.Object value)
156 throws IllegalStateException, IllegalArgumentException
159 Alcodon target = (Alcodon) object;
160 // if null, use delete method for optional primitives
165 target.setPos3( ((java.lang.Long) value).longValue());
166 } catch (java.lang.Exception ex) {
167 throw new IllegalStateException(ex.toString());
170 public java.lang.Object newInstance(java.lang.Object parent) {
174 desc.setHandler(handler);
175 desc.setMultivalued(false);
176 addFieldDescriptor(desc);
178 //-- validation code for: _pos3
179 fieldValidator = new org.exolab.castor.xml.FieldValidator();
181 org.exolab.castor.xml.validators.LongValidator typeValidator;
182 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
183 fieldValidator.setValidator(typeValidator);
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.Alcodon.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;