b0aa8f946f6b884efcad3d70c27a22e089ad2e42
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MappingChoiceDescriptor.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.MappingChoice;
15
16 /**
17  * Class MappingChoiceDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class MappingChoiceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
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 MappingChoiceDescriptor() {
54         super();
55         _nsURI = "www.vamsas.ac.uk/jalview/version2";
56         _elementDefinition = false;
57         
58         //-- set grouping compositor
59         setCompositorAsChoice();
60         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
61         org.exolab.castor.mapping.FieldHandler             handler        = null;
62         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
63         //-- initialize attribute descriptors
64         
65         //-- initialize element descriptors
66         
67         //-- _sequence
68         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequence", "Sequence", org.exolab.castor.xml.NodeType.Element);
69         handler = new org.exolab.castor.xml.XMLFieldHandler() {
70             public java.lang.Object getValue( java.lang.Object object ) 
71                 throws IllegalStateException
72             {
73                 MappingChoice target = (MappingChoice) object;
74                 return target.getSequence();
75             }
76             public void setValue( java.lang.Object object, java.lang.Object value) 
77                 throws IllegalStateException, IllegalArgumentException
78             {
79                 try {
80                     MappingChoice target = (MappingChoice) object;
81                     target.setSequence( (jalview.schemabinding.version2.Sequence) value);
82                 } catch (java.lang.Exception ex) {
83                     throw new IllegalStateException(ex.toString());
84                 }
85             }
86             public java.lang.Object newInstance(java.lang.Object parent) {
87                 return new jalview.schemabinding.version2.Sequence();
88             }
89         };
90         desc.setHandler(handler);
91         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
92         desc.setMultivalued(false);
93         addFieldDescriptor(desc);
94         
95         //-- validation code for: _sequence
96         fieldValidator = new org.exolab.castor.xml.FieldValidator();
97         { //-- local scope
98         }
99         desc.setValidator(fieldValidator);
100         //-- _dseqFor
101         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dseqFor", "dseqFor", org.exolab.castor.xml.NodeType.Element);
102         desc.setImmutable(true);
103         handler = new org.exolab.castor.xml.XMLFieldHandler() {
104             public java.lang.Object getValue( java.lang.Object object ) 
105                 throws IllegalStateException
106             {
107                 MappingChoice target = (MappingChoice) object;
108                 return target.getDseqFor();
109             }
110             public void setValue( java.lang.Object object, java.lang.Object value) 
111                 throws IllegalStateException, IllegalArgumentException
112             {
113                 try {
114                     MappingChoice target = (MappingChoice) object;
115                     target.setDseqFor( (java.lang.String) value);
116                 } catch (java.lang.Exception ex) {
117                     throw new IllegalStateException(ex.toString());
118                 }
119             }
120             public java.lang.Object newInstance(java.lang.Object parent) {
121                 return null;
122             }
123         };
124         desc.setHandler(handler);
125         desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
126         desc.setMultivalued(false);
127         addFieldDescriptor(desc);
128         
129         //-- validation code for: _dseqFor
130         fieldValidator = new org.exolab.castor.xml.FieldValidator();
131         { //-- local scope
132             org.exolab.castor.xml.validators.StringValidator typeValidator;
133             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
134             fieldValidator.setValidator(typeValidator);
135             typeValidator.setWhiteSpace("preserve");
136         }
137         desc.setValidator(fieldValidator);
138     }
139
140
141       //-----------/
142      //- Methods -/
143     //-----------/
144
145     /**
146      * Method getAccessMode.
147      * 
148      * @return the access mode specified for this class.
149      */
150     public org.exolab.castor.mapping.AccessMode getAccessMode(
151     ) {
152         return null;
153     }
154
155     /**
156      * Method getIdentity.
157      * 
158      * @return the identity field, null if this class has no
159      * identity.
160      */
161     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
162     ) {
163         return super.getIdentity();
164     }
165
166     /**
167      * Method getJavaClass.
168      * 
169      * @return the Java class represented by this descriptor.
170      */
171     public java.lang.Class getJavaClass(
172     ) {
173         return jalview.schemabinding.version2.MappingChoice.class;
174     }
175
176     /**
177      * Method getNameSpacePrefix.
178      * 
179      * @return the namespace prefix to use when marshaling as XML.
180      */
181     public java.lang.String getNameSpacePrefix(
182     ) {
183         return _nsPrefix;
184     }
185
186     /**
187      * Method getNameSpaceURI.
188      * 
189      * @return the namespace URI used when marshaling and
190      * unmarshaling as XML.
191      */
192     public java.lang.String getNameSpaceURI(
193     ) {
194         return _nsURI;
195     }
196
197     /**
198      * Method getValidator.
199      * 
200      * @return a specific validator for the class described by this
201      * ClassDescriptor.
202      */
203     public org.exolab.castor.xml.TypeValidator getValidator(
204     ) {
205         return this;
206     }
207
208     /**
209      * Method getXMLName.
210      * 
211      * @return the XML Name for the Class being described.
212      */
213     public java.lang.String getXMLName(
214     ) {
215         return _xmlName;
216     }
217
218     /**
219      * Method isElementDefinition.
220      * 
221      * @return true if XML schema definition of this Class is that
222      * of a global
223      * element or element with anonymous type definition.
224      */
225     public boolean isElementDefinition(
226     ) {
227         return _elementDefinition;
228     }
229
230 }