JAL-3139 check group visibility when removing 'redundant' features
[jalview.git] / src / jalview / schemabinding / version2 / WebServiceParameterSet.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class WebServiceParameterSet.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class WebServiceParameterSet implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * The short name for the parameter set. This will be shown amongst the other
31    * presets for the web service.
32    * 
33    */
34   private java.lang.String _name;
35
36   /**
37    * A Jalview Web Service Parameter Set container version number. Version 1
38    * created for storing Jaba user presets.
39    * 
40    */
41   private java.lang.String _version;
42
43   /**
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.
47    * 
48    */
49   private java.lang.String _description;
50
51   /**
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
54    * payload.
55    * 
56    */
57   private java.util.Vector _serviceURLList;
58
59   /**
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.
62    * 
63    */
64   private java.lang.String _parameters;
65
66   // ----------------/
67   // - Constructors -/
68   // ----------------/
69
70   public WebServiceParameterSet()
71   {
72     super();
73     this._serviceURLList = new java.util.Vector();
74   }
75
76   // -----------/
77   // - Methods -/
78   // -----------/
79
80   /**
81    * 
82    * 
83    * @param vServiceURL
84    * @throws java.lang.IndexOutOfBoundsException
85    *           if the index given is outside the bounds of the collection
86    */
87   public void addServiceURL(final java.lang.String vServiceURL)
88           throws java.lang.IndexOutOfBoundsException
89   {
90     this._serviceURLList.addElement(vServiceURL);
91   }
92
93   /**
94    * 
95    * 
96    * @param index
97    * @param vServiceURL
98    * @throws java.lang.IndexOutOfBoundsException
99    *           if the index given is outside the bounds of the collection
100    */
101   public void addServiceURL(final int index,
102           final java.lang.String vServiceURL)
103           throws java.lang.IndexOutOfBoundsException
104   {
105     this._serviceURLList.add(index, vServiceURL);
106   }
107
108   /**
109    * Method enumerateServiceURL.
110    * 
111    * @return an Enumeration over all java.lang.String elements
112    */
113   public java.util.Enumeration enumerateServiceURL()
114   {
115     return this._serviceURLList.elements();
116   }
117
118   /**
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.
123    * 
124    * 
125    * @return the value of field 'Description'.
126    */
127   public java.lang.String getDescription()
128   {
129     return this._description;
130   }
131
132   /**
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.
136    * 
137    * 
138    * @return the value of field 'Name'.
139    */
140   public java.lang.String getName()
141   {
142     return this._name;
143   }
144
145   /**
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.
150    * 
151    * 
152    * @return the value of field 'Parameters'.
153    */
154   public java.lang.String getParameters()
155   {
156     return this._parameters;
157   }
158
159   /**
160    * Method getServiceURL.
161    * 
162    * @param index
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
166    */
167   public java.lang.String getServiceURL(final int index)
168           throws java.lang.IndexOutOfBoundsException
169   {
170     // check bounds for index
171     if (index < 0 || index >= this._serviceURLList.size())
172     {
173       throw new IndexOutOfBoundsException("getServiceURL: Index value '"
174               + index + "' not in range [0.."
175               + (this._serviceURLList.size() - 1) + "]");
176     }
177
178     return (java.lang.String) _serviceURLList.get(index);
179   }
180
181   /**
182    * Method getServiceURL.Returns the contents of the collection in an Array.
183    * <p>
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.
187    * 
188    * @return this collection as an Array
189    */
190   public java.lang.String[] getServiceURL()
191   {
192     java.lang.String[] array = new java.lang.String[0];
193     return (java.lang.String[]) this._serviceURLList.toArray(array);
194   }
195
196   /**
197    * Method getServiceURLCount.
198    * 
199    * @return the size of this collection
200    */
201   public int getServiceURLCount()
202   {
203     return this._serviceURLList.size();
204   }
205
206   /**
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.
210    * 
211    * 
212    * @return the value of field 'Version'.
213    */
214   public java.lang.String getVersion()
215   {
216     return this._version;
217   }
218
219   /**
220    * Method isValid.
221    * 
222    * @return true if this object is valid according to the schema
223    */
224   public boolean isValid()
225   {
226     try
227     {
228       validate();
229     } catch (org.exolab.castor.xml.ValidationException vex)
230     {
231       return false;
232     }
233     return true;
234   }
235
236   /**
237    * 
238    * 
239    * @param out
240    * @throws org.exolab.castor.xml.MarshalException
241    *           if object is null or if any SAXException is thrown during
242    *           marshaling
243    * @throws org.exolab.castor.xml.ValidationException
244    *           if this object is an invalid instance according to the schema
245    */
246   public void marshal(final java.io.Writer out)
247           throws org.exolab.castor.xml.MarshalException,
248           org.exolab.castor.xml.ValidationException
249   {
250     Marshaller.marshal(this, out);
251   }
252
253   /**
254    * 
255    * 
256    * @param handler
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
263    *           marshaling
264    */
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
269   {
270     Marshaller.marshal(this, handler);
271   }
272
273   /**
274      */
275   public void removeAllServiceURL()
276   {
277     this._serviceURLList.clear();
278   }
279
280   /**
281    * Method removeServiceURL.
282    * 
283    * @param vServiceURL
284    * @return true if the object was removed from the collection.
285    */
286   public boolean removeServiceURL(final java.lang.String vServiceURL)
287   {
288     boolean removed = _serviceURLList.remove(vServiceURL);
289     return removed;
290   }
291
292   /**
293    * Method removeServiceURLAt.
294    * 
295    * @param index
296    * @return the element removed from the collection
297    */
298   public java.lang.String removeServiceURLAt(final int index)
299   {
300     java.lang.Object obj = this._serviceURLList.remove(index);
301     return (java.lang.String) obj;
302   }
303
304   /**
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.
309    * 
310    * 
311    * @param description
312    *          the value of field 'description'.
313    */
314   public void setDescription(final java.lang.String description)
315   {
316     this._description = description;
317   }
318
319   /**
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.
323    * 
324    * 
325    * @param name
326    *          the value of field 'name'.
327    */
328   public void setName(final java.lang.String name)
329   {
330     this._name = name;
331   }
332
333   /**
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.
338    * 
339    * 
340    * @param parameters
341    *          the value of field 'parameters'.
342    */
343   public void setParameters(final java.lang.String parameters)
344   {
345     this._parameters = parameters;
346   }
347
348   /**
349    * 
350    * 
351    * @param index
352    * @param vServiceURL
353    * @throws java.lang.IndexOutOfBoundsException
354    *           if the index given is outside the bounds of the collection
355    */
356   public void setServiceURL(final int index,
357           final java.lang.String vServiceURL)
358           throws java.lang.IndexOutOfBoundsException
359   {
360     // check bounds for index
361     if (index < 0 || index >= this._serviceURLList.size())
362     {
363       throw new IndexOutOfBoundsException("setServiceURL: Index value '"
364               + index + "' not in range [0.."
365               + (this._serviceURLList.size() - 1) + "]");
366     }
367
368     this._serviceURLList.set(index, vServiceURL);
369   }
370
371   /**
372    * 
373    * 
374    * @param vServiceURLArray
375    */
376   public void setServiceURL(final java.lang.String[] vServiceURLArray)
377   {
378     // -- copy array
379     _serviceURLList.clear();
380
381     for (int i = 0; i < vServiceURLArray.length; i++)
382     {
383       this._serviceURLList.add(vServiceURLArray[i]);
384     }
385   }
386
387   /**
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.
391    * 
392    * 
393    * @param version
394    *          the value of field 'version'.
395    */
396   public void setVersion(final java.lang.String version)
397   {
398     this._version = version;
399   }
400
401   /**
402    * Method unmarshal.
403    * 
404    * @param reader
405    * @throws org.exolab.castor.xml.MarshalException
406    *           if object is null or if any SAXException is thrown during
407    *           marshaling
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
412    */
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
417   {
418     return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller
419             .unmarshal(
420                     jalview.schemabinding.version2.WebServiceParameterSet.class,
421                     reader);
422   }
423
424   /**
425    * 
426    * 
427    * @throws org.exolab.castor.xml.ValidationException
428    *           if this object is an invalid instance according to the schema
429    */
430   public void validate() throws org.exolab.castor.xml.ValidationException
431   {
432     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
433     validator.validate(this);
434   }
435
436 }