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.MapListTo;
37 * Class MapListToDescriptor.
39 * @version $Revision$ $Date$
41 public class MapListToDescriptor 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 MapListToDescriptor()
76 _nsURI = "www.vamsas.ac.uk/jalview/version2";
77 _xmlName = "mapListTo";
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.Integer.TYPE, "_start", "start",
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 MapListTo target = (MapListTo) object;
94 if (!target.hasStart())
98 return new java.lang.Integer(target.getStart());
101 public void setValue(java.lang.Object object, java.lang.Object value)
102 throws IllegalStateException, IllegalArgumentException
106 MapListTo target = (MapListTo) object;
107 // ignore null values for non optional primitives
113 target.setStart(((java.lang.Integer) value).intValue());
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.setRequired(true);
127 desc.setMultivalued(false);
128 addFieldDescriptor(desc);
130 // -- validation code for: _start
131 fieldValidator = new org.exolab.castor.xml.FieldValidator();
132 fieldValidator.setMinOccurs(1);
134 org.exolab.castor.xml.validators.IntValidator typeValidator;
135 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
136 fieldValidator.setValidator(typeValidator);
137 typeValidator.setMinInclusive(-2147483648);
138 typeValidator.setMaxInclusive(2147483647);
140 desc.setValidator(fieldValidator);
142 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
143 java.lang.Integer.TYPE, "_end", "end",
144 org.exolab.castor.xml.NodeType.Attribute);
145 handler = new org.exolab.castor.xml.XMLFieldHandler()
147 public java.lang.Object getValue(java.lang.Object object)
148 throws IllegalStateException
150 MapListTo target = (MapListTo) object;
151 if (!target.hasEnd())
155 return new java.lang.Integer(target.getEnd());
158 public void setValue(java.lang.Object object, java.lang.Object value)
159 throws IllegalStateException, IllegalArgumentException
163 MapListTo target = (MapListTo) object;
164 // ignore null values for non optional primitives
170 target.setEnd(((java.lang.Integer) value).intValue());
171 } catch (java.lang.Exception ex)
173 throw new IllegalStateException(ex.toString());
177 public java.lang.Object newInstance(java.lang.Object parent)
182 desc.setHandler(handler);
183 desc.setRequired(true);
184 desc.setMultivalued(false);
185 addFieldDescriptor(desc);
187 // -- validation code for: _end
188 fieldValidator = new org.exolab.castor.xml.FieldValidator();
189 fieldValidator.setMinOccurs(1);
191 org.exolab.castor.xml.validators.IntValidator typeValidator;
192 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
193 fieldValidator.setValidator(typeValidator);
194 typeValidator.setMinInclusive(-2147483648);
195 typeValidator.setMaxInclusive(2147483647);
197 desc.setValidator(fieldValidator);
198 // -- initialize element descriptors
207 * Method getAccessMode.
209 * @return the access mode specified for this class.
211 public org.exolab.castor.mapping.AccessMode getAccessMode()
217 * Method getIdentity.
219 * @return the identity field, null if this class has no identity.
221 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
223 return super.getIdentity();
227 * Method getJavaClass.
229 * @return the Java class represented by this descriptor.
231 public java.lang.Class getJavaClass()
233 return jalview.schemabinding.version2.MapListTo.class;
237 * Method getNameSpacePrefix.
239 * @return the namespace prefix to use when marshaling as XML.
241 public java.lang.String getNameSpacePrefix()
247 * Method getNameSpaceURI.
249 * @return the namespace URI used when marshaling and unmarshaling as XML.
251 public java.lang.String getNameSpaceURI()
257 * Method getValidator.
259 * @return a specific validator for the class described by this
262 public org.exolab.castor.xml.TypeValidator getValidator()
270 * @return the XML Name for the Class being described.
272 public java.lang.String getXMLName()
278 * Method isElementDefinition.
280 * @return true if XML schema definition of this Class is that of a global
281 * element or element with anonymous type definition.
283 public boolean isElementDefinition()
285 return _elementDefinition;