2de6b0afa6ef1e13307636fc18786f32e331a6bc
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.Sequence;
15
16 /**
17  * Class SequenceDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class SequenceDescriptor extends jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * Field _elementDefinition.
30      */
31     private boolean _elementDefinition;
32
33     /**
34      * Field _nsPrefix.
35      */
36     private java.lang.String _nsPrefix;
37
38     /**
39      * Field _nsURI.
40      */
41     private java.lang.String _nsURI;
42
43     /**
44      * Field _xmlName.
45      */
46     private java.lang.String _xmlName;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public SequenceDescriptor() {
54         super();
55         setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor());
56         _nsURI = "www.vamsas.ac.uk/jalview/version2";
57         _xmlName = "Sequence";
58         _elementDefinition = true;
59         
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
66         
67         //-- _dsseqid
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
73             {
74                 Sequence target = (Sequence) object;
75                 return target.getDsseqid();
76             }
77             public void setValue( java.lang.Object object, java.lang.Object value) 
78                 throws IllegalStateException, IllegalArgumentException
79             {
80                 try {
81                     Sequence target = (Sequence) object;
82                     target.setDsseqid( (java.lang.String) value);
83                 } catch (java.lang.Exception ex) {
84                     throw new IllegalStateException(ex.toString());
85                 }
86             }
87             public java.lang.Object newInstance(java.lang.Object parent) {
88                 return null;
89             }
90         };
91         desc.setHandler(handler);
92         desc.setMultivalued(false);
93         addFieldDescriptor(desc);
94         
95         //-- validation code for: _dsseqid
96         fieldValidator = new org.exolab.castor.xml.FieldValidator();
97         { //-- local scope
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");
102         }
103         desc.setValidator(fieldValidator);
104         //-- initialize element descriptors
105         
106         //-- _DBRefList
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
111             {
112                 Sequence target = (Sequence) object;
113                 return target.getDBRef();
114             }
115             public void setValue( java.lang.Object object, java.lang.Object value) 
116                 throws IllegalStateException, IllegalArgumentException
117             {
118                 try {
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());
123                 }
124             }
125             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
126                 try {
127                     Sequence target = (Sequence) object;
128                     target.removeAllDBRef();
129                 } catch (java.lang.Exception ex) {
130                     throw new IllegalStateException(ex.toString());
131                 }
132             }
133             public java.lang.Object newInstance(java.lang.Object parent) {
134                 return new jalview.schemabinding.version2.DBRef();
135             }
136         };
137         desc.setHandler(handler);
138         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
139         desc.setMultivalued(true);
140         addFieldDescriptor(desc);
141         
142         //-- validation code for: _DBRefList
143         fieldValidator = new org.exolab.castor.xml.FieldValidator();
144         fieldValidator.setMinOccurs(0);
145         { //-- local scope
146         }
147         desc.setValidator(fieldValidator);
148     }
149
150
151       //-----------/
152      //- Methods -/
153     //-----------/
154
155     /**
156      * Method getAccessMode.
157      * 
158      * @return the access mode specified for this class.
159      */
160     public org.exolab.castor.mapping.AccessMode getAccessMode(
161     ) {
162         return null;
163     }
164
165     /**
166      * Method getIdentity.
167      * 
168      * @return the identity field, null if this class has no
169      * identity.
170      */
171     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
172     ) {
173         return super.getIdentity();
174     }
175
176     /**
177      * Method getJavaClass.
178      * 
179      * @return the Java class represented by this descriptor.
180      */
181     public java.lang.Class getJavaClass(
182     ) {
183         return jalview.schemabinding.version2.Sequence.class;
184     }
185
186     /**
187      * Method getNameSpacePrefix.
188      * 
189      * @return the namespace prefix to use when marshaling as XML.
190      */
191     public java.lang.String getNameSpacePrefix(
192     ) {
193         return _nsPrefix;
194     }
195
196     /**
197      * Method getNameSpaceURI.
198      * 
199      * @return the namespace URI used when marshaling and
200      * unmarshaling as XML.
201      */
202     public java.lang.String getNameSpaceURI(
203     ) {
204         return _nsURI;
205     }
206
207     /**
208      * Method getValidator.
209      * 
210      * @return a specific validator for the class described by this
211      * ClassDescriptor.
212      */
213     public org.exolab.castor.xml.TypeValidator getValidator(
214     ) {
215         return this;
216     }
217
218     /**
219      * Method getXMLName.
220      * 
221      * @return the XML Name for the Class being described.
222      */
223     public java.lang.String getXMLName(
224     ) {
225         return _xmlName;
226     }
227
228     /**
229      * Method isElementDefinition.
230      * 
231      * @return true if XML schema definition of this Class is that
232      * of a global
233      * element or element with anonymous type definition.
234      */
235     public boolean isElementDefinition(
236     ) {
237         return _elementDefinition;
238     }
239
240 }