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 Schema implements java.io.Serializable {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.lang.String _name;
38
39 private java.util.Vector _tableList;
40
41 private java.util.Vector _viewList;
42
43
44 //----------------/
45 //- Constructors -/
46 //----------------/
47
48 public Schema() {
49 super();
50 _tableList = new Vector();
51 _viewList = new Vector();
52 } //-- org.enableit.db.beans.Schema()
53
54
55 //-----------/
56 //- Methods -/
57 //-----------/
58
59 /***
60 *
61 *
62 * @param vTable
63 **/
64 public void addTable(Table vTable)
65 throws java.lang.IndexOutOfBoundsException
66 {
67 _tableList.addElement(vTable);
68 } //-- void addTable(Table)
69
70 /***
71 *
72 *
73 * @param index
74 * @param vTable
75 **/
76 public void addTable(int index, Table vTable)
77 throws java.lang.IndexOutOfBoundsException
78 {
79 _tableList.insertElementAt(vTable, index);
80 } //-- void addTable(int, Table)
81
82 /***
83 *
84 *
85 * @param vView
86 **/
87 public void addView(View vView)
88 throws java.lang.IndexOutOfBoundsException
89 {
90 _viewList.addElement(vView);
91 } //-- void addView(View)
92
93 /***
94 *
95 *
96 * @param index
97 * @param vView
98 **/
99 public void addView(int index, View vView)
100 throws java.lang.IndexOutOfBoundsException
101 {
102 _viewList.insertElementAt(vView, index);
103 } //-- void addView(int, View)
104
105 /***
106 **/
107 public java.util.Enumeration enumerateTable()
108 {
109 return _tableList.elements();
110 } //-- java.util.Enumeration enumerateTable()
111
112 /***
113 **/
114 public java.util.Enumeration enumerateView()
115 {
116 return _viewList.elements();
117 } //-- java.util.Enumeration enumerateView()
118
119 /***
120 * Returns the value of field 'name'.
121 *
122 * @return the value of field 'name'.
123 **/
124 public java.lang.String getName()
125 {
126 return this._name;
127 } //-- java.lang.String getName()
128
129 /***
130 *
131 *
132 * @param index
133 **/
134 public Table getTable(int index)
135 throws java.lang.IndexOutOfBoundsException
136 {
137 //-- check bounds for index
138 if ((index < 0) || (index > _tableList.size())) {
139 throw new IndexOutOfBoundsException();
140 }
141
142 return (Table) _tableList.elementAt(index);
143 } //-- Table getTable(int)
144
145 /***
146 **/
147 public Table[] getTable()
148 {
149 int size = _tableList.size();
150 Table[] mArray = new Table[size];
151 for (int index = 0; index < size; index++) {
152 mArray[index] = (Table) _tableList.elementAt(index);
153 }
154 return mArray;
155 } //-- Table[] getTable()
156
157 /***
158 **/
159 public int getTableCount()
160 {
161 return _tableList.size();
162 } //-- int getTableCount()
163
164 /***
165 *
166 *
167 * @param index
168 **/
169 public View getView(int index)
170 throws java.lang.IndexOutOfBoundsException
171 {
172 //-- check bounds for index
173 if ((index < 0) || (index > _viewList.size())) {
174 throw new IndexOutOfBoundsException();
175 }
176
177 return (View) _viewList.elementAt(index);
178 } //-- View getView(int)
179
180 /***
181 **/
182 public View[] getView()
183 {
184 int size = _viewList.size();
185 View[] mArray = new View[size];
186 for (int index = 0; index < size; index++) {
187 mArray[index] = (View) _viewList.elementAt(index);
188 }
189 return mArray;
190 } //-- View[] getView()
191
192 /***
193 **/
194 public int getViewCount()
195 {
196 return _viewList.size();
197 } //-- int getViewCount()
198
199 /***
200 **/
201 public boolean isValid()
202 {
203 try {
204 validate();
205 }
206 catch (org.exolab.castor.xml.ValidationException vex) {
207 return false;
208 }
209 return true;
210 } //-- boolean isValid()
211
212 /***
213 *
214 *
215 * @param out
216 **/
217 public void marshal(java.io.Writer out)
218 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
219 {
220
221 Marshaller.marshal(this, out);
222 } //-- void marshal(java.io.Writer)
223
224 /***
225 *
226 *
227 * @param handler
228 **/
229 public void marshal(org.xml.sax.ContentHandler handler)
230 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
231 {
232
233 Marshaller.marshal(this, handler);
234 } //-- void marshal(org.xml.sax.ContentHandler)
235
236 /***
237 **/
238 public void removeAllTable()
239 {
240 _tableList.removeAllElements();
241 } //-- void removeAllTable()
242
243 /***
244 **/
245 public void removeAllView()
246 {
247 _viewList.removeAllElements();
248 } //-- void removeAllView()
249
250 /***
251 *
252 *
253 * @param index
254 **/
255 public Table removeTable(int index)
256 {
257 java.lang.Object obj = _tableList.elementAt(index);
258 _tableList.removeElementAt(index);
259 return (Table) obj;
260 } //-- Table removeTable(int)
261
262 /***
263 *
264 *
265 * @param index
266 **/
267 public View removeView(int index)
268 {
269 java.lang.Object obj = _viewList.elementAt(index);
270 _viewList.removeElementAt(index);
271 return (View) obj;
272 } //-- View removeView(int)
273
274 /***
275 * Sets the value of field 'name'.
276 *
277 * @param name the value of field 'name'.
278 **/
279 public void setName(java.lang.String name)
280 {
281 this._name = name;
282 } //-- void setName(java.lang.String)
283
284 /***
285 *
286 *
287 * @param index
288 * @param vTable
289 **/
290 public void setTable(int index, Table vTable)
291 throws java.lang.IndexOutOfBoundsException
292 {
293 //-- check bounds for index
294 if ((index < 0) || (index > _tableList.size())) {
295 throw new IndexOutOfBoundsException();
296 }
297 _tableList.setElementAt(vTable, index);
298 } //-- void setTable(int, Table)
299
300 /***
301 *
302 *
303 * @param tableArray
304 **/
305 public void setTable(Table[] tableArray)
306 {
307 //-- copy array
308 _tableList.removeAllElements();
309 for (int i = 0; i < tableArray.length; i++) {
310 _tableList.addElement(tableArray[i]);
311 }
312 } //-- void setTable(Table)
313
314 /***
315 *
316 *
317 * @param index
318 * @param vView
319 **/
320 public void setView(int index, View vView)
321 throws java.lang.IndexOutOfBoundsException
322 {
323 //-- check bounds for index
324 if ((index < 0) || (index > _viewList.size())) {
325 throw new IndexOutOfBoundsException();
326 }
327 _viewList.setElementAt(vView, index);
328 } //-- void setView(int, View)
329
330 /***
331 *
332 *
333 * @param viewArray
334 **/
335 public void setView(View[] viewArray)
336 {
337 //-- copy array
338 _viewList.removeAllElements();
339 for (int i = 0; i < viewArray.length; i++) {
340 _viewList.addElement(viewArray[i]);
341 }
342 } //-- void setView(View)
343
344 /***
345 *
346 *
347 * @param reader
348 **/
349 public static org.enableit.db.beans.Schema unmarshal(java.io.Reader reader)
350 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
351 {
352 return (org.enableit.db.beans.Schema) Unmarshaller.unmarshal(org.enableit.db.beans.Schema.class, reader);
353 } //-- org.enableit.db.beans.Schema unmarshal(java.io.Reader)
354
355 /***
356 **/
357 public void validate()
358 throws org.exolab.castor.xml.ValidationException
359 {
360 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
361 validator.validate(this);
362 } //-- void validate()
363
364 }
This page was automatically generated by Maven