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 TableTypes implements java.io.Serializable {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.util.Vector _nameList;
38
39
40 //----------------/
41 //- Constructors -/
42 //----------------/
43
44 public TableTypes() {
45 super();
46 _nameList = new Vector();
47 } //-- org.enableit.db.beans.TableTypes()
48
49
50 //-----------/
51 //- Methods -/
52 //-----------/
53
54 /***
55 *
56 *
57 * @param vName
58 **/
59 public void addName(java.lang.String vName)
60 throws java.lang.IndexOutOfBoundsException
61 {
62 _nameList.addElement(vName);
63 } //-- void addName(java.lang.String)
64
65 /***
66 *
67 *
68 * @param index
69 * @param vName
70 **/
71 public void addName(int index, java.lang.String vName)
72 throws java.lang.IndexOutOfBoundsException
73 {
74 _nameList.insertElementAt(vName, index);
75 } //-- void addName(int, java.lang.String)
76
77 /***
78 **/
79 public java.util.Enumeration enumerateName()
80 {
81 return _nameList.elements();
82 } //-- java.util.Enumeration enumerateName()
83
84 /***
85 *
86 *
87 * @param index
88 **/
89 public java.lang.String getName(int index)
90 throws java.lang.IndexOutOfBoundsException
91 {
92 //-- check bounds for index
93 if ((index < 0) || (index > _nameList.size())) {
94 throw new IndexOutOfBoundsException();
95 }
96
97 return (String)_nameList.elementAt(index);
98 } //-- java.lang.String getName(int)
99
100 /***
101 **/
102 public java.lang.String[] getName()
103 {
104 int size = _nameList.size();
105 java.lang.String[] mArray = new java.lang.String[size];
106 for (int index = 0; index < size; index++) {
107 mArray[index] = (String)_nameList.elementAt(index);
108 }
109 return mArray;
110 } //-- java.lang.String[] getName()
111
112 /***
113 **/
114 public int getNameCount()
115 {
116 return _nameList.size();
117 } //-- int getNameCount()
118
119 /***
120 **/
121 public boolean isValid()
122 {
123 try {
124 validate();
125 }
126 catch (org.exolab.castor.xml.ValidationException vex) {
127 return false;
128 }
129 return true;
130 } //-- boolean isValid()
131
132 /***
133 *
134 *
135 * @param out
136 **/
137 public void marshal(java.io.Writer out)
138 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
139 {
140
141 Marshaller.marshal(this, out);
142 } //-- void marshal(java.io.Writer)
143
144 /***
145 *
146 *
147 * @param handler
148 **/
149 public void marshal(org.xml.sax.ContentHandler handler)
150 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
151 {
152
153 Marshaller.marshal(this, handler);
154 } //-- void marshal(org.xml.sax.ContentHandler)
155
156 /***
157 **/
158 public void removeAllName()
159 {
160 _nameList.removeAllElements();
161 } //-- void removeAllName()
162
163 /***
164 *
165 *
166 * @param index
167 **/
168 public java.lang.String removeName(int index)
169 {
170 java.lang.Object obj = _nameList.elementAt(index);
171 _nameList.removeElementAt(index);
172 return (String)obj;
173 } //-- java.lang.String removeName(int)
174
175 /***
176 *
177 *
178 * @param index
179 * @param vName
180 **/
181 public void setName(int index, java.lang.String vName)
182 throws java.lang.IndexOutOfBoundsException
183 {
184 //-- check bounds for index
185 if ((index < 0) || (index > _nameList.size())) {
186 throw new IndexOutOfBoundsException();
187 }
188 _nameList.setElementAt(vName, index);
189 } //-- void setName(int, java.lang.String)
190
191 /***
192 *
193 *
194 * @param nameArray
195 **/
196 public void setName(java.lang.String[] nameArray)
197 {
198 //-- copy array
199 _nameList.removeAllElements();
200 for (int i = 0; i < nameArray.length; i++) {
201 _nameList.addElement(nameArray[i]);
202 }
203 } //-- void setName(java.lang.String)
204
205 /***
206 *
207 *
208 * @param reader
209 **/
210 public static org.enableit.db.beans.TableTypes unmarshal(java.io.Reader reader)
211 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
212 {
213 return (org.enableit.db.beans.TableTypes) Unmarshaller.unmarshal(org.enableit.db.beans.TableTypes.class, reader);
214 } //-- org.enableit.db.beans.TableTypes unmarshal(java.io.Reader)
215
216 /***
217 **/
218 public void validate()
219 throws org.exolab.castor.xml.ValidationException
220 {
221 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
222 validator.validate(this);
223 } //-- void validate()
224
225 }
This page was automatically generated by Maven