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   * Encapsulates information about a bug fix, including the
12   * reporter's
13   *  name (or Email address), the date of the report and of the fix,
14   *  and one or more comments about the bug.
15   *  
16   * 
17   * @version $Revision$ $Date$
18   */
19  public class BugFix implements java.io.Serializable {
20  
21  
22        //--------------------------/
23       //- Class/Member Variables -/
24      //--------------------------/
25  
26      /**
27       * Field _reporter.
28       */
29      private java.lang.String _reporter;
30  
31      /**
32       * Field _issue.
33       */
34      private java.lang.String _issue;
35  
36      /**
37       * Field _date_Report.
38       */
39      private org.exolab.castor.types.Date _date_Report;
40  
41      /**
42       * Field _date_Fix.
43       */
44      private org.exolab.castor.types.Date _date_Fix;
45  
46      /**
47       * Field _commentList.
48       */
49      private java.util.List _commentList;
50  
51  
52        //----------------/
53       //- Constructors -/
54      //----------------/
55  
56      public BugFix() {
57          super();
58          this._commentList = new java.util.ArrayList();
59      }
60  
61  
62        //-----------/
63       //- Methods -/
64      //-----------/
65  
66      /**
67       * 
68       * 
69       * @param vComment
70       * @throws java.lang.IndexOutOfBoundsException if the index
71       * given is outside the bounds of the collection
72       */
73      public void addComment(
74              final java.lang.String vComment)
75      throws java.lang.IndexOutOfBoundsException {
76          this._commentList.add(vComment);
77      }
78  
79      /**
80       * 
81       * 
82       * @param index
83       * @param vComment
84       * @throws java.lang.IndexOutOfBoundsException if the index
85       * given is outside the bounds of the collection
86       */
87      public void addComment(
88              final int index,
89              final java.lang.String vComment)
90      throws java.lang.IndexOutOfBoundsException {
91          this._commentList.add(index, vComment);
92      }
93  
94      /**
95       * Method enumerateComment.
96       * 
97       * @return an Enumeration over all possible elements of this
98       * collection
99       */
100     public java.util.Enumeration enumerateComment(
101     ) {
102         return java.util.Collections.enumeration(this._commentList);
103     }
104 
105     /**
106      * Method getComment.
107      * 
108      * @param index
109      * @throws java.lang.IndexOutOfBoundsException if the index
110      * given is outside the bounds of the collection
111      * @return the value of the java.lang.String at the given index
112      */
113     public java.lang.String getComment(
114             final int index)
115     throws java.lang.IndexOutOfBoundsException {
116         // check bounds for index
117         if (index < 0 || index >= this._commentList.size()) {
118             throw new IndexOutOfBoundsException("getComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
119         }
120 
121         return (java.lang.String) _commentList.get(index);
122     }
123 
124     /**
125      * Method getComment.Returns the contents of the collection in
126      * an Array.  <p>Note:  Just in case the collection contents
127      * are changing in another thread, we pass a 0-length Array of
128      * the correct type into the API call.  This way we <i>know</i>
129      * that the Array returned is of exactly the correct length.
130      * 
131      * @return this collection as an Array
132      */
133     public java.lang.String[] getComment(
134     ) {
135         java.lang.String[] array = new java.lang.String[0];
136         return (java.lang.String[]) this._commentList.toArray(array);
137     }
138 
139     /**
140      * Method getCommentCount.
141      * 
142      * @return the size of this collection
143      */
144     public int getCommentCount(
145     ) {
146         return this._commentList.size();
147     }
148 
149     /**
150      * Returns the value of field 'date_Fix'.
151      * 
152      * @return the value of field 'Date_Fix'.
153      */
154     public org.exolab.castor.types.Date getDate_Fix(
155     ) {
156         return this._date_Fix;
157     }
158 
159     /**
160      * Returns the value of field 'date_Report'.
161      * 
162      * @return the value of field 'Date_Report'.
163      */
164     public org.exolab.castor.types.Date getDate_Report(
165     ) {
166         return this._date_Report;
167     }
168 
169     /**
170      * Returns the value of field 'issue'.
171      * 
172      * @return the value of field 'Issue'.
173      */
174     public java.lang.String getIssue(
175     ) {
176         return this._issue;
177     }
178 
179     /**
180      * Returns the value of field 'reporter'.
181      * 
182      * @return the value of field 'Reporter'.
183      */
184     public java.lang.String getReporter(
185     ) {
186         return this._reporter;
187     }
188 
189     /**
190      * Method isValid.
191      * 
192      * @return true if this object is valid according to the schema
193      */
194     public boolean isValid(
195     ) {
196         try {
197             validate();
198         } catch (org.exolab.castor.xml.ValidationException vex) {
199             return false;
200         }
201         return true;
202     }
203 
204     /**
205      * Method iterateComment.
206      * 
207      * @return an Iterator over all possible elements in this
208      * collection
209      */
210     public java.util.Iterator iterateComment(
211     ) {
212         return this._commentList.iterator();
213     }
214 
215     /**
216      * 
217      * 
218      * @param out
219      * @throws org.exolab.castor.xml.MarshalException if object is
220      * null or if any SAXException is thrown during marshaling
221      * @throws org.exolab.castor.xml.ValidationException if this
222      * object is an invalid instance according to the schema
223      */
224     public void marshal(
225             final java.io.Writer out)
226     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
227         org.exolab.castor.xml.Marshaller.marshal(this, out);
228     }
229 
230     /**
231      * 
232      * 
233      * @param handler
234      * @throws java.io.IOException if an IOException occurs during
235      * marshaling
236      * @throws org.exolab.castor.xml.ValidationException if this
237      * object is an invalid instance according to the schema
238      * @throws org.exolab.castor.xml.MarshalException if object is
239      * null or if any SAXException is thrown during marshaling
240      */
241     public void marshal(
242             final org.xml.sax.ContentHandler handler)
243     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
244         org.exolab.castor.xml.Marshaller.marshal(this, handler);
245     }
246 
247     /**
248      */
249     public void removeAllComment(
250     ) {
251         this._commentList.clear();
252     }
253 
254     /**
255      * Method removeComment.
256      * 
257      * @param vComment
258      * @return true if the object was removed from the collection.
259      */
260     public boolean removeComment(
261             final java.lang.String vComment) {
262         boolean removed = _commentList.remove(vComment);
263         return removed;
264     }
265 
266     /**
267      * Method removeCommentAt.
268      * 
269      * @param index
270      * @return the element removed from the collection
271      */
272     public java.lang.String removeCommentAt(
273             final int index) {
274         java.lang.Object obj = this._commentList.remove(index);
275         return (java.lang.String) obj;
276     }
277 
278     /**
279      * 
280      * 
281      * @param index
282      * @param vComment
283      * @throws java.lang.IndexOutOfBoundsException if the index
284      * given is outside the bounds of the collection
285      */
286     public void setComment(
287             final int index,
288             final java.lang.String vComment)
289     throws java.lang.IndexOutOfBoundsException {
290         // check bounds for index
291         if (index < 0 || index >= this._commentList.size()) {
292             throw new IndexOutOfBoundsException("setComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
293         }
294 
295         this._commentList.set(index, vComment);
296     }
297 
298     /**
299      * 
300      * 
301      * @param vCommentArray
302      */
303     public void setComment(
304             final java.lang.String[] vCommentArray) {
305         //-- copy array
306         _commentList.clear();
307 
308         for (int i = 0; i < vCommentArray.length; i++) {
309                 this._commentList.add(vCommentArray[i]);
310         }
311     }
312 
313     /**
314      * Sets the value of field 'date_Fix'.
315      * 
316      * @param date_Fix the value of field 'date_Fix'.
317      */
318     public void setDate_Fix(
319             final org.exolab.castor.types.Date date_Fix) {
320         this._date_Fix = date_Fix;
321     }
322 
323     /**
324      * Sets the value of field 'date_Report'.
325      * 
326      * @param date_Report the value of field 'date_Report'.
327      */
328     public void setDate_Report(
329             final org.exolab.castor.types.Date date_Report) {
330         this._date_Report = date_Report;
331     }
332 
333     /**
334      * Sets the value of field 'issue'.
335      * 
336      * @param issue the value of field 'issue'.
337      */
338     public void setIssue(
339             final java.lang.String issue) {
340         this._issue = issue;
341     }
342 
343     /**
344      * Sets the value of field 'reporter'.
345      * 
346      * @param reporter the value of field 'reporter'.
347      */
348     public void setReporter(
349             final java.lang.String reporter) {
350         this._reporter = reporter;
351     }
352 
353     /**
354      * Method unmarshal.
355      * 
356      * @param reader
357      * @throws org.exolab.castor.xml.MarshalException if object is
358      * null or if any SAXException is thrown during marshaling
359      * @throws org.exolab.castor.xml.ValidationException if this
360      * object is an invalid instance according to the schema
361      * @return the unmarshaled
362      * org.exolab.castor.tests.framework.testDescriptor.BugFix
363      */
364     public static org.exolab.castor.tests.framework.testDescriptor.BugFix unmarshal(
365             final java.io.Reader reader)
366     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
367         return (org.exolab.castor.tests.framework.testDescriptor.BugFix) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.BugFix.class, reader);
368     }
369 
370     /**
371      * 
372      * 
373      * @throws org.exolab.castor.xml.ValidationException if this
374      * object is an invalid instance according to the schema
375      */
376     public void validate(
377     )
378     throws org.exolab.castor.xml.ValidationException {
379         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
380         validator.validate(this);
381     }
382 
383 }