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