1 /*
2 * This class was automatically generated with
3 * <a href="http://castor.exolab.org">Castor 0.9.4</a>, using an
4 * XML Schema.
5 * $Id$
6 */
7
8 package org.enableit.db.beans;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.*;
21 import org.exolab.castor.xml.MarshalException;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 *
27 *
28 * @version $Revision$ $Date$
29 **/
30 public class RowSet implements java.io.Serializable {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.lang.String _table;
38
39 private boolean _truncateFirst;
40
41 /***
42 * keeps track of state for field: _truncateFirst
43 **/
44 private boolean _has_truncateFirst;
45
46 private java.util.Vector _conflictResolverList;
47
48 private java.util.Vector _rowList;
49
50
51 //----------------/
52 //- Constructors -/
53 //----------------/
54
55 public RowSet() {
56 super();
57 _conflictResolverList = new Vector();
58 _rowList = new Vector();
59 } //-- org.enableit.db.beans.RowSet()
60
61
62 //-----------/
63 //- Methods -/
64 //-----------/
65
66 /***
67 *
68 *
69 * @param vConflictResolver
70 **/
71 public void addConflictResolver(java.lang.String vConflictResolver)
72 throws java.lang.IndexOutOfBoundsException
73 {
74 _conflictResolverList.addElement(vConflictResolver);
75 } //-- void addConflictResolver(java.lang.String)
76
77 /***
78 *
79 *
80 * @param index
81 * @param vConflictResolver
82 **/
83 public void addConflictResolver(int index, java.lang.String vConflictResolver)
84 throws java.lang.IndexOutOfBoundsException
85 {
86 _conflictResolverList.insertElementAt(vConflictResolver, index);
87 } //-- void addConflictResolver(int, java.lang.String)
88
89 /***
90 *
91 *
92 * @param vRow
93 **/
94 public void addRow(Row vRow)
95 throws java.lang.IndexOutOfBoundsException
96 {
97 _rowList.addElement(vRow);
98 } //-- void addRow(Row)
99
100 /***
101 *
102 *
103 * @param index
104 * @param vRow
105 **/
106 public void addRow(int index, Row vRow)
107 throws java.lang.IndexOutOfBoundsException
108 {
109 _rowList.insertElementAt(vRow, index);
110 } //-- void addRow(int, Row)
111
112 /***
113 **/
114 public void deleteTruncateFirst()
115 {
116 this._has_truncateFirst= false;
117 } //-- void deleteTruncateFirst()
118
119 /***
120 **/
121 public java.util.Enumeration enumerateConflictResolver()
122 {
123 return _conflictResolverList.elements();
124 } //-- java.util.Enumeration enumerateConflictResolver()
125
126 /***
127 **/
128 public java.util.Enumeration enumerateRow()
129 {
130 return _rowList.elements();
131 } //-- java.util.Enumeration enumerateRow()
132
133 /***
134 *
135 *
136 * @param index
137 **/
138 public java.lang.String getConflictResolver(int index)
139 throws java.lang.IndexOutOfBoundsException
140 {
141 //-- check bounds for index
142 if ((index < 0) || (index > _conflictResolverList.size())) {
143 throw new IndexOutOfBoundsException();
144 }
145
146 return (String)_conflictResolverList.elementAt(index);
147 } //-- java.lang.String getConflictResolver(int)
148
149 /***
150 **/
151 public java.lang.String[] getConflictResolver()
152 {
153 int size = _conflictResolverList.size();
154 java.lang.String[] mArray = new java.lang.String[size];
155 for (int index = 0; index < size; index++) {
156 mArray[index] = (String)_conflictResolverList.elementAt(index);
157 }
158 return mArray;
159 } //-- java.lang.String[] getConflictResolver()
160
161 /***
162 **/
163 public int getConflictResolverCount()
164 {
165 return _conflictResolverList.size();
166 } //-- int getConflictResolverCount()
167
168 /***
169 *
170 *
171 * @param index
172 **/
173 public Row getRow(int index)
174 throws java.lang.IndexOutOfBoundsException
175 {
176 //-- check bounds for index
177 if ((index < 0) || (index > _rowList.size())) {
178 throw new IndexOutOfBoundsException();
179 }
180
181 return (Row) _rowList.elementAt(index);
182 } //-- Row getRow(int)
183
184 /***
185 **/
186 public Row[] getRow()
187 {
188 int size = _rowList.size();
189 Row[] mArray = new Row[size];
190 for (int index = 0; index < size; index++) {
191 mArray[index] = (Row) _rowList.elementAt(index);
192 }
193 return mArray;
194 } //-- Row[] getRow()
195
196 /***
197 **/
198 public int getRowCount()
199 {
200 return _rowList.size();
201 } //-- int getRowCount()
202
203 /***
204 * Returns the value of field 'table'.
205 *
206 * @return the value of field 'table'.
207 **/
208 public java.lang.String getTable()
209 {
210 return this._table;
211 } //-- java.lang.String getTable()
212
213 /***
214 * Returns the value of field 'truncateFirst'.
215 *
216 * @return the value of field 'truncateFirst'.
217 **/
218 public boolean getTruncateFirst()
219 {
220 return this._truncateFirst;
221 } //-- boolean getTruncateFirst()
222
223 /***
224 **/
225 public boolean hasTruncateFirst()
226 {
227 return this._has_truncateFirst;
228 } //-- boolean hasTruncateFirst()
229
230 /***
231 **/
232 public boolean isValid()
233 {
234 try {
235 validate();
236 }
237 catch (org.exolab.castor.xml.ValidationException vex) {
238 return false;
239 }
240 return true;
241 } //-- boolean isValid()
242
243 /***
244 *
245 *
246 * @param out
247 **/
248 public void marshal(java.io.Writer out)
249 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
250 {
251
252 Marshaller.marshal(this, out);
253 } //-- void marshal(java.io.Writer)
254
255 /***
256 *
257 *
258 * @param handler
259 **/
260 public void marshal(org.xml.sax.ContentHandler handler)
261 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
262 {
263
264 Marshaller.marshal(this, handler);
265 } //-- void marshal(org.xml.sax.ContentHandler)
266
267 /***
268 **/
269 public void removeAllConflictResolver()
270 {
271 _conflictResolverList.removeAllElements();
272 } //-- void removeAllConflictResolver()
273
274 /***
275 **/
276 public void removeAllRow()
277 {
278 _rowList.removeAllElements();
279 } //-- void removeAllRow()
280
281 /***
282 *
283 *
284 * @param index
285 **/
286 public java.lang.String removeConflictResolver(int index)
287 {
288 java.lang.Object obj = _conflictResolverList.elementAt(index);
289 _conflictResolverList.removeElementAt(index);
290 return (String)obj;
291 } //-- java.lang.String removeConflictResolver(int)
292
293 /***
294 *
295 *
296 * @param index
297 **/
298 public Row removeRow(int index)
299 {
300 java.lang.Object obj = _rowList.elementAt(index);
301 _rowList.removeElementAt(index);
302 return (Row) obj;
303 } //-- Row removeRow(int)
304
305 /***
306 *
307 *
308 * @param index
309 * @param vConflictResolver
310 **/
311 public void setConflictResolver(int index, java.lang.String vConflictResolver)
312 throws java.lang.IndexOutOfBoundsException
313 {
314 //-- check bounds for index
315 if ((index < 0) || (index > _conflictResolverList.size())) {
316 throw new IndexOutOfBoundsException();
317 }
318 _conflictResolverList.setElementAt(vConflictResolver, index);
319 } //-- void setConflictResolver(int, java.lang.String)
320
321 /***
322 *
323 *
324 * @param conflictResolverArray
325 **/
326 public void setConflictResolver(java.lang.String[] conflictResolverArray)
327 {
328 //-- copy array
329 _conflictResolverList.removeAllElements();
330 for (int i = 0; i < conflictResolverArray.length; i++) {
331 _conflictResolverList.addElement(conflictResolverArray[i]);
332 }
333 } //-- void setConflictResolver(java.lang.String)
334
335 /***
336 *
337 *
338 * @param index
339 * @param vRow
340 **/
341 public void setRow(int index, Row vRow)
342 throws java.lang.IndexOutOfBoundsException
343 {
344 //-- check bounds for index
345 if ((index < 0) || (index > _rowList.size())) {
346 throw new IndexOutOfBoundsException();
347 }
348 _rowList.setElementAt(vRow, index);
349 } //-- void setRow(int, Row)
350
351 /***
352 *
353 *
354 * @param rowArray
355 **/
356 public void setRow(Row[] rowArray)
357 {
358 //-- copy array
359 _rowList.removeAllElements();
360 for (int i = 0; i < rowArray.length; i++) {
361 _rowList.addElement(rowArray[i]);
362 }
363 } //-- void setRow(Row)
364
365 /***
366 * Sets the value of field 'table'.
367 *
368 * @param table the value of field 'table'.
369 **/
370 public void setTable(java.lang.String table)
371 {
372 this._table = table;
373 } //-- void setTable(java.lang.String)
374
375 /***
376 * Sets the value of field 'truncateFirst'.
377 *
378 * @param truncateFirst the value of field 'truncateFirst'.
379 **/
380 public void setTruncateFirst(boolean truncateFirst)
381 {
382 this._truncateFirst = truncateFirst;
383 this._has_truncateFirst = true;
384 } //-- void setTruncateFirst(boolean)
385
386 /***
387 *
388 *
389 * @param reader
390 **/
391 public static org.enableit.db.beans.RowSet unmarshal(java.io.Reader reader)
392 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
393 {
394 return (org.enableit.db.beans.RowSet) Unmarshaller.unmarshal(org.enableit.db.beans.RowSet.class, reader);
395 } //-- org.enableit.db.beans.RowSet unmarshal(java.io.Reader)
396
397 /***
398 **/
399 public void validate()
400 throws org.exolab.castor.xml.ValidationException
401 {
402 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
403 validator.validate(this);
404 } //-- void validate()
405
406 }
This page was automatically generated by Maven