1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2.descriptors;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import jalview.schemabinding.version2.Alcodon;
36 * Class AlcodonDescriptor.
38 * @version $Revision$ $Date$
40 public class AlcodonDescriptor extends
41 org.exolab.castor.xml.util.XMLClassDescriptorImpl
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
49 * Field _elementDefinition.
51 private boolean _elementDefinition;
56 private java.lang.String _nsPrefix;
61 private java.lang.String _nsURI;
66 private java.lang.String _xmlName;
72 public AlcodonDescriptor()
75 _nsURI = "www.vamsas.ac.uk/jalview/version2";
77 _elementDefinition = true;
78 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
79 org.exolab.castor.mapping.FieldHandler handler = null;
80 org.exolab.castor.xml.FieldValidator fieldValidator = null;
81 // -- initialize attribute descriptors
84 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
85 java.lang.Long.TYPE, "_pos1", "pos1",
86 org.exolab.castor.xml.NodeType.Attribute);
87 handler = new org.exolab.castor.xml.XMLFieldHandler()
89 public java.lang.Object getValue(java.lang.Object object)
90 throws IllegalStateException
92 Alcodon target = (Alcodon) object;
93 if (!target.hasPos1())
97 return new java.lang.Long(target.getPos1());
100 public void setValue(java.lang.Object object, java.lang.Object value)
101 throws IllegalStateException, IllegalArgumentException
105 Alcodon target = (Alcodon) object;
106 // if null, use delete method for optional primitives
112 target.setPos1(((java.lang.Long) value).longValue());
113 } catch (java.lang.Exception ex)
115 throw new IllegalStateException(ex.toString());
119 public java.lang.Object newInstance(java.lang.Object parent)
124 desc.setHandler(handler);
125 desc.setMultivalued(false);
126 addFieldDescriptor(desc);
128 // -- validation code for: _pos1
129 fieldValidator = new org.exolab.castor.xml.FieldValidator();
131 org.exolab.castor.xml.validators.LongValidator typeValidator;
132 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
133 fieldValidator.setValidator(typeValidator);
135 desc.setValidator(fieldValidator);
137 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
138 java.lang.Long.TYPE, "_pos2", "pos2",
139 org.exolab.castor.xml.NodeType.Attribute);
140 handler = new org.exolab.castor.xml.XMLFieldHandler()
142 public java.lang.Object getValue(java.lang.Object object)
143 throws IllegalStateException
145 Alcodon target = (Alcodon) object;
146 if (!target.hasPos2())
150 return new java.lang.Long(target.getPos2());
153 public void setValue(java.lang.Object object, java.lang.Object value)
154 throws IllegalStateException, IllegalArgumentException
158 Alcodon target = (Alcodon) object;
159 // if null, use delete method for optional primitives
165 target.setPos2(((java.lang.Long) value).longValue());
166 } catch (java.lang.Exception ex)
168 throw new IllegalStateException(ex.toString());
172 public java.lang.Object newInstance(java.lang.Object parent)
177 desc.setHandler(handler);
178 desc.setMultivalued(false);
179 addFieldDescriptor(desc);
181 // -- validation code for: _pos2
182 fieldValidator = new org.exolab.castor.xml.FieldValidator();
184 org.exolab.castor.xml.validators.LongValidator typeValidator;
185 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
186 fieldValidator.setValidator(typeValidator);
188 desc.setValidator(fieldValidator);
190 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
191 java.lang.Long.TYPE, "_pos3", "pos3",
192 org.exolab.castor.xml.NodeType.Attribute);
193 handler = new org.exolab.castor.xml.XMLFieldHandler()
195 public java.lang.Object getValue(java.lang.Object object)
196 throws IllegalStateException
198 Alcodon target = (Alcodon) object;
199 if (!target.hasPos3())
203 return new java.lang.Long(target.getPos3());
206 public void setValue(java.lang.Object object, java.lang.Object value)
207 throws IllegalStateException, IllegalArgumentException
211 Alcodon target = (Alcodon) object;
212 // if null, use delete method for optional primitives
218 target.setPos3(((java.lang.Long) value).longValue());
219 } catch (java.lang.Exception ex)
221 throw new IllegalStateException(ex.toString());
225 public java.lang.Object newInstance(java.lang.Object parent)
230 desc.setHandler(handler);
231 desc.setMultivalued(false);
232 addFieldDescriptor(desc);
234 // -- validation code for: _pos3
235 fieldValidator = new org.exolab.castor.xml.FieldValidator();
237 org.exolab.castor.xml.validators.LongValidator typeValidator;
238 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
239 fieldValidator.setValidator(typeValidator);
241 desc.setValidator(fieldValidator);
242 // -- initialize element descriptors
251 * Method getAccessMode.
253 * @return the access mode specified for this class.
255 public org.exolab.castor.mapping.AccessMode getAccessMode()
261 * Method getIdentity.
263 * @return the identity field, null if this class has no identity.
265 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
267 return super.getIdentity();
271 * Method getJavaClass.
273 * @return the Java class represented by this descriptor.
275 public java.lang.Class getJavaClass()
277 return jalview.schemabinding.version2.Alcodon.class;
281 * Method getNameSpacePrefix.
283 * @return the namespace prefix to use when marshaling as XML.
285 public java.lang.String getNameSpacePrefix()
291 * Method getNameSpaceURI.
293 * @return the namespace URI used when marshaling and unmarshaling as XML.
295 public java.lang.String getNameSpaceURI()
301 * Method getValidator.
303 * @return a specific validator for the class described by this
306 public org.exolab.castor.xml.TypeValidator getValidator()
314 * @return the XML Name for the Class being described.
316 public java.lang.String getXMLName()
322 * Method isElementDefinition.
324 * @return true if XML schema definition of this Class is that of a global
325 * element or element with anonymous type definition.
327 public boolean isElementDefinition()
329 return _elementDefinition;