1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 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 of the License, or (at your option) any later version.
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.
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 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2.descriptors;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import jalview.schemabinding.version2.CalcIdParam;
36 * Class CalcIdParamDescriptor.
38 * @version $Revision$ $Date$
40 public class CalcIdParamDescriptor
42 jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
50 * Field _elementDefinition.
52 private boolean _elementDefinition;
57 private java.lang.String _nsPrefix;
62 private java.lang.String _nsURI;
67 private java.lang.String _xmlName;
73 public CalcIdParamDescriptor()
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
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()
92 public java.lang.Object getValue(java.lang.Object object)
93 throws IllegalStateException
95 CalcIdParam target = (CalcIdParam) object;
96 return target.getCalcId();
99 public void setValue(java.lang.Object object, java.lang.Object value)
100 throws IllegalStateException, IllegalArgumentException
104 CalcIdParam target = (CalcIdParam) object;
105 target.setCalcId((java.lang.String) value);
106 } catch (java.lang.Exception ex)
108 throw new IllegalStateException(ex.toString());
112 public java.lang.Object newInstance(java.lang.Object parent)
117 desc.setHandler(handler);
118 desc.setRequired(true);
119 desc.setMultivalued(false);
120 addFieldDescriptor(desc);
122 // -- validation code for: _calcId
123 fieldValidator = new org.exolab.castor.xml.FieldValidator();
124 fieldValidator.setMinOccurs(1);
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");
131 desc.setValidator(fieldValidator);
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()
138 public java.lang.Object getValue(java.lang.Object object)
139 throws IllegalStateException
141 CalcIdParam target = (CalcIdParam) object;
142 if (!target.hasNeedsUpdate())
146 return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE
147 : java.lang.Boolean.FALSE);
150 public void setValue(java.lang.Object object, java.lang.Object value)
151 throws IllegalStateException, IllegalArgumentException
155 CalcIdParam target = (CalcIdParam) object;
156 // if null, use delete method for optional primitives
159 target.deleteNeedsUpdate();
162 target.setNeedsUpdate(((java.lang.Boolean) value).booleanValue());
163 } catch (java.lang.Exception ex)
165 throw new IllegalStateException(ex.toString());
169 public java.lang.Object newInstance(java.lang.Object parent)
174 desc.setHandler(handler);
175 desc.setMultivalued(false);
176 addFieldDescriptor(desc);
178 // -- validation code for: _needsUpdate
179 fieldValidator = new org.exolab.castor.xml.FieldValidator();
181 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
182 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
183 fieldValidator.setValidator(typeValidator);
185 desc.setValidator(fieldValidator);
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()
192 public java.lang.Object getValue(java.lang.Object object)
193 throws IllegalStateException
195 CalcIdParam target = (CalcIdParam) object;
196 if (!target.hasAutoUpdate())
200 return (target.getAutoUpdate() ? java.lang.Boolean.TRUE
201 : java.lang.Boolean.FALSE);
204 public void setValue(java.lang.Object object, java.lang.Object value)
205 throws IllegalStateException, IllegalArgumentException
209 CalcIdParam target = (CalcIdParam) object;
210 // ignore null values for non optional primitives
216 target.setAutoUpdate(((java.lang.Boolean) value).booleanValue());
217 } catch (java.lang.Exception ex)
219 throw new IllegalStateException(ex.toString());
223 public java.lang.Object newInstance(java.lang.Object parent)
228 desc.setHandler(handler);
229 desc.setRequired(true);
230 desc.setMultivalued(false);
231 addFieldDescriptor(desc);
233 // -- validation code for: _autoUpdate
234 fieldValidator = new org.exolab.castor.xml.FieldValidator();
235 fieldValidator.setMinOccurs(1);
237 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
238 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
239 fieldValidator.setValidator(typeValidator);
241 desc.setValidator(fieldValidator);
242 // -- initialize element descriptors
251 * Method getAccessMode.
253 * @return the access mode specified for this class.
255 public org.exolab.castor.mapping.AccessMode getAccessMode()
261 * Method getIdentity.
263 * @return the identity field, null if this class has no identity.
265 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
267 return super.getIdentity();
271 * Method getJavaClass.
273 * @return the Java class represented by this descriptor.
275 public java.lang.Class getJavaClass()
277 return jalview.schemabinding.version2.CalcIdParam.class;
281 * Method getNameSpacePrefix.
283 * @return the namespace prefix to use when marshaling as XML.
285 public java.lang.String getNameSpacePrefix()
291 * Method getNameSpaceURI.
293 * @return the namespace URI used when marshaling and unmarshaling as XML.
295 public java.lang.String getNameSpaceURI()
301 * Method getValidator.
303 * @return a specific validator for the class described by this
306 public org.exolab.castor.xml.TypeValidator getValidator()
314 * @return the XML Name for the Class being described.
316 public java.lang.String getXMLName()
322 * Method isElementDefinition.
324 * @return true if XML schema definition of this Class is that of a global
325 * element or element with anonymous type definition.
327 public boolean isElementDefinition()
329 return _elementDefinition;