1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2.descriptors;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import jalview.schemabinding.version2.Alcodon;
37 * Class AlcodonDescriptor.
39 * @version $Revision$ $Date$
41 public class AlcodonDescriptor extends
42 org.exolab.castor.xml.util.XMLClassDescriptorImpl
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
50 * Field _elementDefinition.
52 private boolean _elementDefinition;
57 private java.lang.String _nsPrefix;
62 private java.lang.String _nsURI;
67 private java.lang.String _xmlName;
73 public AlcodonDescriptor()
76 _nsURI = "www.vamsas.ac.uk/jalview/version2";
78 _elementDefinition = true;
79 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
80 org.exolab.castor.mapping.FieldHandler handler = null;
81 org.exolab.castor.xml.FieldValidator fieldValidator = null;
82 // -- initialize attribute descriptors
85 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
86 java.lang.Long.TYPE, "_pos1", "pos1",
87 org.exolab.castor.xml.NodeType.Attribute);
88 handler = new org.exolab.castor.xml.XMLFieldHandler()
90 public java.lang.Object getValue(java.lang.Object object)
91 throws IllegalStateException
93 Alcodon target = (Alcodon) object;
94 if (!target.hasPos1())
98 return new java.lang.Long(target.getPos1());
101 public void setValue(java.lang.Object object, java.lang.Object value)
102 throws IllegalStateException, IllegalArgumentException
106 Alcodon target = (Alcodon) object;
107 // if null, use delete method for optional primitives
113 target.setPos1(((java.lang.Long) value).longValue());
114 } catch (java.lang.Exception ex)
116 throw new IllegalStateException(ex.toString());
120 public java.lang.Object newInstance(java.lang.Object parent)
125 desc.setHandler(handler);
126 desc.setMultivalued(false);
127 addFieldDescriptor(desc);
129 // -- validation code for: _pos1
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
132 org.exolab.castor.xml.validators.LongValidator typeValidator;
133 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
134 fieldValidator.setValidator(typeValidator);
136 desc.setValidator(fieldValidator);
138 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
139 java.lang.Long.TYPE, "_pos2", "pos2",
140 org.exolab.castor.xml.NodeType.Attribute);
141 handler = new org.exolab.castor.xml.XMLFieldHandler()
143 public java.lang.Object getValue(java.lang.Object object)
144 throws IllegalStateException
146 Alcodon target = (Alcodon) object;
147 if (!target.hasPos2())
151 return new java.lang.Long(target.getPos2());
154 public void setValue(java.lang.Object object, java.lang.Object value)
155 throws IllegalStateException, IllegalArgumentException
159 Alcodon target = (Alcodon) object;
160 // if null, use delete method for optional primitives
166 target.setPos2(((java.lang.Long) value).longValue());
167 } catch (java.lang.Exception ex)
169 throw new IllegalStateException(ex.toString());
173 public java.lang.Object newInstance(java.lang.Object parent)
178 desc.setHandler(handler);
179 desc.setMultivalued(false);
180 addFieldDescriptor(desc);
182 // -- validation code for: _pos2
183 fieldValidator = new org.exolab.castor.xml.FieldValidator();
185 org.exolab.castor.xml.validators.LongValidator typeValidator;
186 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
187 fieldValidator.setValidator(typeValidator);
189 desc.setValidator(fieldValidator);
191 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
192 java.lang.Long.TYPE, "_pos3", "pos3",
193 org.exolab.castor.xml.NodeType.Attribute);
194 handler = new org.exolab.castor.xml.XMLFieldHandler()
196 public java.lang.Object getValue(java.lang.Object object)
197 throws IllegalStateException
199 Alcodon target = (Alcodon) object;
200 if (!target.hasPos3())
204 return new java.lang.Long(target.getPos3());
207 public void setValue(java.lang.Object object, java.lang.Object value)
208 throws IllegalStateException, IllegalArgumentException
212 Alcodon target = (Alcodon) object;
213 // if null, use delete method for optional primitives
219 target.setPos3(((java.lang.Long) value).longValue());
220 } catch (java.lang.Exception ex)
222 throw new IllegalStateException(ex.toString());
226 public java.lang.Object newInstance(java.lang.Object parent)
231 desc.setHandler(handler);
232 desc.setMultivalued(false);
233 addFieldDescriptor(desc);
235 // -- validation code for: _pos3
236 fieldValidator = new org.exolab.castor.xml.FieldValidator();
238 org.exolab.castor.xml.validators.LongValidator typeValidator;
239 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
240 fieldValidator.setValidator(typeValidator);
242 desc.setValidator(fieldValidator);
243 // -- initialize element descriptors
252 * Method getAccessMode.
254 * @return the access mode specified for this class.
256 public org.exolab.castor.mapping.AccessMode getAccessMode()
262 * Method getIdentity.
264 * @return the identity field, null if this class has no identity.
266 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
268 return super.getIdentity();
272 * Method getJavaClass.
274 * @return the Java class represented by this descriptor.
276 public java.lang.Class getJavaClass()
278 return jalview.schemabinding.version2.Alcodon.class;
282 * Method getNameSpacePrefix.
284 * @return the namespace prefix to use when marshaling as XML.
286 public java.lang.String getNameSpacePrefix()
292 * Method getNameSpaceURI.
294 * @return the namespace URI used when marshaling and unmarshaling as XML.
296 public java.lang.String getNameSpaceURI()
302 * Method getValidator.
304 * @return a specific validator for the class described by this
307 public org.exolab.castor.xml.TypeValidator getValidator()
315 * @return the XML Name for the Class being described.
317 public java.lang.String getXMLName()
323 * Method isElementDefinition.
325 * @return true if XML schema definition of this Class is that of a global
326 * element or element with anonymous type definition.
328 public boolean isElementDefinition()
330 return _elementDefinition;