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.SequenceType;
17 * Class SequenceTypeDescriptor.
19 * @version $Revision$ $Date$
21 public class SequenceTypeDescriptor 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 SequenceTypeDescriptor()
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57 _xmlName = "SequenceType";
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.String.class, "_id", "id",
70 org.exolab.castor.xml.NodeType.Attribute);
71 desc.setImmutable(true);
72 handler = new org.exolab.castor.xml.XMLFieldHandler()
74 public java.lang.Object getValue(java.lang.Object object)
75 throws IllegalStateException
77 SequenceType target = (SequenceType) object;
78 return target.getId();
81 public void setValue(java.lang.Object object, java.lang.Object value)
82 throws IllegalStateException, IllegalArgumentException
86 SequenceType target = (SequenceType) object;
87 target.setId((java.lang.String) value);
88 } catch (java.lang.Exception ex)
90 throw new IllegalStateException(ex.toString());
94 public java.lang.Object newInstance(java.lang.Object parent)
99 desc.setHandler(handler);
100 desc.setMultivalued(false);
101 addFieldDescriptor(desc);
103 // -- validation code for: _id
104 fieldValidator = new org.exolab.castor.xml.FieldValidator();
106 org.exolab.castor.xml.validators.StringValidator typeValidator;
107 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
108 fieldValidator.setValidator(typeValidator);
109 typeValidator.setWhiteSpace("preserve");
111 desc.setValidator(fieldValidator);
113 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
114 java.lang.String.class, "_description", "description",
115 org.exolab.castor.xml.NodeType.Attribute);
116 desc.setImmutable(true);
117 handler = new org.exolab.castor.xml.XMLFieldHandler()
119 public java.lang.Object getValue(java.lang.Object object)
120 throws IllegalStateException
122 SequenceType target = (SequenceType) object;
123 return target.getDescription();
126 public void setValue(java.lang.Object object, java.lang.Object value)
127 throws IllegalStateException, IllegalArgumentException
131 SequenceType target = (SequenceType) object;
132 target.setDescription((java.lang.String) value);
133 } catch (java.lang.Exception ex)
135 throw new IllegalStateException(ex.toString());
139 public java.lang.Object newInstance(java.lang.Object parent)
144 desc.setHandler(handler);
145 desc.setMultivalued(false);
146 addFieldDescriptor(desc);
148 // -- validation code for: _description
149 fieldValidator = new org.exolab.castor.xml.FieldValidator();
151 org.exolab.castor.xml.validators.StringValidator typeValidator;
152 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
153 fieldValidator.setValidator(typeValidator);
154 typeValidator.setWhiteSpace("preserve");
156 desc.setValidator(fieldValidator);
157 // -- initialize element descriptors
160 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
161 java.lang.String.class, "_sequence", "sequence",
162 org.exolab.castor.xml.NodeType.Element);
163 desc.setImmutable(true);
164 handler = new org.exolab.castor.xml.XMLFieldHandler()
166 public java.lang.Object getValue(java.lang.Object object)
167 throws IllegalStateException
169 SequenceType target = (SequenceType) object;
170 return target.getSequence();
173 public void setValue(java.lang.Object object, java.lang.Object value)
174 throws IllegalStateException, IllegalArgumentException
178 SequenceType target = (SequenceType) object;
179 target.setSequence((java.lang.String) value);
180 } catch (java.lang.Exception ex)
182 throw new IllegalStateException(ex.toString());
186 public java.lang.Object newInstance(java.lang.Object parent)
191 desc.setHandler(handler);
192 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
193 desc.setMultivalued(false);
194 addFieldDescriptor(desc);
196 // -- validation code for: _sequence
197 fieldValidator = new org.exolab.castor.xml.FieldValidator();
199 org.exolab.castor.xml.validators.StringValidator typeValidator;
200 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
201 fieldValidator.setValidator(typeValidator);
202 typeValidator.setWhiteSpace("preserve");
204 desc.setValidator(fieldValidator);
206 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
207 java.lang.String.class, "_name", "name",
208 org.exolab.castor.xml.NodeType.Element);
209 desc.setImmutable(true);
210 handler = new org.exolab.castor.xml.XMLFieldHandler()
212 public java.lang.Object getValue(java.lang.Object object)
213 throws IllegalStateException
215 SequenceType target = (SequenceType) object;
216 return target.getName();
219 public void setValue(java.lang.Object object, java.lang.Object value)
220 throws IllegalStateException, IllegalArgumentException
224 SequenceType target = (SequenceType) object;
225 target.setName((java.lang.String) value);
226 } catch (java.lang.Exception ex)
228 throw new IllegalStateException(ex.toString());
232 public java.lang.Object newInstance(java.lang.Object parent)
237 desc.setHandler(handler);
238 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
239 desc.setMultivalued(false);
240 addFieldDescriptor(desc);
242 // -- validation code for: _name
243 fieldValidator = new org.exolab.castor.xml.FieldValidator();
245 org.exolab.castor.xml.validators.StringValidator typeValidator;
246 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
247 fieldValidator.setValidator(typeValidator);
248 typeValidator.setWhiteSpace("preserve");
250 desc.setValidator(fieldValidator);
258 * Method getAccessMode.
260 * @return the access mode specified for this class.
262 public org.exolab.castor.mapping.AccessMode getAccessMode()
268 * Method getIdentity.
270 * @return the identity field, null if this class has no identity.
272 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
274 return super.getIdentity();
278 * Method getJavaClass.
280 * @return the Java class represented by this descriptor.
282 public java.lang.Class getJavaClass()
284 return jalview.schemabinding.version2.SequenceType.class;
288 * Method getNameSpacePrefix.
290 * @return the namespace prefix to use when marshaling as XML.
292 public java.lang.String getNameSpacePrefix()
298 * Method getNameSpaceURI.
300 * @return the namespace URI used when marshaling and unmarshaling as XML.
302 public java.lang.String getNameSpaceURI()
308 * Method getValidator.
310 * @return a specific validator for the class described by this
313 public org.exolab.castor.xml.TypeValidator getValidator()
321 * @return the XML Name for the Class being described.
323 public java.lang.String getXMLName()
329 * Method isElementDefinition.
331 * @return true if XML schema definition of this Class is that of a global
332 * element or element with anonymous type definition.
334 public boolean isElementDefinition()
336 return _elementDefinition;