1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2.descriptors;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import jalview.schemabinding.version2.CalcIdParam;
37 * Class CalcIdParamDescriptor.
39 * @version $Revision$ $Date$
41 public class CalcIdParamDescriptor
43 jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
46 // --------------------------/
47 // - Class/Member Variables -/
48 // --------------------------/
51 * Field _elementDefinition.
53 private boolean _elementDefinition;
58 private java.lang.String _nsPrefix;
63 private java.lang.String _nsURI;
68 private java.lang.String _xmlName;
74 public CalcIdParamDescriptor()
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
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()
93 public java.lang.Object getValue(java.lang.Object object)
94 throws IllegalStateException
96 CalcIdParam target = (CalcIdParam) object;
97 return target.getCalcId();
100 public void setValue(java.lang.Object object, java.lang.Object value)
101 throws IllegalStateException, IllegalArgumentException
105 CalcIdParam target = (CalcIdParam) object;
106 target.setCalcId((java.lang.String) value);
107 } catch (java.lang.Exception ex)
109 throw new IllegalStateException(ex.toString());
113 public java.lang.Object newInstance(java.lang.Object parent)
118 desc.setHandler(handler);
119 desc.setRequired(true);
120 desc.setMultivalued(false);
121 addFieldDescriptor(desc);
123 // -- validation code for: _calcId
124 fieldValidator = new org.exolab.castor.xml.FieldValidator();
125 fieldValidator.setMinOccurs(1);
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");
132 desc.setValidator(fieldValidator);
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()
139 public java.lang.Object getValue(java.lang.Object object)
140 throws IllegalStateException
142 CalcIdParam target = (CalcIdParam) object;
143 if (!target.hasNeedsUpdate())
147 return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE
148 : java.lang.Boolean.FALSE);
151 public void setValue(java.lang.Object object, java.lang.Object value)
152 throws IllegalStateException, IllegalArgumentException
156 CalcIdParam target = (CalcIdParam) object;
157 // if null, use delete method for optional primitives
160 target.deleteNeedsUpdate();
163 target.setNeedsUpdate(((java.lang.Boolean) value).booleanValue());
164 } catch (java.lang.Exception ex)
166 throw new IllegalStateException(ex.toString());
170 public java.lang.Object newInstance(java.lang.Object parent)
175 desc.setHandler(handler);
176 desc.setMultivalued(false);
177 addFieldDescriptor(desc);
179 // -- validation code for: _needsUpdate
180 fieldValidator = new org.exolab.castor.xml.FieldValidator();
182 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
183 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
184 fieldValidator.setValidator(typeValidator);
186 desc.setValidator(fieldValidator);
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()
193 public java.lang.Object getValue(java.lang.Object object)
194 throws IllegalStateException
196 CalcIdParam target = (CalcIdParam) object;
197 if (!target.hasAutoUpdate())
201 return (target.getAutoUpdate() ? java.lang.Boolean.TRUE
202 : java.lang.Boolean.FALSE);
205 public void setValue(java.lang.Object object, java.lang.Object value)
206 throws IllegalStateException, IllegalArgumentException
210 CalcIdParam target = (CalcIdParam) object;
211 // ignore null values for non optional primitives
217 target.setAutoUpdate(((java.lang.Boolean) value).booleanValue());
218 } catch (java.lang.Exception ex)
220 throw new IllegalStateException(ex.toString());
224 public java.lang.Object newInstance(java.lang.Object parent)
229 desc.setHandler(handler);
230 desc.setRequired(true);
231 desc.setMultivalued(false);
232 addFieldDescriptor(desc);
234 // -- validation code for: _autoUpdate
235 fieldValidator = new org.exolab.castor.xml.FieldValidator();
236 fieldValidator.setMinOccurs(1);
238 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
239 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
240 fieldValidator.setValidator(typeValidator);
242 desc.setValidator(fieldValidator);
243 // -- initialize element descriptors
252 * Method getAccessMode.
254 * @return the access mode specified for this class.
256 public org.exolab.castor.mapping.AccessMode getAccessMode()
262 * Method getIdentity.
264 * @return the identity field, null if this class has no identity.
266 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
268 return super.getIdentity();
272 * Method getJavaClass.
274 * @return the Java class represented by this descriptor.
276 public java.lang.Class getJavaClass()
278 return jalview.schemabinding.version2.CalcIdParam.class;
282 * Method getNameSpacePrefix.
284 * @return the namespace prefix to use when marshaling as XML.
286 public java.lang.String getNameSpacePrefix()
292 * Method getNameSpaceURI.
294 * @return the namespace URI used when marshaling and unmarshaling as XML.
296 public java.lang.String getNameSpaceURI()
302 * Method getValidator.
304 * @return a specific validator for the class described by this
307 public org.exolab.castor.xml.TypeValidator getValidator()
315 * @return the XML Name for the Class being described.
317 public java.lang.String getXMLName()
323 * Method isElementDefinition.
325 * @return true if XML schema definition of this Class is that of a global
326 * element or element with anonymous type definition.
328 public boolean isElementDefinition()
330 return _elementDefinition;