1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
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. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.Alcodon;
34 * Class AlcodonDescriptor.
36 * @version $Revision$ $Date$
38 public class AlcodonDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public AlcodonDescriptor() {
72 _nsURI = "www.vamsas.ac.uk/jalview/version2";
74 _elementDefinition = true;
75 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
76 org.exolab.castor.mapping.FieldHandler handler = null;
77 org.exolab.castor.xml.FieldValidator fieldValidator = null;
78 //-- initialize attribute descriptors
81 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos1", "pos1", org.exolab.castor.xml.NodeType.Attribute);
82 handler = new org.exolab.castor.xml.XMLFieldHandler() {
83 public java.lang.Object getValue( java.lang.Object object )
84 throws IllegalStateException
86 Alcodon target = (Alcodon) object;
87 if (!target.hasPos1()) { return null; }
88 return new java.lang.Long(target.getPos1());
90 public void setValue( java.lang.Object object, java.lang.Object value)
91 throws IllegalStateException, IllegalArgumentException
94 Alcodon target = (Alcodon) object;
95 // if null, use delete method for optional primitives
100 target.setPos1( ((java.lang.Long) value).longValue());
101 } catch (java.lang.Exception ex) {
102 throw new IllegalStateException(ex.toString());
105 public java.lang.Object newInstance(java.lang.Object parent) {
109 desc.setHandler(handler);
110 desc.setMultivalued(false);
111 addFieldDescriptor(desc);
113 //-- validation code for: _pos1
114 fieldValidator = new org.exolab.castor.xml.FieldValidator();
116 org.exolab.castor.xml.validators.LongValidator typeValidator;
117 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
118 fieldValidator.setValidator(typeValidator);
120 desc.setValidator(fieldValidator);
122 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos2", "pos2", org.exolab.castor.xml.NodeType.Attribute);
123 handler = new org.exolab.castor.xml.XMLFieldHandler() {
124 public java.lang.Object getValue( java.lang.Object object )
125 throws IllegalStateException
127 Alcodon target = (Alcodon) object;
128 if (!target.hasPos2()) { return null; }
129 return new java.lang.Long(target.getPos2());
131 public void setValue( java.lang.Object object, java.lang.Object value)
132 throws IllegalStateException, IllegalArgumentException
135 Alcodon target = (Alcodon) object;
136 // if null, use delete method for optional primitives
141 target.setPos2( ((java.lang.Long) value).longValue());
142 } catch (java.lang.Exception ex) {
143 throw new IllegalStateException(ex.toString());
146 public java.lang.Object newInstance(java.lang.Object parent) {
150 desc.setHandler(handler);
151 desc.setMultivalued(false);
152 addFieldDescriptor(desc);
154 //-- validation code for: _pos2
155 fieldValidator = new org.exolab.castor.xml.FieldValidator();
157 org.exolab.castor.xml.validators.LongValidator typeValidator;
158 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
159 fieldValidator.setValidator(typeValidator);
161 desc.setValidator(fieldValidator);
163 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos3", "pos3", org.exolab.castor.xml.NodeType.Attribute);
164 handler = new org.exolab.castor.xml.XMLFieldHandler() {
165 public java.lang.Object getValue( java.lang.Object object )
166 throws IllegalStateException
168 Alcodon target = (Alcodon) object;
169 if (!target.hasPos3()) { return null; }
170 return new java.lang.Long(target.getPos3());
172 public void setValue( java.lang.Object object, java.lang.Object value)
173 throws IllegalStateException, IllegalArgumentException
176 Alcodon target = (Alcodon) object;
177 // if null, use delete method for optional primitives
182 target.setPos3( ((java.lang.Long) value).longValue());
183 } catch (java.lang.Exception ex) {
184 throw new IllegalStateException(ex.toString());
187 public java.lang.Object newInstance(java.lang.Object parent) {
191 desc.setHandler(handler);
192 desc.setMultivalued(false);
193 addFieldDescriptor(desc);
195 //-- validation code for: _pos3
196 fieldValidator = new org.exolab.castor.xml.FieldValidator();
198 org.exolab.castor.xml.validators.LongValidator typeValidator;
199 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
200 fieldValidator.setValidator(typeValidator);
202 desc.setValidator(fieldValidator);
203 //-- initialize element descriptors
213 * Method getAccessMode.
215 * @return the access mode specified for this class.
217 public org.exolab.castor.mapping.AccessMode getAccessMode(
223 * Method getIdentity.
225 * @return the identity field, null if this class has no
228 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
230 return super.getIdentity();
234 * Method getJavaClass.
236 * @return the Java class represented by this descriptor.
238 public java.lang.Class getJavaClass(
240 return jalview.schemabinding.version2.Alcodon.class;
244 * Method getNameSpacePrefix.
246 * @return the namespace prefix to use when marshaling as XML.
248 public java.lang.String getNameSpacePrefix(
254 * Method getNameSpaceURI.
256 * @return the namespace URI used when marshaling and
257 * unmarshaling as XML.
259 public java.lang.String getNameSpaceURI(
265 * Method getValidator.
267 * @return a specific validator for the class described by this
270 public org.exolab.castor.xml.TypeValidator getValidator(
278 * @return the XML Name for the Class being described.
280 public java.lang.String getXMLName(
286 * Method isElementDefinition.
288 * @return true if XML schema definition of this Class is that
290 * element or element with anonymous type definition.
292 public boolean isElementDefinition(
294 return _elementDefinition;