JAL-1620 version bump and release notes
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / CalcIdParamDescriptor.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.CalcIdParam;
28
29 /**
30  * Class CalcIdParamDescriptor.
31  * 
32  * @version $Revision$ $Date$
33  */
34 public class CalcIdParamDescriptor
35         extends
36         jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
37 {
38
39   // --------------------------/
40   // - Class/Member Variables -/
41   // --------------------------/
42
43   /**
44    * Field _elementDefinition.
45    */
46   private boolean _elementDefinition;
47
48   /**
49    * Field _nsPrefix.
50    */
51   private java.lang.String _nsPrefix;
52
53   /**
54    * Field _nsURI.
55    */
56   private java.lang.String _nsURI;
57
58   /**
59    * Field _xmlName.
60    */
61   private java.lang.String _xmlName;
62
63   // ----------------/
64   // - Constructors -/
65   // ----------------/
66
67   public CalcIdParamDescriptor()
68   {
69     super();
70     setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor());
71     _nsURI = "www.jalview.org";
72     _xmlName = "calcIdParam";
73     _elementDefinition = true;
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     // -- _calcId
80     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
81             java.lang.String.class, "_calcId", "calcId",
82             org.exolab.castor.xml.NodeType.Attribute);
83     desc.setImmutable(true);
84     handler = new org.exolab.castor.xml.XMLFieldHandler()
85     {
86       public java.lang.Object getValue(java.lang.Object object)
87               throws IllegalStateException
88       {
89         CalcIdParam target = (CalcIdParam) object;
90         return target.getCalcId();
91       }
92
93       public void setValue(java.lang.Object object, java.lang.Object value)
94               throws IllegalStateException, IllegalArgumentException
95       {
96         try
97         {
98           CalcIdParam target = (CalcIdParam) object;
99           target.setCalcId((java.lang.String) value);
100         } catch (java.lang.Exception ex)
101         {
102           throw new IllegalStateException(ex.toString());
103         }
104       }
105
106       public java.lang.Object newInstance(java.lang.Object parent)
107       {
108         return null;
109       }
110     };
111     desc.setHandler(handler);
112     desc.setRequired(true);
113     desc.setMultivalued(false);
114     addFieldDescriptor(desc);
115
116     // -- validation code for: _calcId
117     fieldValidator = new org.exolab.castor.xml.FieldValidator();
118     fieldValidator.setMinOccurs(1);
119     { // -- local scope
120       org.exolab.castor.xml.validators.StringValidator typeValidator;
121       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
122       fieldValidator.setValidator(typeValidator);
123       typeValidator.setWhiteSpace("preserve");
124     }
125     desc.setValidator(fieldValidator);
126     // -- _needsUpdate
127     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
128             java.lang.Boolean.TYPE, "_needsUpdate", "needsUpdate",
129             org.exolab.castor.xml.NodeType.Attribute);
130     handler = new org.exolab.castor.xml.XMLFieldHandler()
131     {
132       public java.lang.Object getValue(java.lang.Object object)
133               throws IllegalStateException
134       {
135         CalcIdParam target = (CalcIdParam) object;
136         if (!target.hasNeedsUpdate())
137         {
138           return null;
139         }
140         return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE
141                 : java.lang.Boolean.FALSE);
142       }
143
144       public void setValue(java.lang.Object object, java.lang.Object value)
145               throws IllegalStateException, IllegalArgumentException
146       {
147         try
148         {
149           CalcIdParam target = (CalcIdParam) object;
150           // if null, use delete method for optional primitives
151           if (value == null)
152           {
153             target.deleteNeedsUpdate();
154             return;
155           }
156           target.setNeedsUpdate(((java.lang.Boolean) value).booleanValue());
157         } catch (java.lang.Exception ex)
158         {
159           throw new IllegalStateException(ex.toString());
160         }
161       }
162
163       public java.lang.Object newInstance(java.lang.Object parent)
164       {
165         return null;
166       }
167     };
168     desc.setHandler(handler);
169     desc.setMultivalued(false);
170     addFieldDescriptor(desc);
171
172     // -- validation code for: _needsUpdate
173     fieldValidator = new org.exolab.castor.xml.FieldValidator();
174     { // -- local scope
175       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
176       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
177       fieldValidator.setValidator(typeValidator);
178     }
179     desc.setValidator(fieldValidator);
180     // -- _autoUpdate
181     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
182             java.lang.Boolean.TYPE, "_autoUpdate", "autoUpdate",
183             org.exolab.castor.xml.NodeType.Attribute);
184     handler = new org.exolab.castor.xml.XMLFieldHandler()
185     {
186       public java.lang.Object getValue(java.lang.Object object)
187               throws IllegalStateException
188       {
189         CalcIdParam target = (CalcIdParam) object;
190         if (!target.hasAutoUpdate())
191         {
192           return null;
193         }
194         return (target.getAutoUpdate() ? java.lang.Boolean.TRUE
195                 : java.lang.Boolean.FALSE);
196       }
197
198       public void setValue(java.lang.Object object, java.lang.Object value)
199               throws IllegalStateException, IllegalArgumentException
200       {
201         try
202         {
203           CalcIdParam target = (CalcIdParam) object;
204           // ignore null values for non optional primitives
205           if (value == null)
206           {
207             return;
208           }
209
210           target.setAutoUpdate(((java.lang.Boolean) value).booleanValue());
211         } catch (java.lang.Exception ex)
212         {
213           throw new IllegalStateException(ex.toString());
214         }
215       }
216
217       public java.lang.Object newInstance(java.lang.Object parent)
218       {
219         return null;
220       }
221     };
222     desc.setHandler(handler);
223     desc.setRequired(true);
224     desc.setMultivalued(false);
225     addFieldDescriptor(desc);
226
227     // -- validation code for: _autoUpdate
228     fieldValidator = new org.exolab.castor.xml.FieldValidator();
229     fieldValidator.setMinOccurs(1);
230     { // -- local scope
231       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
232       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
233       fieldValidator.setValidator(typeValidator);
234     }
235     desc.setValidator(fieldValidator);
236     // -- initialize element descriptors
237
238   }
239
240   // -----------/
241   // - Methods -/
242   // -----------/
243
244   /**
245    * Method getAccessMode.
246    * 
247    * @return the access mode specified for this class.
248    */
249   public org.exolab.castor.mapping.AccessMode getAccessMode()
250   {
251     return null;
252   }
253
254   /**
255    * Method getIdentity.
256    * 
257    * @return the identity field, null if this class has no identity.
258    */
259   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
260   {
261     return super.getIdentity();
262   }
263
264   /**
265    * Method getJavaClass.
266    * 
267    * @return the Java class represented by this descriptor.
268    */
269   public java.lang.Class getJavaClass()
270   {
271     return jalview.schemabinding.version2.CalcIdParam.class;
272   }
273
274   /**
275    * Method getNameSpacePrefix.
276    * 
277    * @return the namespace prefix to use when marshaling as XML.
278    */
279   public java.lang.String getNameSpacePrefix()
280   {
281     return _nsPrefix;
282   }
283
284   /**
285    * Method getNameSpaceURI.
286    * 
287    * @return the namespace URI used when marshaling and unmarshaling as XML.
288    */
289   public java.lang.String getNameSpaceURI()
290   {
291     return _nsURI;
292   }
293
294   /**
295    * Method getValidator.
296    * 
297    * @return a specific validator for the class described by this
298    *         ClassDescriptor.
299    */
300   public org.exolab.castor.xml.TypeValidator getValidator()
301   {
302     return this;
303   }
304
305   /**
306    * Method getXMLName.
307    * 
308    * @return the XML Name for the Class being described.
309    */
310   public java.lang.String getXMLName()
311   {
312     return _xmlName;
313   }
314
315   /**
316    * Method isElementDefinition.
317    * 
318    * @return true if XML schema definition of this Class is that of a global
319    *         element or element with anonymous type definition.
320    */
321   public boolean isElementDefinition()
322   {
323     return _elementDefinition;
324   }
325
326 }