1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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.MapListType;
36 * Class MapListTypeDescriptor.
38 * @version $Revision$ $Date$
40 public class MapListTypeDescriptor 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 MapListTypeDescriptor()
75 _nsURI = "www.vamsas.ac.uk/jalview/version2";
76 _xmlName = "mapListType";
77 _elementDefinition = false;
79 // -- set grouping compositor
80 setCompositorAsSequence();
81 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
82 org.exolab.castor.mapping.FieldHandler handler = null;
83 org.exolab.castor.xml.FieldValidator fieldValidator = null;
84 // -- initialize attribute descriptors
87 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88 java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit",
89 org.exolab.castor.xml.NodeType.Attribute);
90 handler = new org.exolab.castor.xml.XMLFieldHandler()
92 public java.lang.Object getValue(java.lang.Object object)
93 throws IllegalStateException
95 MapListType target = (MapListType) object;
96 if (!target.hasMapFromUnit())
100 return new java.lang.Long(target.getMapFromUnit());
103 public void setValue(java.lang.Object object, java.lang.Object value)
104 throws IllegalStateException, IllegalArgumentException
108 MapListType target = (MapListType) object;
109 // ignore null values for non optional primitives
115 target.setMapFromUnit(((java.lang.Long) value).longValue());
116 } catch (java.lang.Exception ex)
118 throw new IllegalStateException(ex.toString());
122 public java.lang.Object newInstance(java.lang.Object parent)
127 desc.setHandler(handler);
128 desc.setRequired(true);
129 desc.setMultivalued(false);
130 addFieldDescriptor(desc);
132 // -- validation code for: _mapFromUnit
133 fieldValidator = new org.exolab.castor.xml.FieldValidator();
134 fieldValidator.setMinOccurs(1);
136 org.exolab.castor.xml.validators.LongValidator typeValidator;
137 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
138 fieldValidator.setValidator(typeValidator);
139 typeValidator.setMinInclusive(1L);
141 desc.setValidator(fieldValidator);
143 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
144 java.lang.Long.TYPE, "_mapToUnit", "mapToUnit",
145 org.exolab.castor.xml.NodeType.Attribute);
146 handler = new org.exolab.castor.xml.XMLFieldHandler()
148 public java.lang.Object getValue(java.lang.Object object)
149 throws IllegalStateException
151 MapListType target = (MapListType) object;
152 if (!target.hasMapToUnit())
156 return new java.lang.Long(target.getMapToUnit());
159 public void setValue(java.lang.Object object, java.lang.Object value)
160 throws IllegalStateException, IllegalArgumentException
164 MapListType target = (MapListType) object;
165 // ignore null values for non optional primitives
171 target.setMapToUnit(((java.lang.Long) value).longValue());
172 } catch (java.lang.Exception ex)
174 throw new IllegalStateException(ex.toString());
178 public java.lang.Object newInstance(java.lang.Object parent)
183 desc.setHandler(handler);
184 desc.setRequired(true);
185 desc.setMultivalued(false);
186 addFieldDescriptor(desc);
188 // -- validation code for: _mapToUnit
189 fieldValidator = new org.exolab.castor.xml.FieldValidator();
190 fieldValidator.setMinOccurs(1);
192 org.exolab.castor.xml.validators.LongValidator typeValidator;
193 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
194 fieldValidator.setValidator(typeValidator);
195 typeValidator.setMinInclusive(1L);
197 desc.setValidator(fieldValidator);
198 // -- initialize element descriptors
200 // -- _mapListFromList
201 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
202 jalview.schemabinding.version2.MapListFrom.class,
203 "_mapListFromList", "mapListFrom",
204 org.exolab.castor.xml.NodeType.Element);
205 handler = new org.exolab.castor.xml.XMLFieldHandler()
207 public java.lang.Object getValue(java.lang.Object object)
208 throws IllegalStateException
210 MapListType target = (MapListType) object;
211 return target.getMapListFrom();
214 public void setValue(java.lang.Object object, java.lang.Object value)
215 throws IllegalStateException, IllegalArgumentException
219 MapListType target = (MapListType) object;
220 target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value);
221 } catch (java.lang.Exception ex)
223 throw new IllegalStateException(ex.toString());
227 public void resetValue(Object object) throws IllegalStateException,
228 IllegalArgumentException
232 MapListType target = (MapListType) object;
233 target.removeAllMapListFrom();
234 } catch (java.lang.Exception ex)
236 throw new IllegalStateException(ex.toString());
240 public java.lang.Object newInstance(java.lang.Object parent)
242 return new jalview.schemabinding.version2.MapListFrom();
245 desc.setHandler(handler);
246 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
247 desc.setMultivalued(true);
248 addFieldDescriptor(desc);
250 // -- validation code for: _mapListFromList
251 fieldValidator = new org.exolab.castor.xml.FieldValidator();
252 fieldValidator.setMinOccurs(0);
255 desc.setValidator(fieldValidator);
257 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
258 jalview.schemabinding.version2.MapListTo.class,
259 "_mapListToList", "mapListTo",
260 org.exolab.castor.xml.NodeType.Element);
261 handler = new org.exolab.castor.xml.XMLFieldHandler()
263 public java.lang.Object getValue(java.lang.Object object)
264 throws IllegalStateException
266 MapListType target = (MapListType) object;
267 return target.getMapListTo();
270 public void setValue(java.lang.Object object, java.lang.Object value)
271 throws IllegalStateException, IllegalArgumentException
275 MapListType target = (MapListType) object;
276 target.addMapListTo((jalview.schemabinding.version2.MapListTo) value);
277 } catch (java.lang.Exception ex)
279 throw new IllegalStateException(ex.toString());
283 public void resetValue(Object object) throws IllegalStateException,
284 IllegalArgumentException
288 MapListType target = (MapListType) object;
289 target.removeAllMapListTo();
290 } catch (java.lang.Exception ex)
292 throw new IllegalStateException(ex.toString());
296 public java.lang.Object newInstance(java.lang.Object parent)
298 return new jalview.schemabinding.version2.MapListTo();
301 desc.setHandler(handler);
302 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
303 desc.setMultivalued(true);
304 addFieldDescriptor(desc);
306 // -- validation code for: _mapListToList
307 fieldValidator = new org.exolab.castor.xml.FieldValidator();
308 fieldValidator.setMinOccurs(0);
311 desc.setValidator(fieldValidator);
319 * Method getAccessMode.
321 * @return the access mode specified for this class.
323 public org.exolab.castor.mapping.AccessMode getAccessMode()
329 * Method getIdentity.
331 * @return the identity field, null if this class has no identity.
333 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
335 return super.getIdentity();
339 * Method getJavaClass.
341 * @return the Java class represented by this descriptor.
343 public java.lang.Class getJavaClass()
345 return jalview.schemabinding.version2.MapListType.class;
349 * Method getNameSpacePrefix.
351 * @return the namespace prefix to use when marshaling as XML.
353 public java.lang.String getNameSpacePrefix()
359 * Method getNameSpaceURI.
361 * @return the namespace URI used when marshaling and unmarshaling as XML.
363 public java.lang.String getNameSpaceURI()
369 * Method getValidator.
371 * @return a specific validator for the class described by this
374 public org.exolab.castor.xml.TypeValidator getValidator()
382 * @return the XML Name for the Class being described.
384 public java.lang.String getXMLName()
390 * Method isElementDefinition.
392 * @return true if XML schema definition of this Class is that of a global
393 * element or element with anonymous type definition.
395 public boolean isElementDefinition()
397 return _elementDefinition;