2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
18 * Class WebServiceParameterSet.
20 * @version $Revision$ $Date$
22 public class WebServiceParameterSet implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * The short name for the parameter set. This will be shown amongst the other
31 * presets for the web service.
34 private java.lang.String _name;
37 * A Jalview Web Service Parameter Set container version number. Version 1
38 * created for storing Jaba user presets.
41 private java.lang.String _version;
44 * Short description - as utf8 encoded text. This is usually displayed in the
45 * body of an HTML capable tooltip, so HTML tags may be embedded using
46 * standard UTF8 encoding.
49 private java.lang.String _description;
52 * URL for which the parameter set is valid. Jalview will use it to match up
53 * parameter sets to service instances that can parse the parameter set
57 private java.util.Vector _serviceURLList;
60 * UTF8 encoded string to be processed into a specific web services' parameter
61 * set. Note - newlines may be important to the structure of this file.
64 private java.lang.String _parameters;
70 public WebServiceParameterSet()
73 this._serviceURLList = new java.util.Vector();
84 * @throws java.lang.IndexOutOfBoundsException
85 * if the index given is outside the bounds of the collection
87 public void addServiceURL(final java.lang.String vServiceURL)
88 throws java.lang.IndexOutOfBoundsException
90 this._serviceURLList.addElement(vServiceURL);
98 * @throws java.lang.IndexOutOfBoundsException
99 * if the index given is outside the bounds of the collection
101 public void addServiceURL(final int index,
102 final java.lang.String vServiceURL)
103 throws java.lang.IndexOutOfBoundsException
105 this._serviceURLList.add(index, vServiceURL);
109 * Method enumerateServiceURL.
111 * @return an Enumeration over all java.lang.String elements
113 public java.util.Enumeration enumerateServiceURL()
115 return this._serviceURLList.elements();
119 * Returns the value of field 'description'. The field 'description' has the
120 * following description: Short description - as utf8 encoded text. This is
121 * usually displayed in the body of an HTML capable tooltip, so HTML tags may
122 * be embedded using standard UTF8 encoding.
125 * @return the value of field 'Description'.
127 public java.lang.String getDescription()
129 return this._description;
133 * Returns the value of field 'name'. The field 'name' has the following
134 * description: The short name for the parameter set. This will be shown
135 * amongst the other presets for the web service.
138 * @return the value of field 'Name'.
140 public java.lang.String getName()
146 * Returns the value of field 'parameters'. The field 'parameters' has the
147 * following description: UTF8 encoded string to be processed into a specific
148 * web services' parameter set. Note - newlines may be important to the
149 * structure of this file.
152 * @return the value of field 'Parameters'.
154 public java.lang.String getParameters()
156 return this._parameters;
160 * Method getServiceURL.
163 * @throws java.lang.IndexOutOfBoundsException
164 * if the index given is outside the bounds of the collection
165 * @return the value of the java.lang.String at the given index
167 public java.lang.String getServiceURL(final int index)
168 throws java.lang.IndexOutOfBoundsException
170 // check bounds for index
171 if (index < 0 || index >= this._serviceURLList.size())
173 throw new IndexOutOfBoundsException("getServiceURL: Index value '"
174 + index + "' not in range [0.."
175 + (this._serviceURLList.size() - 1) + "]");
178 return (java.lang.String) _serviceURLList.get(index);
182 * Method getServiceURL.Returns the contents of the collection in an Array.
184 * Note: Just in case the collection contents are changing in another thread,
185 * we pass a 0-length Array of the correct type into the API call. This way we
186 * <i>know</i> that the Array returned is of exactly the correct length.
188 * @return this collection as an Array
190 public java.lang.String[] getServiceURL()
192 java.lang.String[] array = new java.lang.String[0];
193 return (java.lang.String[]) this._serviceURLList.toArray(array);
197 * Method getServiceURLCount.
199 * @return the size of this collection
201 public int getServiceURLCount()
203 return this._serviceURLList.size();
207 * Returns the value of field 'version'. The field 'version' has the following
208 * description: A Jalview Web Service Parameter Set container version number.
209 * Version 1 created for storing Jaba user presets.
212 * @return the value of field 'Version'.
214 public java.lang.String getVersion()
216 return this._version;
222 * @return true if this object is valid according to the schema
224 public boolean isValid()
229 } catch (org.exolab.castor.xml.ValidationException vex)
240 * @throws org.exolab.castor.xml.MarshalException
241 * if object is null or if any SAXException is thrown during
243 * @throws org.exolab.castor.xml.ValidationException
244 * if this object is an invalid instance according to the schema
246 public void marshal(final java.io.Writer out)
247 throws org.exolab.castor.xml.MarshalException,
248 org.exolab.castor.xml.ValidationException
250 Marshaller.marshal(this, out);
257 * @throws java.io.IOException
258 * if an IOException occurs during marshaling
259 * @throws org.exolab.castor.xml.ValidationException
260 * if this object is an invalid instance according to the schema
261 * @throws org.exolab.castor.xml.MarshalException
262 * if object is null or if any SAXException is thrown during
265 public void marshal(final org.xml.sax.ContentHandler handler)
266 throws java.io.IOException,
267 org.exolab.castor.xml.MarshalException,
268 org.exolab.castor.xml.ValidationException
270 Marshaller.marshal(this, handler);
275 public void removeAllServiceURL()
277 this._serviceURLList.clear();
281 * Method removeServiceURL.
284 * @return true if the object was removed from the collection.
286 public boolean removeServiceURL(final java.lang.String vServiceURL)
288 boolean removed = _serviceURLList.remove(vServiceURL);
293 * Method removeServiceURLAt.
296 * @return the element removed from the collection
298 public java.lang.String removeServiceURLAt(final int index)
300 java.lang.Object obj = this._serviceURLList.remove(index);
301 return (java.lang.String) obj;
305 * Sets the value of field 'description'. The field 'description' has the
306 * following description: Short description - as utf8 encoded text. This is
307 * usually displayed in the body of an HTML capable tooltip, so HTML tags may
308 * be embedded using standard UTF8 encoding.
312 * the value of field 'description'.
314 public void setDescription(final java.lang.String description)
316 this._description = description;
320 * Sets the value of field 'name'. The field 'name' has the following
321 * description: The short name for the parameter set. This will be shown
322 * amongst the other presets for the web service.
326 * the value of field 'name'.
328 public void setName(final java.lang.String name)
334 * Sets the value of field 'parameters'. The field 'parameters' has the
335 * following description: UTF8 encoded string to be processed into a specific
336 * web services' parameter set. Note - newlines may be important to the
337 * structure of this file.
341 * the value of field 'parameters'.
343 public void setParameters(final java.lang.String parameters)
345 this._parameters = parameters;
353 * @throws java.lang.IndexOutOfBoundsException
354 * if the index given is outside the bounds of the collection
356 public void setServiceURL(final int index,
357 final java.lang.String vServiceURL)
358 throws java.lang.IndexOutOfBoundsException
360 // check bounds for index
361 if (index < 0 || index >= this._serviceURLList.size())
363 throw new IndexOutOfBoundsException("setServiceURL: Index value '"
364 + index + "' not in range [0.."
365 + (this._serviceURLList.size() - 1) + "]");
368 this._serviceURLList.set(index, vServiceURL);
374 * @param vServiceURLArray
376 public void setServiceURL(final java.lang.String[] vServiceURLArray)
379 _serviceURLList.clear();
381 for (int i = 0; i < vServiceURLArray.length; i++)
383 this._serviceURLList.add(vServiceURLArray[i]);
388 * Sets the value of field 'version'. The field 'version' has the following
389 * description: A Jalview Web Service Parameter Set container version number.
390 * Version 1 created for storing Jaba user presets.
394 * the value of field 'version'.
396 public void setVersion(final java.lang.String version)
398 this._version = version;
405 * @throws org.exolab.castor.xml.MarshalException
406 * if object is null or if any SAXException is thrown during
408 * @throws org.exolab.castor.xml.ValidationException
409 * if this object is an invalid instance according to the schema
410 * @return the unmarshaled
411 * jalview.schemabinding.version2.WebServiceParameterSet
413 public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
414 final java.io.Reader reader)
415 throws org.exolab.castor.xml.MarshalException,
416 org.exolab.castor.xml.ValidationException
418 return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller
420 jalview.schemabinding.version2.WebServiceParameterSet.class,
427 * @throws org.exolab.castor.xml.ValidationException
428 * if this object is an invalid instance according to the schema
430 public void validate() throws org.exolab.castor.xml.ValidationException
432 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
433 validator.validate(this);