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.Sequence;
17 * Class SequenceDescriptor.
19 * @version $Revision$ $Date$
21 public class SequenceDescriptor extends jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor {
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 SequenceDescriptor() {
55 setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor());
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57 _xmlName = "Sequence";
58 _elementDefinition = true;
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(java.lang.String.class, "_dsseqid", "dsseqid", org.exolab.castor.xml.NodeType.Attribute);
69 desc.setImmutable(true);
70 handler = new org.exolab.castor.xml.XMLFieldHandler() {
71 public java.lang.Object getValue( java.lang.Object object )
72 throws IllegalStateException
74 Sequence target = (Sequence) object;
75 return target.getDsseqid();
77 public void setValue( java.lang.Object object, java.lang.Object value)
78 throws IllegalStateException, IllegalArgumentException
81 Sequence target = (Sequence) object;
82 target.setDsseqid( (java.lang.String) value);
83 } catch (java.lang.Exception ex) {
84 throw new IllegalStateException(ex.toString());
87 public java.lang.Object newInstance(java.lang.Object parent) {
91 desc.setHandler(handler);
92 desc.setMultivalued(false);
93 addFieldDescriptor(desc);
95 //-- validation code for: _dsseqid
96 fieldValidator = new org.exolab.castor.xml.FieldValidator();
98 org.exolab.castor.xml.validators.StringValidator typeValidator;
99 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
100 fieldValidator.setValidator(typeValidator);
101 typeValidator.setWhiteSpace("preserve");
103 desc.setValidator(fieldValidator);
104 //-- initialize element descriptors
107 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.DBRef.class, "_DBRefList", "DBRef", org.exolab.castor.xml.NodeType.Element);
108 handler = new org.exolab.castor.xml.XMLFieldHandler() {
109 public java.lang.Object getValue( java.lang.Object object )
110 throws IllegalStateException
112 Sequence target = (Sequence) object;
113 return target.getDBRef();
115 public void setValue( java.lang.Object object, java.lang.Object value)
116 throws IllegalStateException, IllegalArgumentException
119 Sequence target = (Sequence) object;
120 target.addDBRef( (jalview.schemabinding.version2.DBRef) value);
121 } catch (java.lang.Exception ex) {
122 throw new IllegalStateException(ex.toString());
125 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
127 Sequence target = (Sequence) object;
128 target.removeAllDBRef();
129 } catch (java.lang.Exception ex) {
130 throw new IllegalStateException(ex.toString());
133 public java.lang.Object newInstance(java.lang.Object parent) {
134 return new jalview.schemabinding.version2.DBRef();
137 desc.setHandler(handler);
138 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
139 desc.setMultivalued(true);
140 addFieldDescriptor(desc);
142 //-- validation code for: _DBRefList
143 fieldValidator = new org.exolab.castor.xml.FieldValidator();
144 fieldValidator.setMinOccurs(0);
147 desc.setValidator(fieldValidator);
156 * Method getAccessMode.
158 * @return the access mode specified for this class.
160 public org.exolab.castor.mapping.AccessMode getAccessMode(
166 * Method getIdentity.
168 * @return the identity field, null if this class has no
171 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
173 return super.getIdentity();
177 * Method getJavaClass.
179 * @return the Java class represented by this descriptor.
181 public java.lang.Class getJavaClass(
183 return jalview.schemabinding.version2.Sequence.class;
187 * Method getNameSpacePrefix.
189 * @return the namespace prefix to use when marshaling as XML.
191 public java.lang.String getNameSpacePrefix(
197 * Method getNameSpaceURI.
199 * @return the namespace URI used when marshaling and
200 * unmarshaling as XML.
202 public java.lang.String getNameSpaceURI(
208 * Method getValidator.
210 * @return a specific validator for the class described by this
213 public org.exolab.castor.xml.TypeValidator getValidator(
221 * @return the XML Name for the Class being described.
223 public java.lang.String getXMLName(
229 * Method isElementDefinition.
231 * @return true if XML schema definition of this Class is that
233 * element or element with anonymous type definition.
235 public boolean isElementDefinition(
237 return _elementDefinition;