1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
35 * Class WebServiceParameterSet.
37 * @version $Revision$ $Date$
39 public class WebServiceParameterSet implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
47 * The short name for the parameter set. This will be shown
49 * other presets for the web service.
52 private java.lang.String _name;
55 * A Jalview Web Service Parameter Set container
57 * Version 1 created for storing Jaba user presets.
60 private java.lang.String _version;
63 * Short description - as utf8 encoded text. This is
65 * in the body of an HTML capable tooltip, so HTML tags may be
67 * using standard UTF8 encoding.
70 private java.lang.String _description;
73 * URL for which the parameter set is valid. Jalview will use
75 * match up parameter sets to service instances that can parse
77 * parameter set payload.
80 private java.util.Vector _serviceURLList;
83 * UTF8 encoded string to be processed into a specific web
85 * parameter set. Note - newlines may be important to the
90 private java.lang.String _parameters;
97 public WebServiceParameterSet() {
99 this._serviceURLList = new java.util.Vector();
111 * @throws java.lang.IndexOutOfBoundsException if the index
112 * given is outside the bounds of the collection
114 public void addServiceURL(
115 final java.lang.String vServiceURL)
116 throws java.lang.IndexOutOfBoundsException {
117 this._serviceURLList.addElement(vServiceURL);
125 * @throws java.lang.IndexOutOfBoundsException if the index
126 * given is outside the bounds of the collection
128 public void addServiceURL(
130 final java.lang.String vServiceURL)
131 throws java.lang.IndexOutOfBoundsException {
132 this._serviceURLList.add(index, vServiceURL);
136 * Method enumerateServiceURL.
138 * @return an Enumeration over all java.lang.String elements
140 public java.util.Enumeration enumerateServiceURL(
142 return this._serviceURLList.elements();
146 * Returns the value of field 'description'. The field
147 * 'description' has the following description: Short
148 * description - as utf8 encoded text. This is
150 * in the body of an HTML capable tooltip, so HTML tags may be
152 * using standard UTF8 encoding.
155 * @return the value of field 'Description'.
157 public java.lang.String getDescription(
159 return this._description;
163 * Returns the value of field 'name'. The field 'name' has the
164 * following description: The short name for the parameter set.
165 * This will be shown amongst the
166 * other presets for the web service.
169 * @return the value of field 'Name'.
171 public java.lang.String getName(
177 * Returns the value of field 'parameters'. The field
178 * 'parameters' has the following description: UTF8 encoded
179 * string to be processed into a specific web services'
180 * parameter set. Note - newlines may be important to the
185 * @return the value of field 'Parameters'.
187 public java.lang.String getParameters(
189 return this._parameters;
193 * Method getServiceURL.
196 * @throws java.lang.IndexOutOfBoundsException if the index
197 * given is outside the bounds of the collection
198 * @return the value of the java.lang.String at the given index
200 public java.lang.String getServiceURL(
202 throws java.lang.IndexOutOfBoundsException {
203 // check bounds for index
204 if (index < 0 || index >= this._serviceURLList.size()) {
205 throw new IndexOutOfBoundsException("getServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
208 return (java.lang.String) _serviceURLList.get(index);
212 * Method getServiceURL.Returns the contents of the collection
213 * in an Array. <p>Note: Just in case the collection contents
214 * are changing in another thread, we pass a 0-length Array of
215 * the correct type into the API call. This way we <i>know</i>
216 * that the Array returned is of exactly the correct length.
218 * @return this collection as an Array
220 public java.lang.String[] getServiceURL(
222 java.lang.String[] array = new java.lang.String[0];
223 return (java.lang.String[]) this._serviceURLList.toArray(array);
227 * Method getServiceURLCount.
229 * @return the size of this collection
231 public int getServiceURLCount(
233 return this._serviceURLList.size();
237 * Returns the value of field 'version'. The field 'version'
238 * has the following description: A Jalview Web Service
239 * Parameter Set container
241 * Version 1 created for storing Jaba user presets.
244 * @return the value of field 'Version'.
246 public java.lang.String getVersion(
248 return this._version;
254 * @return true if this object is valid according to the schema
256 public boolean isValid(
260 } catch (org.exolab.castor.xml.ValidationException vex) {
270 * @throws org.exolab.castor.xml.MarshalException if object is
271 * null or if any SAXException is thrown during marshaling
272 * @throws org.exolab.castor.xml.ValidationException if this
273 * object is an invalid instance according to the schema
276 final java.io.Writer out)
277 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
278 Marshaller.marshal(this, out);
285 * @throws java.io.IOException if an IOException occurs during
287 * @throws org.exolab.castor.xml.ValidationException if this
288 * object is an invalid instance according to the schema
289 * @throws org.exolab.castor.xml.MarshalException if object is
290 * null or if any SAXException is thrown during marshaling
293 final org.xml.sax.ContentHandler handler)
294 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
295 Marshaller.marshal(this, handler);
300 public void removeAllServiceURL(
302 this._serviceURLList.clear();
306 * Method removeServiceURL.
309 * @return true if the object was removed from the collection.
311 public boolean removeServiceURL(
312 final java.lang.String vServiceURL) {
313 boolean removed = _serviceURLList.remove(vServiceURL);
318 * Method removeServiceURLAt.
321 * @return the element removed from the collection
323 public java.lang.String removeServiceURLAt(
325 java.lang.Object obj = this._serviceURLList.remove(index);
326 return (java.lang.String) obj;
330 * Sets the value of field 'description'. The field
331 * 'description' has the following description: Short
332 * description - as utf8 encoded text. This is
334 * in the body of an HTML capable tooltip, so HTML tags may be
336 * using standard UTF8 encoding.
339 * @param description the value of field 'description'.
341 public void setDescription(
342 final java.lang.String description) {
343 this._description = description;
347 * Sets the value of field 'name'. The field 'name' has the
348 * following description: The short name for the parameter set.
349 * This will be shown amongst the
350 * other presets for the web service.
353 * @param name the value of field 'name'.
356 final java.lang.String name) {
361 * Sets the value of field 'parameters'. The field 'parameters'
362 * has the following description: UTF8 encoded string to be
363 * processed into a specific web services'
364 * parameter set. Note - newlines may be important to the
369 * @param parameters the value of field 'parameters'.
371 public void setParameters(
372 final java.lang.String parameters) {
373 this._parameters = parameters;
381 * @throws java.lang.IndexOutOfBoundsException if the index
382 * given is outside the bounds of the collection
384 public void setServiceURL(
386 final java.lang.String vServiceURL)
387 throws java.lang.IndexOutOfBoundsException {
388 // check bounds for index
389 if (index < 0 || index >= this._serviceURLList.size()) {
390 throw new IndexOutOfBoundsException("setServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
393 this._serviceURLList.set(index, vServiceURL);
399 * @param vServiceURLArray
401 public void setServiceURL(
402 final java.lang.String[] vServiceURLArray) {
404 _serviceURLList.clear();
406 for (int i = 0; i < vServiceURLArray.length; i++) {
407 this._serviceURLList.add(vServiceURLArray[i]);
412 * Sets the value of field 'version'. The field 'version' has
413 * the following description: A Jalview Web Service Parameter
416 * Version 1 created for storing Jaba user presets.
419 * @param version the value of field 'version'.
421 public void setVersion(
422 final java.lang.String version) {
423 this._version = version;
430 * @throws org.exolab.castor.xml.MarshalException if object is
431 * null or if any SAXException is thrown during marshaling
432 * @throws org.exolab.castor.xml.ValidationException if this
433 * object is an invalid instance according to the schema
434 * @return the unmarshaled
435 * jalview.schemabinding.version2.WebServiceParameterSet
437 public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
438 final java.io.Reader reader)
439 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
440 return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.WebServiceParameterSet.class, reader);
446 * @throws org.exolab.castor.xml.ValidationException if this
447 * object is an invalid instance according to the schema
449 public void validate(
451 throws org.exolab.castor.xml.ValidationException {
452 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
453 validator.validate(this);