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 View implements java.io.Serializable {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.lang.String _name;
38
39 private java.lang.String _type;
40
41 private java.util.Vector _columnList;
42
43 private java.lang.String _definition;
44
45
46 //----------------/
47 //- Constructors -/
48 //----------------/
49
50 public View() {
51 super();
52 _columnList = new Vector();
53 } //-- org.enableit.db.beans.View()
54
55
56 //-----------/
57 //- Methods -/
58 //-----------/
59
60 /***
61 *
62 *
63 * @param vColumn
64 **/
65 public void addColumn(Column vColumn)
66 throws java.lang.IndexOutOfBoundsException
67 {
68 _columnList.addElement(vColumn);
69 } //-- void addColumn(Column)
70
71 /***
72 *
73 *
74 * @param index
75 * @param vColumn
76 **/
77 public void addColumn(int index, Column vColumn)
78 throws java.lang.IndexOutOfBoundsException
79 {
80 _columnList.insertElementAt(vColumn, index);
81 } //-- void addColumn(int, Column)
82
83 /***
84 **/
85 public java.util.Enumeration enumerateColumn()
86 {
87 return _columnList.elements();
88 } //-- java.util.Enumeration enumerateColumn()
89
90 /***
91 *
92 *
93 * @param index
94 **/
95 public Column getColumn(int index)
96 throws java.lang.IndexOutOfBoundsException
97 {
98 //-- check bounds for index
99 if ((index < 0) || (index > _columnList.size())) {
100 throw new IndexOutOfBoundsException();
101 }
102
103 return (Column) _columnList.elementAt(index);
104 } //-- Column getColumn(int)
105
106 /***
107 **/
108 public Column[] getColumn()
109 {
110 int size = _columnList.size();
111 Column[] mArray = new Column[size];
112 for (int index = 0; index < size; index++) {
113 mArray[index] = (Column) _columnList.elementAt(index);
114 }
115 return mArray;
116 } //-- Column[] getColumn()
117
118 /***
119 **/
120 public int getColumnCount()
121 {
122 return _columnList.size();
123 } //-- int getColumnCount()
124
125 /***
126 * Returns the value of field 'definition'.
127 *
128 * @return the value of field 'definition'.
129 **/
130 public java.lang.String getDefinition()
131 {
132 return this._definition;
133 } //-- java.lang.String getDefinition()
134
135 /***
136 * Returns the value of field 'name'.
137 *
138 * @return the value of field 'name'.
139 **/
140 public java.lang.String getName()
141 {
142 return this._name;
143 } //-- java.lang.String getName()
144
145 /***
146 * Returns the value of field 'type'.
147 *
148 * @return the value of field 'type'.
149 **/
150 public java.lang.String getType()
151 {
152 return this._type;
153 } //-- java.lang.String getType()
154
155 /***
156 **/
157 public boolean isValid()
158 {
159 try {
160 validate();
161 }
162 catch (org.exolab.castor.xml.ValidationException vex) {
163 return false;
164 }
165 return true;
166 } //-- boolean isValid()
167
168 /***
169 *
170 *
171 * @param out
172 **/
173 public void marshal(java.io.Writer out)
174 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
175 {
176
177 Marshaller.marshal(this, out);
178 } //-- void marshal(java.io.Writer)
179
180 /***
181 *
182 *
183 * @param handler
184 **/
185 public void marshal(org.xml.sax.ContentHandler handler)
186 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
187 {
188
189 Marshaller.marshal(this, handler);
190 } //-- void marshal(org.xml.sax.ContentHandler)
191
192 /***
193 **/
194 public void removeAllColumn()
195 {
196 _columnList.removeAllElements();
197 } //-- void removeAllColumn()
198
199 /***
200 *
201 *
202 * @param index
203 **/
204 public Column removeColumn(int index)
205 {
206 java.lang.Object obj = _columnList.elementAt(index);
207 _columnList.removeElementAt(index);
208 return (Column) obj;
209 } //-- Column removeColumn(int)
210
211 /***
212 *
213 *
214 * @param index
215 * @param vColumn
216 **/
217 public void setColumn(int index, Column vColumn)
218 throws java.lang.IndexOutOfBoundsException
219 {
220 //-- check bounds for index
221 if ((index < 0) || (index > _columnList.size())) {
222 throw new IndexOutOfBoundsException();
223 }
224 _columnList.setElementAt(vColumn, index);
225 } //-- void setColumn(int, Column)
226
227 /***
228 *
229 *
230 * @param columnArray
231 **/
232 public void setColumn(Column[] columnArray)
233 {
234 //-- copy array
235 _columnList.removeAllElements();
236 for (int i = 0; i < columnArray.length; i++) {
237 _columnList.addElement(columnArray[i]);
238 }
239 } //-- void setColumn(Column)
240
241 /***
242 * Sets the value of field 'definition'.
243 *
244 * @param definition the value of field 'definition'.
245 **/
246 public void setDefinition(java.lang.String definition)
247 {
248 this._definition = definition;
249 } //-- void setDefinition(java.lang.String)
250
251 /***
252 * Sets the value of field 'name'.
253 *
254 * @param name the value of field 'name'.
255 **/
256 public void setName(java.lang.String name)
257 {
258 this._name = name;
259 } //-- void setName(java.lang.String)
260
261 /***
262 * Sets the value of field 'type'.
263 *
264 * @param type the value of field 'type'.
265 **/
266 public void setType(java.lang.String type)
267 {
268 this._type = type;
269 } //-- void setType(java.lang.String)
270
271 /***
272 *
273 *
274 * @param reader
275 **/
276 public static org.enableit.db.beans.View unmarshal(java.io.Reader reader)
277 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
278 {
279 return (org.enableit.db.beans.View) Unmarshaller.unmarshal(org.enableit.db.beans.View.class, reader);
280 } //-- org.enableit.db.beans.View unmarshal(java.io.Reader)
281
282 /***
283 **/
284 public void validate()
285 throws org.exolab.castor.xml.ValidationException
286 {
287 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
288 validator.validate(this);
289 } //-- void validate()
290
291 }
This page was automatically generated by Maven