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.MapListTo;
17 * Class MapListToDescriptor.
19 * @version $Revision$ $Date$
21 public class MapListToDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
29 * Field _elementDefinition.
31 private boolean _elementDefinition;
36 private java.lang.String _nsPrefix;
41 private java.lang.String _nsURI;
46 private java.lang.String _xmlName;
53 public MapListToDescriptor() {
55 _nsURI = "www.vamsas.ac.uk/jalview/version2";
56 _xmlName = "mapListTo";
57 _elementDefinition = true;
58 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
59 org.exolab.castor.mapping.FieldHandler handler = null;
60 org.exolab.castor.xml.FieldValidator fieldValidator = null;
61 //-- initialize attribute descriptors
64 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
65 handler = new org.exolab.castor.xml.XMLFieldHandler() {
66 public java.lang.Object getValue( java.lang.Object object )
67 throws IllegalStateException
69 MapListTo target = (MapListTo) object;
70 if (!target.hasStart()) { return null; }
71 return new java.lang.Integer(target.getStart());
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 MapListTo target = (MapListTo) object;
78 // ignore null values for non optional primitives
79 if (value == null) { return; }
81 target.setStart( ((java.lang.Integer) value).intValue());
82 } catch (java.lang.Exception ex) {
83 throw new IllegalStateException(ex.toString());
86 public java.lang.Object newInstance(java.lang.Object parent) {
90 desc.setHandler(handler);
91 desc.setRequired(true);
92 desc.setMultivalued(false);
93 addFieldDescriptor(desc);
95 //-- validation code for: _start
96 fieldValidator = new org.exolab.castor.xml.FieldValidator();
97 fieldValidator.setMinOccurs(1);
99 org.exolab.castor.xml.validators.IntValidator typeValidator;
100 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
101 fieldValidator.setValidator(typeValidator);
102 typeValidator.setMinInclusive(-2147483648);
103 typeValidator.setMaxInclusive(2147483647);
105 desc.setValidator(fieldValidator);
107 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
108 handler = new org.exolab.castor.xml.XMLFieldHandler() {
109 public java.lang.Object getValue( java.lang.Object object )
110 throws IllegalStateException
112 MapListTo target = (MapListTo) object;
113 if (!target.hasEnd()) { return null; }
114 return new java.lang.Integer(target.getEnd());
116 public void setValue( java.lang.Object object, java.lang.Object value)
117 throws IllegalStateException, IllegalArgumentException
120 MapListTo target = (MapListTo) object;
121 // ignore null values for non optional primitives
122 if (value == null) { return; }
124 target.setEnd( ((java.lang.Integer) value).intValue());
125 } catch (java.lang.Exception ex) {
126 throw new IllegalStateException(ex.toString());
129 public java.lang.Object newInstance(java.lang.Object parent) {
133 desc.setHandler(handler);
134 desc.setRequired(true);
135 desc.setMultivalued(false);
136 addFieldDescriptor(desc);
138 //-- validation code for: _end
139 fieldValidator = new org.exolab.castor.xml.FieldValidator();
140 fieldValidator.setMinOccurs(1);
142 org.exolab.castor.xml.validators.IntValidator typeValidator;
143 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
144 fieldValidator.setValidator(typeValidator);
145 typeValidator.setMinInclusive(-2147483648);
146 typeValidator.setMaxInclusive(2147483647);
148 desc.setValidator(fieldValidator);
149 //-- initialize element descriptors
159 * Method getAccessMode.
161 * @return the access mode specified for this class.
163 public org.exolab.castor.mapping.AccessMode getAccessMode(
169 * Method getIdentity.
171 * @return the identity field, null if this class has no
174 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
176 return super.getIdentity();
180 * Method getJavaClass.
182 * @return the Java class represented by this descriptor.
184 public java.lang.Class getJavaClass(
186 return jalview.schemabinding.version2.MapListTo.class;
190 * Method getNameSpacePrefix.
192 * @return the namespace prefix to use when marshaling as XML.
194 public java.lang.String getNameSpacePrefix(
200 * Method getNameSpaceURI.
202 * @return the namespace URI used when marshaling and
203 * unmarshaling as XML.
205 public java.lang.String getNameSpaceURI(
211 * Method getValidator.
213 * @return a specific validator for the class described by this
216 public org.exolab.castor.xml.TypeValidator getValidator(
224 * @return the XML Name for the Class being described.
226 public java.lang.String getXMLName(
232 * Method isElementDefinition.
234 * @return true if XML schema definition of this Class is that
236 * element or element with anonymous type definition.
238 public boolean isElementDefinition(
240 return _elementDefinition;