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