View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor;
9   
10  /**
11   * Castor Testing Framework Test Descriptor XML Schema
12   *  <p>
13   *  Namespace: http://castor.exolab.org/Test
14   *  <p>
15   *  This schema is used to generate the
16   *  org.exolab.castor.tests.framework.testdescriptor package
17   *  Note: This schema is under evolution and subject to change.
18   *  This schema is under the Exolab license.
19   *  
20   * 
21   * @version $Revision$ $Date$
22   */
23  public class TestDescriptor implements java.io.Serializable {
24  
25  
26        //--------------------------/
27       //- Class/Member Variables -/
28      //--------------------------/
29  
30      /**
31       * Field _name.
32       */
33      private java.lang.String _name;
34  
35      /**
36       * Field _author.
37       */
38      private java.lang.String _author;
39  
40      /**
41       * Field _commentList.
42       */
43      private java.util.List _commentList;
44  
45      /**
46       * Field _category.
47       */
48      private org.exolab.castor.tests.framework.testDescriptor.types.CategoryType _category;
49  
50      /**
51       * Encapsulates information about a bug fix, including the
52       * reporter's
53       *  name (or Email address), the date of the report and of the
54       * fix,
55       *  and one or more comments about the bug.
56       *  
57       */
58      private org.exolab.castor.tests.framework.testDescriptor.BugFix _bugFix;
59  
60      /**
61       * Field _minimumJavaVersion.
62       */
63      private float _minimumJavaVersion;
64  
65      /**
66       * keeps track of state for field: _minimumJavaVersion
67       */
68      private boolean _has_minimumJavaVersion;
69  
70      /**
71       * Field _maximumJavaVersion.
72       */
73      private float _maximumJavaVersion;
74  
75      /**
76       * keeps track of state for field: _maximumJavaVersion
77       */
78      private boolean _has_maximumJavaVersion;
79  
80      /**
81       * Field _testDescriptorChoice.
82       */
83      private org.exolab.castor.tests.framework.testDescriptor.TestDescriptorChoice _testDescriptorChoice;
84  
85  
86        //----------------/
87       //- Constructors -/
88      //----------------/
89  
90      public TestDescriptor() {
91          super();
92          this._commentList = new java.util.ArrayList();
93      }
94  
95  
96        //-----------/
97       //- Methods -/
98      //-----------/
99  
100     /**
101      * 
102      * 
103      * @param vComment
104      * @throws java.lang.IndexOutOfBoundsException if the index
105      * given is outside the bounds of the collection
106      */
107     public void addComment(
108             final java.lang.String vComment)
109     throws java.lang.IndexOutOfBoundsException {
110         this._commentList.add(vComment);
111     }
112 
113     /**
114      * 
115      * 
116      * @param index
117      * @param vComment
118      * @throws java.lang.IndexOutOfBoundsException if the index
119      * given is outside the bounds of the collection
120      */
121     public void addComment(
122             final int index,
123             final java.lang.String vComment)
124     throws java.lang.IndexOutOfBoundsException {
125         this._commentList.add(index, vComment);
126     }
127 
128     /**
129      */
130     public void deleteMaximumJavaVersion(
131     ) {
132         this._has_maximumJavaVersion= false;
133     }
134 
135     /**
136      */
137     public void deleteMinimumJavaVersion(
138     ) {
139         this._has_minimumJavaVersion= false;
140     }
141 
142     /**
143      * Method enumerateComment.
144      * 
145      * @return an Enumeration over all possible elements of this
146      * collection
147      */
148     public java.util.Enumeration enumerateComment(
149     ) {
150         return java.util.Collections.enumeration(this._commentList);
151     }
152 
153     /**
154      * Returns the value of field 'author'.
155      * 
156      * @return the value of field 'Author'.
157      */
158     public java.lang.String getAuthor(
159     ) {
160         return this._author;
161     }
162 
163     /**
164      * Returns the value of field 'bugFix'. The field 'bugFix' has
165      * the following description: Encapsulates information about a
166      * bug fix, including the reporter's
167      *  name (or Email address), the date of the report and of the
168      * fix,
169      *  and one or more comments about the bug.
170      *  
171      * 
172      * @return the value of field 'BugFix'.
173      */
174     public org.exolab.castor.tests.framework.testDescriptor.BugFix getBugFix(
175     ) {
176         return this._bugFix;
177     }
178 
179     /**
180      * Returns the value of field 'category'.
181      * 
182      * @return the value of field 'Category'.
183      */
184     public org.exolab.castor.tests.framework.testDescriptor.types.CategoryType getCategory(
185     ) {
186         return this._category;
187     }
188 
189     /**
190      * Method getComment.
191      * 
192      * @param index
193      * @throws java.lang.IndexOutOfBoundsException if the index
194      * given is outside the bounds of the collection
195      * @return the value of the java.lang.String at the given index
196      */
197     public java.lang.String getComment(
198             final int index)
199     throws java.lang.IndexOutOfBoundsException {
200         // check bounds for index
201         if (index < 0 || index >= this._commentList.size()) {
202             throw new IndexOutOfBoundsException("getComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
203         }
204 
205         return (java.lang.String) _commentList.get(index);
206     }
207 
208     /**
209      * Method getComment.Returns the contents of the collection in
210      * an Array.  <p>Note:  Just in case the collection contents
211      * are changing in another thread, we pass a 0-length Array of
212      * the correct type into the API call.  This way we <i>know</i>
213      * that the Array returned is of exactly the correct length.
214      * 
215      * @return this collection as an Array
216      */
217     public java.lang.String[] getComment(
218     ) {
219         java.lang.String[] array = new java.lang.String[0];
220         return (java.lang.String[]) this._commentList.toArray(array);
221     }
222 
223     /**
224      * Method getCommentCount.
225      * 
226      * @return the size of this collection
227      */
228     public int getCommentCount(
229     ) {
230         return this._commentList.size();
231     }
232 
233     /**
234      * Returns the value of field 'maximumJavaVersion'.
235      * 
236      * @return the value of field 'MaximumJavaVersion'.
237      */
238     public float getMaximumJavaVersion(
239     ) {
240         return this._maximumJavaVersion;
241     }
242 
243     /**
244      * Returns the value of field 'minimumJavaVersion'.
245      * 
246      * @return the value of field 'MinimumJavaVersion'.
247      */
248     public float getMinimumJavaVersion(
249     ) {
250         return this._minimumJavaVersion;
251     }
252 
253     /**
254      * Returns the value of field 'name'.
255      * 
256      * @return the value of field 'Name'.
257      */
258     public java.lang.String getName(
259     ) {
260         return this._name;
261     }
262 
263     /**
264      * Returns the value of field 'testDescriptorChoice'.
265      * 
266      * @return the value of field 'TestDescriptorChoice'.
267      */
268     public org.exolab.castor.tests.framework.testDescriptor.TestDescriptorChoice getTestDescriptorChoice(
269     ) {
270         return this._testDescriptorChoice;
271     }
272 
273     /**
274      * Method hasMaximumJavaVersion.
275      * 
276      * @return true if at least one MaximumJavaVersion has been adde
277      */
278     public boolean hasMaximumJavaVersion(
279     ) {
280         return this._has_maximumJavaVersion;
281     }
282 
283     /**
284      * Method hasMinimumJavaVersion.
285      * 
286      * @return true if at least one MinimumJavaVersion has been adde
287      */
288     public boolean hasMinimumJavaVersion(
289     ) {
290         return this._has_minimumJavaVersion;
291     }
292 
293     /**
294      * Method isValid.
295      * 
296      * @return true if this object is valid according to the schema
297      */
298     public boolean isValid(
299     ) {
300         try {
301             validate();
302         } catch (org.exolab.castor.xml.ValidationException vex) {
303             return false;
304         }
305         return true;
306     }
307 
308     /**
309      * Method iterateComment.
310      * 
311      * @return an Iterator over all possible elements in this
312      * collection
313      */
314     public java.util.Iterator iterateComment(
315     ) {
316         return this._commentList.iterator();
317     }
318 
319     /**
320      * 
321      * 
322      * @param out
323      * @throws org.exolab.castor.xml.MarshalException if object is
324      * null or if any SAXException is thrown during marshaling
325      * @throws org.exolab.castor.xml.ValidationException if this
326      * object is an invalid instance according to the schema
327      */
328     public void marshal(
329             final java.io.Writer out)
330     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
331         org.exolab.castor.xml.Marshaller.marshal(this, out);
332     }
333 
334     /**
335      * 
336      * 
337      * @param handler
338      * @throws java.io.IOException if an IOException occurs during
339      * marshaling
340      * @throws org.exolab.castor.xml.ValidationException if this
341      * object is an invalid instance according to the schema
342      * @throws org.exolab.castor.xml.MarshalException if object is
343      * null or if any SAXException is thrown during marshaling
344      */
345     public void marshal(
346             final org.xml.sax.ContentHandler handler)
347     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
348         org.exolab.castor.xml.Marshaller.marshal(this, handler);
349     }
350 
351     /**
352      */
353     public void removeAllComment(
354     ) {
355         this._commentList.clear();
356     }
357 
358     /**
359      * Method removeComment.
360      * 
361      * @param vComment
362      * @return true if the object was removed from the collection.
363      */
364     public boolean removeComment(
365             final java.lang.String vComment) {
366         boolean removed = _commentList.remove(vComment);
367         return removed;
368     }
369 
370     /**
371      * Method removeCommentAt.
372      * 
373      * @param index
374      * @return the element removed from the collection
375      */
376     public java.lang.String removeCommentAt(
377             final int index) {
378         java.lang.Object obj = this._commentList.remove(index);
379         return (java.lang.String) obj;
380     }
381 
382     /**
383      * Sets the value of field 'author'.
384      * 
385      * @param author the value of field 'author'.
386      */
387     public void setAuthor(
388             final java.lang.String author) {
389         this._author = author;
390     }
391 
392     /**
393      * Sets the value of field 'bugFix'. The field 'bugFix' has the
394      * following description: Encapsulates information about a bug
395      * fix, including the reporter's
396      *  name (or Email address), the date of the report and of the
397      * fix,
398      *  and one or more comments about the bug.
399      *  
400      * 
401      * @param bugFix the value of field 'bugFix'.
402      */
403     public void setBugFix(
404             final org.exolab.castor.tests.framework.testDescriptor.BugFix bugFix) {
405         this._bugFix = bugFix;
406     }
407 
408     /**
409      * Sets the value of field 'category'.
410      * 
411      * @param category the value of field 'category'.
412      */
413     public void setCategory(
414             final org.exolab.castor.tests.framework.testDescriptor.types.CategoryType category) {
415         this._category = category;
416     }
417 
418     /**
419      * 
420      * 
421      * @param index
422      * @param vComment
423      * @throws java.lang.IndexOutOfBoundsException if the index
424      * given is outside the bounds of the collection
425      */
426     public void setComment(
427             final int index,
428             final java.lang.String vComment)
429     throws java.lang.IndexOutOfBoundsException {
430         // check bounds for index
431         if (index < 0 || index >= this._commentList.size()) {
432             throw new IndexOutOfBoundsException("setComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
433         }
434 
435         this._commentList.set(index, vComment);
436     }
437 
438     /**
439      * 
440      * 
441      * @param vCommentArray
442      */
443     public void setComment(
444             final java.lang.String[] vCommentArray) {
445         //-- copy array
446         _commentList.clear();
447 
448         for (int i = 0; i < vCommentArray.length; i++) {
449                 this._commentList.add(vCommentArray[i]);
450         }
451     }
452 
453     /**
454      * Sets the value of field 'maximumJavaVersion'.
455      * 
456      * @param maximumJavaVersion the value of field
457      * 'maximumJavaVersion'.
458      */
459     public void setMaximumJavaVersion(
460             final float maximumJavaVersion) {
461         this._maximumJavaVersion = maximumJavaVersion;
462         this._has_maximumJavaVersion = true;
463     }
464 
465     /**
466      * Sets the value of field 'minimumJavaVersion'.
467      * 
468      * @param minimumJavaVersion the value of field
469      * 'minimumJavaVersion'.
470      */
471     public void setMinimumJavaVersion(
472             final float minimumJavaVersion) {
473         this._minimumJavaVersion = minimumJavaVersion;
474         this._has_minimumJavaVersion = true;
475     }
476 
477     /**
478      * Sets the value of field 'name'.
479      * 
480      * @param name the value of field 'name'.
481      */
482     public void setName(
483             final java.lang.String name) {
484         this._name = name;
485     }
486 
487     /**
488      * Sets the value of field 'testDescriptorChoice'.
489      * 
490      * @param testDescriptorChoice the value of field
491      * 'testDescriptorChoice'.
492      */
493     public void setTestDescriptorChoice(
494             final org.exolab.castor.tests.framework.testDescriptor.TestDescriptorChoice testDescriptorChoice) {
495         this._testDescriptorChoice = testDescriptorChoice;
496     }
497 
498     /**
499      * Method unmarshal.
500      * 
501      * @param reader
502      * @throws org.exolab.castor.xml.MarshalException if object is
503      * null or if any SAXException is thrown during marshaling
504      * @throws org.exolab.castor.xml.ValidationException if this
505      * object is an invalid instance according to the schema
506      * @return the unmarshaled
507      * org.exolab.castor.tests.framework.testDescriptor.TestDescriptor
508      */
509     public static org.exolab.castor.tests.framework.testDescriptor.TestDescriptor unmarshal(
510             final java.io.Reader reader)
511     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
512         return (org.exolab.castor.tests.framework.testDescriptor.TestDescriptor) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.TestDescriptor.class, reader);
513     }
514 
515     /**
516      * 
517      * 
518      * @throws org.exolab.castor.xml.ValidationException if this
519      * object is an invalid instance according to the schema
520      */
521     public void validate(
522     )
523     throws org.exolab.castor.xml.ValidationException {
524         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
525         validator.validate(this);
526     }
527 
528 }