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;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import org.exolab.castor.xml.Marshaller;
34 import org.exolab.castor.xml.Unmarshaller;
37 * Class WebServiceParameterSet.
39 * @version $Revision$ $Date$
41 public class WebServiceParameterSet implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
49 * The short name for the parameter set. This will be shown amongst the other
50 * presets for the web service.
53 private java.lang.String _name;
56 * A Jalview Web Service Parameter Set container version number. Version 1
57 * created for storing Jaba user presets.
60 private java.lang.String _version;
63 * Short description - as utf8 encoded text. This is usually displayed in the
64 * body of an HTML capable tooltip, so HTML tags may be embedded using
65 * standard UTF8 encoding.
68 private java.lang.String _description;
71 * URL for which the parameter set is valid. Jalview will use it to match up
72 * parameter sets to service instances that can parse the parameter set
76 private java.util.Vector _serviceURLList;
79 * UTF8 encoded string to be processed into a specific web services' parameter
80 * set. Note - newlines may be important to the structure of this file.
83 private java.lang.String _parameters;
89 public WebServiceParameterSet()
92 this._serviceURLList = new java.util.Vector();
103 * @throws java.lang.IndexOutOfBoundsException
104 * if the index given is outside the bounds of the collection
106 public void addServiceURL(final java.lang.String vServiceURL)
107 throws java.lang.IndexOutOfBoundsException
109 this._serviceURLList.addElement(vServiceURL);
117 * @throws java.lang.IndexOutOfBoundsException
118 * if the index given is outside the bounds of the collection
120 public void addServiceURL(final int index,
121 final java.lang.String vServiceURL)
122 throws java.lang.IndexOutOfBoundsException
124 this._serviceURLList.add(index, vServiceURL);
128 * Method enumerateServiceURL.
130 * @return an Enumeration over all java.lang.String elements
132 public java.util.Enumeration enumerateServiceURL()
134 return this._serviceURLList.elements();
138 * Returns the value of field 'description'. The field 'description' has the
139 * following description: Short description - as utf8 encoded text. This is
140 * usually displayed in the body of an HTML capable tooltip, so HTML tags may
141 * be embedded using standard UTF8 encoding.
144 * @return the value of field 'Description'.
146 public java.lang.String getDescription()
148 return this._description;
152 * Returns the value of field 'name'. The field 'name' has the following
153 * description: The short name for the parameter set. This will be shown
154 * amongst the other presets for the web service.
157 * @return the value of field 'Name'.
159 public java.lang.String getName()
165 * Returns the value of field 'parameters'. The field 'parameters' has the
166 * following description: UTF8 encoded string to be processed into a specific
167 * web services' parameter set. Note - newlines may be important to the
168 * structure of this file.
171 * @return the value of field 'Parameters'.
173 public java.lang.String getParameters()
175 return this._parameters;
179 * Method getServiceURL.
182 * @throws java.lang.IndexOutOfBoundsException
183 * if the index given is outside the bounds of the collection
184 * @return the value of the java.lang.String at the given index
186 public java.lang.String getServiceURL(final int index)
187 throws java.lang.IndexOutOfBoundsException
189 // check bounds for index
190 if (index < 0 || index >= this._serviceURLList.size())
192 throw new IndexOutOfBoundsException("getServiceURL: Index value '"
193 + index + "' not in range [0.."
194 + (this._serviceURLList.size() - 1) + "]");
197 return (java.lang.String) _serviceURLList.get(index);
201 * Method getServiceURL.Returns the contents of the collection in an Array.
203 * Note: Just in case the collection contents are changing in another thread,
204 * we pass a 0-length Array of the correct type into the API call. This way we
205 * <i>know</i> that the Array returned is of exactly the correct length.
207 * @return this collection as an Array
209 public java.lang.String[] getServiceURL()
211 java.lang.String[] array = new java.lang.String[0];
212 return (java.lang.String[]) this._serviceURLList.toArray(array);
216 * Method getServiceURLCount.
218 * @return the size of this collection
220 public int getServiceURLCount()
222 return this._serviceURLList.size();
226 * Returns the value of field 'version'. The field 'version' has the following
227 * description: A Jalview Web Service Parameter Set container version number.
228 * Version 1 created for storing Jaba user presets.
231 * @return the value of field 'Version'.
233 public java.lang.String getVersion()
235 return this._version;
241 * @return true if this object is valid according to the schema
243 public boolean isValid()
248 } catch (org.exolab.castor.xml.ValidationException vex)
259 * @throws org.exolab.castor.xml.MarshalException
260 * if object is null or if any SAXException is thrown during
262 * @throws org.exolab.castor.xml.ValidationException
263 * if this object is an invalid instance according to the schema
265 public void marshal(final java.io.Writer out)
266 throws org.exolab.castor.xml.MarshalException,
267 org.exolab.castor.xml.ValidationException
269 Marshaller.marshal(this, out);
276 * @throws java.io.IOException
277 * if an IOException occurs during marshaling
278 * @throws org.exolab.castor.xml.ValidationException
279 * if this object is an invalid instance according to the schema
280 * @throws org.exolab.castor.xml.MarshalException
281 * if object is null or if any SAXException is thrown during
284 public void marshal(final org.xml.sax.ContentHandler handler)
285 throws java.io.IOException,
286 org.exolab.castor.xml.MarshalException,
287 org.exolab.castor.xml.ValidationException
289 Marshaller.marshal(this, handler);
294 public void removeAllServiceURL()
296 this._serviceURLList.clear();
300 * Method removeServiceURL.
303 * @return true if the object was removed from the collection.
305 public boolean removeServiceURL(final java.lang.String vServiceURL)
307 boolean removed = _serviceURLList.remove(vServiceURL);
312 * Method removeServiceURLAt.
315 * @return the element removed from the collection
317 public java.lang.String removeServiceURLAt(final int index)
319 java.lang.Object obj = this._serviceURLList.remove(index);
320 return (java.lang.String) obj;
324 * Sets the value of field 'description'. The field 'description' has the
325 * following description: Short description - as utf8 encoded text. This is
326 * usually displayed in the body of an HTML capable tooltip, so HTML tags may
327 * be embedded using standard UTF8 encoding.
331 * the value of field 'description'.
333 public void setDescription(final java.lang.String description)
335 this._description = description;
339 * Sets the value of field 'name'. The field 'name' has the following
340 * description: The short name for the parameter set. This will be shown
341 * amongst the other presets for the web service.
345 * the value of field 'name'.
347 public void setName(final java.lang.String name)
353 * Sets the value of field 'parameters'. The field 'parameters' has the
354 * following description: UTF8 encoded string to be processed into a specific
355 * web services' parameter set. Note - newlines may be important to the
356 * structure of this file.
360 * the value of field 'parameters'.
362 public void setParameters(final java.lang.String parameters)
364 this._parameters = parameters;
372 * @throws java.lang.IndexOutOfBoundsException
373 * if the index given is outside the bounds of the collection
375 public void setServiceURL(final int index,
376 final java.lang.String vServiceURL)
377 throws java.lang.IndexOutOfBoundsException
379 // check bounds for index
380 if (index < 0 || index >= this._serviceURLList.size())
382 throw new IndexOutOfBoundsException("setServiceURL: Index value '"
383 + index + "' not in range [0.."
384 + (this._serviceURLList.size() - 1) + "]");
387 this._serviceURLList.set(index, vServiceURL);
393 * @param vServiceURLArray
395 public void setServiceURL(final java.lang.String[] vServiceURLArray)
398 _serviceURLList.clear();
400 for (int i = 0; i < vServiceURLArray.length; i++)
402 this._serviceURLList.add(vServiceURLArray[i]);
407 * Sets the value of field 'version'. The field 'version' has the following
408 * description: A Jalview Web Service Parameter Set container version number.
409 * Version 1 created for storing Jaba user presets.
413 * the value of field 'version'.
415 public void setVersion(final java.lang.String version)
417 this._version = version;
424 * @throws org.exolab.castor.xml.MarshalException
425 * if object is null or if any SAXException is thrown during
427 * @throws org.exolab.castor.xml.ValidationException
428 * if this object is an invalid instance according to the schema
429 * @return the unmarshaled
430 * jalview.schemabinding.version2.WebServiceParameterSet
432 public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
433 final java.io.Reader reader)
434 throws org.exolab.castor.xml.MarshalException,
435 org.exolab.castor.xml.ValidationException
437 return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller
439 jalview.schemabinding.version2.WebServiceParameterSet.class,
446 * @throws org.exolab.castor.xml.ValidationException
447 * if this object is an invalid instance according to the schema
449 public void validate() throws org.exolab.castor.xml.ValidationException
451 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
452 validator.validate(this);