2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2.descriptors;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import jalview.schemabinding.version2.MapListType;
17 * Class MapListTypeDescriptor.
19 * @version $Revision$ $Date$
21 public class MapListTypeDescriptor extends
22 org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public MapListTypeDescriptor()
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57 _xmlName = "mapListType";
58 _elementDefinition = false;
60 // -- set grouping compositor
61 setCompositorAsSequence();
62 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63 org.exolab.castor.mapping.FieldHandler handler = null;
64 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65 // -- initialize attribute descriptors
68 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69 java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit",
70 org.exolab.castor.xml.NodeType.Attribute);
71 handler = new org.exolab.castor.xml.XMLFieldHandler()
73 public java.lang.Object getValue(java.lang.Object object)
74 throws IllegalStateException
76 MapListType target = (MapListType) object;
77 if (!target.hasMapFromUnit())
81 return new java.lang.Long(target.getMapFromUnit());
84 public void setValue(java.lang.Object object, java.lang.Object value)
85 throws IllegalStateException, IllegalArgumentException
89 MapListType target = (MapListType) object;
90 // ignore null values for non optional primitives
96 target.setMapFromUnit(((java.lang.Long) value).longValue());
97 } catch (java.lang.Exception ex)
99 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent)
108 desc.setHandler(handler);
109 desc.setRequired(true);
110 desc.setMultivalued(false);
111 addFieldDescriptor(desc);
113 // -- validation code for: _mapFromUnit
114 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115 fieldValidator.setMinOccurs(1);
117 org.exolab.castor.xml.validators.LongValidator typeValidator;
118 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
119 fieldValidator.setValidator(typeValidator);
120 typeValidator.setMinInclusive(1L);
122 desc.setValidator(fieldValidator);
124 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
125 java.lang.Long.TYPE, "_mapToUnit", "mapToUnit",
126 org.exolab.castor.xml.NodeType.Attribute);
127 handler = new org.exolab.castor.xml.XMLFieldHandler()
129 public java.lang.Object getValue(java.lang.Object object)
130 throws IllegalStateException
132 MapListType target = (MapListType) object;
133 if (!target.hasMapToUnit())
137 return new java.lang.Long(target.getMapToUnit());
140 public void setValue(java.lang.Object object, java.lang.Object value)
141 throws IllegalStateException, IllegalArgumentException
145 MapListType target = (MapListType) object;
146 // ignore null values for non optional primitives
152 target.setMapToUnit(((java.lang.Long) value).longValue());
153 } catch (java.lang.Exception ex)
155 throw new IllegalStateException(ex.toString());
159 public java.lang.Object newInstance(java.lang.Object parent)
164 desc.setHandler(handler);
165 desc.setRequired(true);
166 desc.setMultivalued(false);
167 addFieldDescriptor(desc);
169 // -- validation code for: _mapToUnit
170 fieldValidator = new org.exolab.castor.xml.FieldValidator();
171 fieldValidator.setMinOccurs(1);
173 org.exolab.castor.xml.validators.LongValidator typeValidator;
174 typeValidator = new org.exolab.castor.xml.validators.LongValidator();
175 fieldValidator.setValidator(typeValidator);
176 typeValidator.setMinInclusive(1L);
178 desc.setValidator(fieldValidator);
179 // -- initialize element descriptors
181 // -- _mapListFromList
182 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
183 jalview.schemabinding.version2.MapListFrom.class,
184 "_mapListFromList", "mapListFrom",
185 org.exolab.castor.xml.NodeType.Element);
186 handler = new org.exolab.castor.xml.XMLFieldHandler()
188 public java.lang.Object getValue(java.lang.Object object)
189 throws IllegalStateException
191 MapListType target = (MapListType) object;
192 return target.getMapListFrom();
195 public void setValue(java.lang.Object object, java.lang.Object value)
196 throws IllegalStateException, IllegalArgumentException
200 MapListType target = (MapListType) object;
201 target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value);
202 } catch (java.lang.Exception ex)
204 throw new IllegalStateException(ex.toString());
208 public void resetValue(Object object) throws IllegalStateException,
209 IllegalArgumentException
213 MapListType target = (MapListType) object;
214 target.removeAllMapListFrom();
215 } catch (java.lang.Exception ex)
217 throw new IllegalStateException(ex.toString());
221 public java.lang.Object newInstance(java.lang.Object parent)
223 return new jalview.schemabinding.version2.MapListFrom();
226 desc.setHandler(handler);
227 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
228 desc.setMultivalued(true);
229 addFieldDescriptor(desc);
231 // -- validation code for: _mapListFromList
232 fieldValidator = new org.exolab.castor.xml.FieldValidator();
233 fieldValidator.setMinOccurs(0);
236 desc.setValidator(fieldValidator);
238 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
239 jalview.schemabinding.version2.MapListTo.class,
240 "_mapListToList", "mapListTo",
241 org.exolab.castor.xml.NodeType.Element);
242 handler = new org.exolab.castor.xml.XMLFieldHandler()
244 public java.lang.Object getValue(java.lang.Object object)
245 throws IllegalStateException
247 MapListType target = (MapListType) object;
248 return target.getMapListTo();
251 public void setValue(java.lang.Object object, java.lang.Object value)
252 throws IllegalStateException, IllegalArgumentException
256 MapListType target = (MapListType) object;
257 target.addMapListTo((jalview.schemabinding.version2.MapListTo) value);
258 } catch (java.lang.Exception ex)
260 throw new IllegalStateException(ex.toString());
264 public void resetValue(Object object) throws IllegalStateException,
265 IllegalArgumentException
269 MapListType target = (MapListType) object;
270 target.removeAllMapListTo();
271 } catch (java.lang.Exception ex)
273 throw new IllegalStateException(ex.toString());
277 public java.lang.Object newInstance(java.lang.Object parent)
279 return new jalview.schemabinding.version2.MapListTo();
282 desc.setHandler(handler);
283 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
284 desc.setMultivalued(true);
285 addFieldDescriptor(desc);
287 // -- validation code for: _mapListToList
288 fieldValidator = new org.exolab.castor.xml.FieldValidator();
289 fieldValidator.setMinOccurs(0);
292 desc.setValidator(fieldValidator);
300 * Method getAccessMode.
302 * @return the access mode specified for this class.
304 public org.exolab.castor.mapping.AccessMode getAccessMode()
310 * Method getIdentity.
312 * @return the identity field, null if this class has no identity.
314 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
316 return super.getIdentity();
320 * Method getJavaClass.
322 * @return the Java class represented by this descriptor.
324 public java.lang.Class getJavaClass()
326 return jalview.schemabinding.version2.MapListType.class;
330 * Method getNameSpacePrefix.
332 * @return the namespace prefix to use when marshaling as XML.
334 public java.lang.String getNameSpacePrefix()
340 * Method getNameSpaceURI.
342 * @return the namespace URI used when marshaling and unmarshaling as XML.
344 public java.lang.String getNameSpaceURI()
350 * Method getValidator.
352 * @return a specific validator for the class described by this
355 public org.exolab.castor.xml.TypeValidator getValidator()
363 * @return the XML Name for the Class being described.
365 public java.lang.String getXMLName()
371 * Method isElementDefinition.
373 * @return true if XML schema definition of this Class is that of a global
374 * element or element with anonymous type definition.
376 public boolean isElementDefinition()
378 return _elementDefinition;