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