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

This page was automatically generated by Maven