1d57dd5e6596f5486d16b77193277a09a5cf1617
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / MappingChoiceDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  
17  * If not, see <http://www.gnu.org/licenses/>.
18  * The Jalview Authors are detailed in the 'AUTHORS' file.
19  ******************************************************************************/
20 /*
21  * This class was automatically generated with 
22  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
23  * Schema.
24  * $Id$
25  */
26
27 package jalview.schemabinding.version2.descriptors;
28
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
32
33 import jalview.schemabinding.version2.MappingChoice;
34
35 /**
36  * Class MappingChoiceDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class MappingChoiceDescriptor extends
41         org.exolab.castor.xml.util.XMLClassDescriptorImpl
42 {
43
44   // --------------------------/
45   // - Class/Member Variables -/
46   // --------------------------/
47
48   /**
49    * Field _elementDefinition.
50    */
51   private boolean _elementDefinition;
52
53   /**
54    * Field _nsPrefix.
55    */
56   private java.lang.String _nsPrefix;
57
58   /**
59    * Field _nsURI.
60    */
61   private java.lang.String _nsURI;
62
63   /**
64    * Field _xmlName.
65    */
66   private java.lang.String _xmlName;
67
68   // ----------------/
69   // - Constructors -/
70   // ----------------/
71
72   public MappingChoiceDescriptor()
73   {
74     super();
75     _nsURI = "www.vamsas.ac.uk/jalview/version2";
76     _elementDefinition = false;
77
78     // -- set grouping compositor
79     setCompositorAsChoice();
80     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
81     org.exolab.castor.mapping.FieldHandler handler = null;
82     org.exolab.castor.xml.FieldValidator fieldValidator = null;
83     // -- initialize attribute descriptors
84
85     // -- initialize element descriptors
86
87     // -- _sequence
88     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
89             jalview.schemabinding.version2.Sequence.class, "_sequence",
90             "Sequence", org.exolab.castor.xml.NodeType.Element);
91     handler = new org.exolab.castor.xml.XMLFieldHandler()
92     {
93       public java.lang.Object getValue(java.lang.Object object)
94               throws IllegalStateException
95       {
96         MappingChoice target = (MappingChoice) object;
97         return target.getSequence();
98       }
99
100       public void setValue(java.lang.Object object, java.lang.Object value)
101               throws IllegalStateException, IllegalArgumentException
102       {
103         try
104         {
105           MappingChoice target = (MappingChoice) object;
106           target.setSequence((jalview.schemabinding.version2.Sequence) value);
107         } catch (java.lang.Exception ex)
108         {
109           throw new IllegalStateException(ex.toString());
110         }
111       }
112
113       public java.lang.Object newInstance(java.lang.Object parent)
114       {
115         return new jalview.schemabinding.version2.Sequence();
116       }
117     };
118     desc.setHandler(handler);
119     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
120     desc.setMultivalued(false);
121     addFieldDescriptor(desc);
122
123     // -- validation code for: _sequence
124     fieldValidator = new org.exolab.castor.xml.FieldValidator();
125     { // -- local scope
126     }
127     desc.setValidator(fieldValidator);
128     // -- _dseqFor
129     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
130             java.lang.String.class, "_dseqFor", "dseqFor",
131             org.exolab.castor.xml.NodeType.Element);
132     desc.setImmutable(true);
133     handler = new org.exolab.castor.xml.XMLFieldHandler()
134     {
135       public java.lang.Object getValue(java.lang.Object object)
136               throws IllegalStateException
137       {
138         MappingChoice target = (MappingChoice) object;
139         return target.getDseqFor();
140       }
141
142       public void setValue(java.lang.Object object, java.lang.Object value)
143               throws IllegalStateException, IllegalArgumentException
144       {
145         try
146         {
147           MappingChoice target = (MappingChoice) object;
148           target.setDseqFor((java.lang.String) value);
149         } catch (java.lang.Exception ex)
150         {
151           throw new IllegalStateException(ex.toString());
152         }
153       }
154
155       public java.lang.Object newInstance(java.lang.Object parent)
156       {
157         return null;
158       }
159     };
160     desc.setHandler(handler);
161     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
162     desc.setMultivalued(false);
163     addFieldDescriptor(desc);
164
165     // -- validation code for: _dseqFor
166     fieldValidator = new org.exolab.castor.xml.FieldValidator();
167     { // -- local scope
168       org.exolab.castor.xml.validators.StringValidator typeValidator;
169       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
170       fieldValidator.setValidator(typeValidator);
171       typeValidator.setWhiteSpace("preserve");
172     }
173     desc.setValidator(fieldValidator);
174   }
175
176   // -----------/
177   // - Methods -/
178   // -----------/
179
180   /**
181    * Method getAccessMode.
182    * 
183    * @return the access mode specified for this class.
184    */
185   public org.exolab.castor.mapping.AccessMode getAccessMode()
186   {
187     return null;
188   }
189
190   /**
191    * Method getIdentity.
192    * 
193    * @return the identity field, null if this class has no identity.
194    */
195   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
196   {
197     return super.getIdentity();
198   }
199
200   /**
201    * Method getJavaClass.
202    * 
203    * @return the Java class represented by this descriptor.
204    */
205   public java.lang.Class getJavaClass()
206   {
207     return jalview.schemabinding.version2.MappingChoice.class;
208   }
209
210   /**
211    * Method getNameSpacePrefix.
212    * 
213    * @return the namespace prefix to use when marshaling as XML.
214    */
215   public java.lang.String getNameSpacePrefix()
216   {
217     return _nsPrefix;
218   }
219
220   /**
221    * Method getNameSpaceURI.
222    * 
223    * @return the namespace URI used when marshaling and unmarshaling as XML.
224    */
225   public java.lang.String getNameSpaceURI()
226   {
227     return _nsURI;
228   }
229
230   /**
231    * Method getValidator.
232    * 
233    * @return a specific validator for the class described by this
234    *         ClassDescriptor.
235    */
236   public org.exolab.castor.xml.TypeValidator getValidator()
237   {
238     return this;
239   }
240
241   /**
242    * Method getXMLName.
243    * 
244    * @return the XML Name for the Class being described.
245    */
246   public java.lang.String getXMLName()
247   {
248     return _xmlName;
249   }
250
251   /**
252    * Method isElementDefinition.
253    * 
254    * @return true if XML schema definition of this Class is that of a global
255    *         element or element with anonymous type definition.
256    */
257   public boolean isElementDefinition()
258   {
259     return _elementDefinition;
260   }
261
262 }