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