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