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.MapListFrom;
36 * Class MapListFromDescriptor.
38 * @version $Revision$ $Date$
40 public class MapListFromDescriptor 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 MapListFromDescriptor()
75 _nsURI = "www.vamsas.ac.uk/jalview/version2";
76 _xmlName = "mapListFrom";
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.Integer.TYPE, "_start", "start",
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 MapListFrom target = (MapListFrom) object;
93 if (!target.hasStart())
97 return new java.lang.Integer(target.getStart());
100 public void setValue(java.lang.Object object, java.lang.Object value)
101 throws IllegalStateException, IllegalArgumentException
105 MapListFrom target = (MapListFrom) object;
106 // ignore null values for non optional primitives
112 target.setStart(((java.lang.Integer) value).intValue());
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.setRequired(true);
126 desc.setMultivalued(false);
127 addFieldDescriptor(desc);
129 // -- validation code for: _start
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
131 fieldValidator.setMinOccurs(1);
133 org.exolab.castor.xml.validators.IntValidator typeValidator;
134 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
135 fieldValidator.setValidator(typeValidator);
136 typeValidator.setMinInclusive(-2147483648);
137 typeValidator.setMaxInclusive(2147483647);
139 desc.setValidator(fieldValidator);
141 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
142 java.lang.Integer.TYPE, "_end", "end",
143 org.exolab.castor.xml.NodeType.Attribute);
144 handler = new org.exolab.castor.xml.XMLFieldHandler()
146 public java.lang.Object getValue(java.lang.Object object)
147 throws IllegalStateException
149 MapListFrom target = (MapListFrom) object;
150 if (!target.hasEnd())
154 return new java.lang.Integer(target.getEnd());
157 public void setValue(java.lang.Object object, java.lang.Object value)
158 throws IllegalStateException, IllegalArgumentException
162 MapListFrom target = (MapListFrom) object;
163 // ignore null values for non optional primitives
169 target.setEnd(((java.lang.Integer) value).intValue());
170 } catch (java.lang.Exception ex)
172 throw new IllegalStateException(ex.toString());
176 public java.lang.Object newInstance(java.lang.Object parent)
181 desc.setHandler(handler);
182 desc.setRequired(true);
183 desc.setMultivalued(false);
184 addFieldDescriptor(desc);
186 // -- validation code for: _end
187 fieldValidator = new org.exolab.castor.xml.FieldValidator();
188 fieldValidator.setMinOccurs(1);
190 org.exolab.castor.xml.validators.IntValidator typeValidator;
191 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
192 fieldValidator.setValidator(typeValidator);
193 typeValidator.setMinInclusive(-2147483648);
194 typeValidator.setMaxInclusive(2147483647);
196 desc.setValidator(fieldValidator);
197 // -- initialize element descriptors
206 * Method getAccessMode.
208 * @return the access mode specified for this class.
210 public org.exolab.castor.mapping.AccessMode getAccessMode()
216 * Method getIdentity.
218 * @return the identity field, null if this class has no identity.
220 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
222 return super.getIdentity();
226 * Method getJavaClass.
228 * @return the Java class represented by this descriptor.
230 public java.lang.Class getJavaClass()
232 return jalview.schemabinding.version2.MapListFrom.class;
236 * Method getNameSpacePrefix.
238 * @return the namespace prefix to use when marshaling as XML.
240 public java.lang.String getNameSpacePrefix()
246 * Method getNameSpaceURI.
248 * @return the namespace URI used when marshaling and unmarshaling as XML.
250 public java.lang.String getNameSpaceURI()
256 * Method getValidator.
258 * @return a specific validator for the class described by this
261 public org.exolab.castor.xml.TypeValidator getValidator()
269 * @return the XML Name for the Class being described.
271 public java.lang.String getXMLName()
277 * Method isElementDefinition.
279 * @return true if XML schema definition of this Class is that of a global
280 * element or element with anonymous type definition.
282 public boolean isElementDefinition()
284 return _elementDefinition;