update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / WebServiceParameterSet.java
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
4  *
5  * This file is part of Jalview.
6  *
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.
10  *
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.
15  *
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
33
34 /**
35  * Class WebServiceParameterSet.
36  * 
37  * @version $Revision$ $Date$
38  */
39 public class WebServiceParameterSet implements java.io.Serializable {
40
41
42       //--------------------------/
43      //- Class/Member Variables -/
44     //--------------------------/
45
46     /**
47      * The short name for the parameter set. This will be shown
48      * amongst the
49      *  other presets for the web service.
50      *  
51      */
52     private java.lang.String _name;
53
54     /**
55      * A Jalview Web Service Parameter Set container
56      *  version number.
57      *  Version 1 created for storing Jaba user presets.
58      *  
59      */
60     private java.lang.String _version;
61
62     /**
63      * Short description - as utf8 encoded text. This is
64      *  usually displayed
65      *  in the body of an HTML capable tooltip, so HTML tags may be
66      * embedded
67      *  using standard UTF8 encoding.
68      *  
69      */
70     private java.lang.String _description;
71
72     /**
73      * URL for which the parameter set is valid. Jalview will use
74      * it to
75      *  match up parameter sets to service instances that can parse
76      * the
77      *  parameter set payload.
78      *  
79      */
80     private java.util.Vector _serviceURLList;
81
82     /**
83      * UTF8 encoded string to be processed into a specific web
84      * services'
85      *  parameter set. Note - newlines may be important to the
86      * structure
87      *  of this file.
88      *  
89      */
90     private java.lang.String _parameters;
91
92
93       //----------------/
94      //- Constructors -/
95     //----------------/
96
97     public WebServiceParameterSet() {
98         super();
99         this._serviceURLList = new java.util.Vector();
100     }
101
102
103       //-----------/
104      //- Methods -/
105     //-----------/
106
107     /**
108      * 
109      * 
110      * @param vServiceURL
111      * @throws java.lang.IndexOutOfBoundsException if the index
112      * given is outside the bounds of the collection
113      */
114     public void addServiceURL(
115             final java.lang.String vServiceURL)
116     throws java.lang.IndexOutOfBoundsException {
117         this._serviceURLList.addElement(vServiceURL);
118     }
119
120     /**
121      * 
122      * 
123      * @param index
124      * @param vServiceURL
125      * @throws java.lang.IndexOutOfBoundsException if the index
126      * given is outside the bounds of the collection
127      */
128     public void addServiceURL(
129             final int index,
130             final java.lang.String vServiceURL)
131     throws java.lang.IndexOutOfBoundsException {
132         this._serviceURLList.add(index, vServiceURL);
133     }
134
135     /**
136      * Method enumerateServiceURL.
137      * 
138      * @return an Enumeration over all java.lang.String elements
139      */
140     public java.util.Enumeration enumerateServiceURL(
141     ) {
142         return this._serviceURLList.elements();
143     }
144
145     /**
146      * Returns the value of field 'description'. The field
147      * 'description' has the following description: Short
148      * description - as utf8 encoded text. This is
149      *  usually displayed
150      *  in the body of an HTML capable tooltip, so HTML tags may be
151      * embedded
152      *  using standard UTF8 encoding.
153      *  
154      * 
155      * @return the value of field 'Description'.
156      */
157     public java.lang.String getDescription(
158     ) {
159         return this._description;
160     }
161
162     /**
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.
167      *  
168      * 
169      * @return the value of field 'Name'.
170      */
171     public java.lang.String getName(
172     ) {
173         return this._name;
174     }
175
176     /**
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
181      * structure
182      *  of this file.
183      *  
184      * 
185      * @return the value of field 'Parameters'.
186      */
187     public java.lang.String getParameters(
188     ) {
189         return this._parameters;
190     }
191
192     /**
193      * Method getServiceURL.
194      * 
195      * @param index
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
199      */
200     public java.lang.String getServiceURL(
201             final int index)
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) + "]");
206         }
207         
208         return (java.lang.String) _serviceURLList.get(index);
209     }
210
211     /**
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.
217      * 
218      * @return this collection as an Array
219      */
220     public java.lang.String[] getServiceURL(
221     ) {
222         java.lang.String[] array = new java.lang.String[0];
223         return (java.lang.String[]) this._serviceURLList.toArray(array);
224     }
225
226     /**
227      * Method getServiceURLCount.
228      * 
229      * @return the size of this collection
230      */
231     public int getServiceURLCount(
232     ) {
233         return this._serviceURLList.size();
234     }
235
236     /**
237      * Returns the value of field 'version'. The field 'version'
238      * has the following description: A Jalview Web Service
239      * Parameter Set container
240      *  version number.
241      *  Version 1 created for storing Jaba user presets.
242      *  
243      * 
244      * @return the value of field 'Version'.
245      */
246     public java.lang.String getVersion(
247     ) {
248         return this._version;
249     }
250
251     /**
252      * Method isValid.
253      * 
254      * @return true if this object is valid according to the schema
255      */
256     public boolean isValid(
257     ) {
258         try {
259             validate();
260         } catch (org.exolab.castor.xml.ValidationException vex) {
261             return false;
262         }
263         return true;
264     }
265
266     /**
267      * 
268      * 
269      * @param out
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
274      */
275     public void marshal(
276             final java.io.Writer out)
277     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
278         Marshaller.marshal(this, out);
279     }
280
281     /**
282      * 
283      * 
284      * @param handler
285      * @throws java.io.IOException if an IOException occurs during
286      * marshaling
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
291      */
292     public void marshal(
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);
296     }
297
298     /**
299      */
300     public void removeAllServiceURL(
301     ) {
302         this._serviceURLList.clear();
303     }
304
305     /**
306      * Method removeServiceURL.
307      * 
308      * @param vServiceURL
309      * @return true if the object was removed from the collection.
310      */
311     public boolean removeServiceURL(
312             final java.lang.String vServiceURL) {
313         boolean removed = _serviceURLList.remove(vServiceURL);
314         return removed;
315     }
316
317     /**
318      * Method removeServiceURLAt.
319      * 
320      * @param index
321      * @return the element removed from the collection
322      */
323     public java.lang.String removeServiceURLAt(
324             final int index) {
325         java.lang.Object obj = this._serviceURLList.remove(index);
326         return (java.lang.String) obj;
327     }
328
329     /**
330      * Sets the value of field 'description'. The field
331      * 'description' has the following description: Short
332      * description - as utf8 encoded text. This is
333      *  usually displayed
334      *  in the body of an HTML capable tooltip, so HTML tags may be
335      * embedded
336      *  using standard UTF8 encoding.
337      *  
338      * 
339      * @param description the value of field 'description'.
340      */
341     public void setDescription(
342             final java.lang.String description) {
343         this._description = description;
344     }
345
346     /**
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.
351      *  
352      * 
353      * @param name the value of field 'name'.
354      */
355     public void setName(
356             final java.lang.String name) {
357         this._name = name;
358     }
359
360     /**
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
365      * structure
366      *  of this file.
367      *  
368      * 
369      * @param parameters the value of field 'parameters'.
370      */
371     public void setParameters(
372             final java.lang.String parameters) {
373         this._parameters = parameters;
374     }
375
376     /**
377      * 
378      * 
379      * @param index
380      * @param vServiceURL
381      * @throws java.lang.IndexOutOfBoundsException if the index
382      * given is outside the bounds of the collection
383      */
384     public void setServiceURL(
385             final int index,
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) + "]");
391         }
392         
393         this._serviceURLList.set(index, vServiceURL);
394     }
395
396     /**
397      * 
398      * 
399      * @param vServiceURLArray
400      */
401     public void setServiceURL(
402             final java.lang.String[] vServiceURLArray) {
403         //-- copy array
404         _serviceURLList.clear();
405         
406         for (int i = 0; i < vServiceURLArray.length; i++) {
407                 this._serviceURLList.add(vServiceURLArray[i]);
408         }
409     }
410
411     /**
412      * Sets the value of field 'version'. The field 'version' has
413      * the following description: A Jalview Web Service Parameter
414      * Set container
415      *  version number.
416      *  Version 1 created for storing Jaba user presets.
417      *  
418      * 
419      * @param version the value of field 'version'.
420      */
421     public void setVersion(
422             final java.lang.String version) {
423         this._version = version;
424     }
425
426     /**
427      * Method unmarshal.
428      * 
429      * @param reader
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
436      */
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);
441     }
442
443     /**
444      * 
445      * 
446      * @throws org.exolab.castor.xml.ValidationException if this
447      * object is an invalid instance according to the schema
448      */
449     public void validate(
450     )
451     throws org.exolab.castor.xml.ValidationException {
452         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
453         validator.validate(this);
454     }
455
456 }