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
32 * other presets for the web service.
35 private java.lang.String _name;
38 * A Jalview Web Service Parameter Set container
40 * Version 1 created for storing Jaba user presets.
43 private java.lang.String _version;
46 * Short description - as utf8 encoded text. This is
48 * in the body of an HTML capable tooltip, so HTML tags may be
50 * using standard UTF8 encoding.
53 private java.lang.String _description;
56 * URL for which the parameter set is valid. Jalview will use
58 * match up parameter sets to service instances that can parse
60 * parameter set payload.
63 private java.util.Vector _serviceURLList;
66 * UTF8 encoded string to be processed into a specific web
68 * parameter set. Note - newlines may be important to the
73 private java.lang.String _parameters;
80 public WebServiceParameterSet() {
82 this._serviceURLList = new java.util.Vector();
94 * @throws java.lang.IndexOutOfBoundsException if the index
95 * given is outside the bounds of the collection
97 public void addServiceURL(
98 final java.lang.String vServiceURL)
99 throws java.lang.IndexOutOfBoundsException {
100 this._serviceURLList.addElement(vServiceURL);
108 * @throws java.lang.IndexOutOfBoundsException if the index
109 * given is outside the bounds of the collection
111 public void addServiceURL(
113 final java.lang.String vServiceURL)
114 throws java.lang.IndexOutOfBoundsException {
115 this._serviceURLList.add(index, vServiceURL);
119 * Method enumerateServiceURL.
121 * @return an Enumeration over all java.lang.String elements
123 public java.util.Enumeration enumerateServiceURL(
125 return this._serviceURLList.elements();
129 * Returns the value of field 'description'. The field
130 * 'description' has the following description: Short
131 * description - as utf8 encoded text. This is
133 * in the body of an HTML capable tooltip, so HTML tags may be
135 * using standard UTF8 encoding.
138 * @return the value of field 'Description'.
140 public java.lang.String getDescription(
142 return this._description;
146 * Returns the value of field 'name'. The field 'name' has the
147 * following description: The short name for the parameter set.
148 * This will be shown amongst the
149 * other presets for the web service.
152 * @return the value of field 'Name'.
154 public java.lang.String getName(
160 * Returns the value of field 'parameters'. The field
161 * 'parameters' has the following description: UTF8 encoded
162 * string to be processed into a specific web services'
163 * parameter set. Note - newlines may be important to the
168 * @return the value of field 'Parameters'.
170 public java.lang.String getParameters(
172 return this._parameters;
176 * Method getServiceURL.
179 * @throws java.lang.IndexOutOfBoundsException if the index
180 * given is outside the bounds of the collection
181 * @return the value of the java.lang.String at the given index
183 public java.lang.String getServiceURL(
185 throws java.lang.IndexOutOfBoundsException {
186 // check bounds for index
187 if (index < 0 || index >= this._serviceURLList.size()) {
188 throw new IndexOutOfBoundsException("getServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
191 return (java.lang.String) _serviceURLList.get(index);
195 * Method getServiceURL.Returns the contents of the collection
196 * in an Array. <p>Note: Just in case the collection contents
197 * are changing in another thread, we pass a 0-length Array of
198 * the correct type into the API call. This way we <i>know</i>
199 * that the Array returned is of exactly the correct length.
201 * @return this collection as an Array
203 public java.lang.String[] getServiceURL(
205 java.lang.String[] array = new java.lang.String[0];
206 return (java.lang.String[]) this._serviceURLList.toArray(array);
210 * Method getServiceURLCount.
212 * @return the size of this collection
214 public int getServiceURLCount(
216 return this._serviceURLList.size();
220 * Returns the value of field 'version'. The field 'version'
221 * has the following description: A Jalview Web Service
222 * Parameter Set container
224 * Version 1 created for storing Jaba user presets.
227 * @return the value of field 'Version'.
229 public java.lang.String getVersion(
231 return this._version;
237 * @return true if this object is valid according to the schema
239 public boolean isValid(
243 } catch (org.exolab.castor.xml.ValidationException vex) {
253 * @throws org.exolab.castor.xml.MarshalException if object is
254 * null or if any SAXException is thrown during marshaling
255 * @throws org.exolab.castor.xml.ValidationException if this
256 * object is an invalid instance according to the schema
259 final java.io.Writer out)
260 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
261 Marshaller.marshal(this, out);
268 * @throws java.io.IOException if an IOException occurs during
270 * @throws org.exolab.castor.xml.ValidationException if this
271 * object is an invalid instance according to the schema
272 * @throws org.exolab.castor.xml.MarshalException if object is
273 * null or if any SAXException is thrown during marshaling
276 final org.xml.sax.ContentHandler handler)
277 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
278 Marshaller.marshal(this, handler);
283 public void removeAllServiceURL(
285 this._serviceURLList.clear();
289 * Method removeServiceURL.
292 * @return true if the object was removed from the collection.
294 public boolean removeServiceURL(
295 final java.lang.String vServiceURL) {
296 boolean removed = _serviceURLList.remove(vServiceURL);
301 * Method removeServiceURLAt.
304 * @return the element removed from the collection
306 public java.lang.String removeServiceURLAt(
308 java.lang.Object obj = this._serviceURLList.remove(index);
309 return (java.lang.String) obj;
313 * Sets the value of field 'description'. The field
314 * 'description' has the following description: Short
315 * description - as utf8 encoded text. This is
317 * in the body of an HTML capable tooltip, so HTML tags may be
319 * using standard UTF8 encoding.
322 * @param description the value of field 'description'.
324 public void setDescription(
325 final java.lang.String description) {
326 this._description = description;
330 * Sets the value of field 'name'. The field 'name' has the
331 * following description: The short name for the parameter set.
332 * This will be shown amongst the
333 * other presets for the web service.
336 * @param name the value of field 'name'.
339 final java.lang.String name) {
344 * Sets the value of field 'parameters'. The field 'parameters'
345 * has the following description: UTF8 encoded string to be
346 * processed into a specific web services'
347 * parameter set. Note - newlines may be important to the
352 * @param parameters the value of field 'parameters'.
354 public void setParameters(
355 final java.lang.String parameters) {
356 this._parameters = parameters;
364 * @throws java.lang.IndexOutOfBoundsException if the index
365 * given is outside the bounds of the collection
367 public void setServiceURL(
369 final java.lang.String vServiceURL)
370 throws java.lang.IndexOutOfBoundsException {
371 // check bounds for index
372 if (index < 0 || index >= this._serviceURLList.size()) {
373 throw new IndexOutOfBoundsException("setServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
376 this._serviceURLList.set(index, vServiceURL);
382 * @param vServiceURLArray
384 public void setServiceURL(
385 final java.lang.String[] vServiceURLArray) {
387 _serviceURLList.clear();
389 for (int i = 0; i < vServiceURLArray.length; i++) {
390 this._serviceURLList.add(vServiceURLArray[i]);
395 * Sets the value of field 'version'. The field 'version' has
396 * the following description: A Jalview Web Service Parameter
399 * Version 1 created for storing Jaba user presets.
402 * @param version the value of field 'version'.
404 public void setVersion(
405 final java.lang.String version) {
406 this._version = version;
413 * @throws org.exolab.castor.xml.MarshalException if object is
414 * null or if any SAXException is thrown during marshaling
415 * @throws org.exolab.castor.xml.ValidationException if this
416 * object is an invalid instance according to the schema
417 * @return the unmarshaled
418 * jalview.schemabinding.version2.WebServiceParameterSet
420 public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
421 final java.io.Reader reader)
422 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
423 return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.WebServiceParameterSet.class, reader);
429 * @throws org.exolab.castor.xml.ValidationException if this
430 * object is an invalid instance according to the schema
432 public void validate(
434 throws org.exolab.castor.xml.ValidationException {
435 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
436 validator.validate(this);