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 org.exolab.castor.mapping.AccessMode; 15 import org.exolab.castor.mapping.ClassDescriptor; 16 import org.exolab.castor.mapping.FieldDescriptor; 17 import org.exolab.castor.xml.*; 18 import org.exolab.castor.xml.FieldValidator; 19 import org.exolab.castor.xml.TypeValidator; 20 import org.exolab.castor.xml.XMLFieldDescriptor; 21 import org.exolab.castor.xml.handlers.*; 22 import org.exolab.castor.xml.util.XMLFieldDescriptorImpl; 23 import org.exolab.castor.xml.validators.*; 24 25 /*** 26 * 27 * 28 * @version $Revision$ $Date$ 29 **/ 30 public class DarrtDbmsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { 31 32 33 //--------------------------/ 34 //- Class/Member Variables -/ 35 //--------------------------/ 36 37 private java.lang.String nsPrefix; 38 39 private java.lang.String nsURI; 40 41 private java.lang.String xmlName; 42 43 private org.exolab.castor.xml.XMLFieldDescriptor identity; 44 45 46 //----------------/ 47 //- Constructors -/ 48 //----------------/ 49 50 public DarrtDbmsDescriptor() { 51 super(); 52 xmlName = "darrt-dbms"; 53 54 //-- set grouping compositor 55 setCompositorAsSequence(); 56 XMLFieldDescriptorImpl desc = null; 57 XMLFieldHandler handler = null; 58 FieldValidator fieldValidator = null; 59 //-- initialize attribute descriptors 60 61 //-- _maxTableNameLength 62 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_maxTableNameLength", "max-table-name-length", NodeType.Attribute); 63 desc.setImmutable(true); 64 handler = (new XMLFieldHandler() { 65 public java.lang.Object getValue( java.lang.Object object ) 66 throws IllegalStateException 67 { 68 DarrtDbms target = (DarrtDbms) object; 69 return target.getMaxTableNameLength(); 70 } 71 public void setValue( java.lang.Object object, java.lang.Object value) 72 throws IllegalStateException, IllegalArgumentException 73 { 74 try { 75 DarrtDbms target = (DarrtDbms) object; 76 target.setMaxTableNameLength( (java.lang.String) value); 77 } 78 catch (Exception ex) { 79 throw new IllegalStateException(ex.toString()); 80 } 81 } 82 public java.lang.Object newInstance( java.lang.Object parent ) { 83 return null; 84 } 85 } ); 86 desc.setHandler(handler); 87 desc.setRequired(true); 88 addFieldDescriptor(desc); 89 90 //-- validation code for: _maxTableNameLength 91 fieldValidator = new FieldValidator(); 92 fieldValidator.setMinOccurs(1); 93 { //-- local scope 94 StringValidator typeValidator = new StringValidator(); 95 typeValidator.setWhiteSpace("preserve"); 96 fieldValidator.setValidator(typeValidator); 97 } 98 desc.setValidator(fieldValidator); 99 //-- _name 100 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", NodeType.Attribute); 101 desc.setImmutable(true); 102 handler = (new XMLFieldHandler() { 103 public java.lang.Object getValue( java.lang.Object object ) 104 throws IllegalStateException 105 { 106 DarrtDbms target = (DarrtDbms) object; 107 return target.getName(); 108 } 109 public void setValue( java.lang.Object object, java.lang.Object value) 110 throws IllegalStateException, IllegalArgumentException 111 { 112 try { 113 DarrtDbms target = (DarrtDbms) object; 114 target.setName( (java.lang.String) value); 115 } 116 catch (Exception ex) { 117 throw new IllegalStateException(ex.toString()); 118 } 119 } 120 public java.lang.Object newInstance( java.lang.Object parent ) { 121 return null; 122 } 123 } ); 124 desc.setHandler(handler); 125 desc.setRequired(true); 126 addFieldDescriptor(desc); 127 128 //-- validation code for: _name 129 fieldValidator = new FieldValidator(); 130 fieldValidator.setMinOccurs(1); 131 { //-- local scope 132 StringValidator typeValidator = new StringValidator(); 133 typeValidator.setWhiteSpace("preserve"); 134 fieldValidator.setValidator(typeValidator); 135 } 136 desc.setValidator(fieldValidator); 137 //-- _notNull 138 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_notNull", "not-null", NodeType.Attribute); 139 desc.setImmutable(true); 140 handler = (new XMLFieldHandler() { 141 public java.lang.Object getValue( java.lang.Object object ) 142 throws IllegalStateException 143 { 144 DarrtDbms target = (DarrtDbms) object; 145 return target.getNotNull(); 146 } 147 public void setValue( java.lang.Object object, java.lang.Object value) 148 throws IllegalStateException, IllegalArgumentException 149 { 150 try { 151 DarrtDbms target = (DarrtDbms) object; 152 target.setNotNull( (java.lang.String) value); 153 } 154 catch (Exception ex) { 155 throw new IllegalStateException(ex.toString()); 156 } 157 } 158 public java.lang.Object newInstance( java.lang.Object parent ) { 159 return null; 160 } 161 } ); 162 desc.setHandler(handler); 163 desc.setRequired(true); 164 addFieldDescriptor(desc); 165 166 //-- validation code for: _notNull 167 fieldValidator = new FieldValidator(); 168 fieldValidator.setMinOccurs(1); 169 { //-- local scope 170 StringValidator typeValidator = new StringValidator(); 171 typeValidator.setWhiteSpace("preserve"); 172 fieldValidator.setValidator(typeValidator); 173 } 174 desc.setValidator(fieldValidator); 175 //-- _null 176 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_null", "null", NodeType.Attribute); 177 desc.setImmutable(true); 178 handler = (new XMLFieldHandler() { 179 public java.lang.Object getValue( java.lang.Object object ) 180 throws IllegalStateException 181 { 182 DarrtDbms target = (DarrtDbms) object; 183 return target.getNull(); 184 } 185 public void setValue( java.lang.Object object, java.lang.Object value) 186 throws IllegalStateException, IllegalArgumentException 187 { 188 try { 189 DarrtDbms target = (DarrtDbms) object; 190 target.setNull( (java.lang.String) value); 191 } 192 catch (Exception ex) { 193 throw new IllegalStateException(ex.toString()); 194 } 195 } 196 public java.lang.Object newInstance( java.lang.Object parent ) { 197 return null; 198 } 199 } ); 200 desc.setHandler(handler); 201 desc.setRequired(true); 202 addFieldDescriptor(desc); 203 204 //-- validation code for: _null 205 fieldValidator = new FieldValidator(); 206 fieldValidator.setMinOccurs(1); 207 { //-- local scope 208 StringValidator typeValidator = new StringValidator(); 209 typeValidator.setWhiteSpace("preserve"); 210 fieldValidator.setValidator(typeValidator); 211 } 212 desc.setValidator(fieldValidator); 213 //-- _modifyColumn 214 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_modifyColumn", "modify-column", NodeType.Attribute); 215 desc.setImmutable(true); 216 handler = (new XMLFieldHandler() { 217 public java.lang.Object getValue( java.lang.Object object ) 218 throws IllegalStateException 219 { 220 DarrtDbms target = (DarrtDbms) object; 221 return target.getModifyColumn(); 222 } 223 public void setValue( java.lang.Object object, java.lang.Object value) 224 throws IllegalStateException, IllegalArgumentException 225 { 226 try { 227 DarrtDbms target = (DarrtDbms) object; 228 target.setModifyColumn( (java.lang.String) value); 229 } 230 catch (Exception ex) { 231 throw new IllegalStateException(ex.toString()); 232 } 233 } 234 public java.lang.Object newInstance( java.lang.Object parent ) { 235 return null; 236 } 237 } ); 238 desc.setHandler(handler); 239 desc.setRequired(true); 240 addFieldDescriptor(desc); 241 242 //-- validation code for: _modifyColumn 243 fieldValidator = new FieldValidator(); 244 fieldValidator.setMinOccurs(1); 245 { //-- local scope 246 StringValidator typeValidator = new StringValidator(); 247 typeValidator.setWhiteSpace("preserve"); 248 fieldValidator.setValidator(typeValidator); 249 } 250 desc.setValidator(fieldValidator); 251 //-- _parenthesesWrappedDdlColumns 252 desc = new XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_parenthesesWrappedDdlColumns", "parentheses-wrapped-ddl-columns", NodeType.Attribute); 253 handler = (new XMLFieldHandler() { 254 public java.lang.Object getValue( java.lang.Object object ) 255 throws IllegalStateException 256 { 257 DarrtDbms target = (DarrtDbms) object; 258 if(!target.hasParenthesesWrappedDdlColumns()) 259 return null; 260 return new Boolean(target.getParenthesesWrappedDdlColumns()); 261 } 262 public void setValue( java.lang.Object object, java.lang.Object value) 263 throws IllegalStateException, IllegalArgumentException 264 { 265 try { 266 DarrtDbms target = (DarrtDbms) object; 267 // ignore null values for non optional primitives 268 if (value == null) return; 269 270 target.setParenthesesWrappedDdlColumns( ((Boolean)value).booleanValue()); 271 } 272 catch (Exception ex) { 273 throw new IllegalStateException(ex.toString()); 274 } 275 } 276 public java.lang.Object newInstance( java.lang.Object parent ) { 277 return null; 278 } 279 } ); 280 desc.setHandler(handler); 281 desc.setRequired(true); 282 addFieldDescriptor(desc); 283 284 //-- validation code for: _parenthesesWrappedDdlColumns 285 fieldValidator = new FieldValidator(); 286 fieldValidator.setMinOccurs(1); 287 { //-- local scope 288 BooleanValidator typeValidator = new BooleanValidator(); 289 fieldValidator.setValidator(typeValidator); 290 } 291 desc.setValidator(fieldValidator); 292 //-- _primaryKey 293 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_primaryKey", "primary-key", NodeType.Attribute); 294 desc.setImmutable(true); 295 handler = (new XMLFieldHandler() { 296 public java.lang.Object getValue( java.lang.Object object ) 297 throws IllegalStateException 298 { 299 DarrtDbms target = (DarrtDbms) object; 300 return target.getPrimaryKey(); 301 } 302 public void setValue( java.lang.Object object, java.lang.Object value) 303 throws IllegalStateException, IllegalArgumentException 304 { 305 try { 306 DarrtDbms target = (DarrtDbms) object; 307 target.setPrimaryKey( (java.lang.String) value); 308 } 309 catch (Exception ex) { 310 throw new IllegalStateException(ex.toString()); 311 } 312 } 313 public java.lang.Object newInstance( java.lang.Object parent ) { 314 return null; 315 } 316 } ); 317 desc.setHandler(handler); 318 desc.setRequired(true); 319 addFieldDescriptor(desc); 320 321 //-- validation code for: _primaryKey 322 fieldValidator = new FieldValidator(); 323 fieldValidator.setMinOccurs(1); 324 { //-- local scope 325 StringValidator typeValidator = new StringValidator(); 326 typeValidator.setWhiteSpace("preserve"); 327 fieldValidator.setValidator(typeValidator); 328 } 329 desc.setValidator(fieldValidator); 330 //-- _autoincrement 331 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_autoincrement", "autoincrement", NodeType.Attribute); 332 desc.setImmutable(true); 333 handler = (new XMLFieldHandler() { 334 public java.lang.Object getValue( java.lang.Object object ) 335 throws IllegalStateException 336 { 337 DarrtDbms target = (DarrtDbms) object; 338 return target.getAutoincrement(); 339 } 340 public void setValue( java.lang.Object object, java.lang.Object value) 341 throws IllegalStateException, IllegalArgumentException 342 { 343 try { 344 DarrtDbms target = (DarrtDbms) object; 345 target.setAutoincrement( (java.lang.String) value); 346 } 347 catch (Exception ex) { 348 throw new IllegalStateException(ex.toString()); 349 } 350 } 351 public java.lang.Object newInstance( java.lang.Object parent ) { 352 return null; 353 } 354 } ); 355 desc.setHandler(handler); 356 desc.setRequired(true); 357 addFieldDescriptor(desc); 358 359 //-- validation code for: _autoincrement 360 fieldValidator = new FieldValidator(); 361 fieldValidator.setMinOccurs(1); 362 { //-- local scope 363 StringValidator typeValidator = new StringValidator(); 364 typeValidator.setWhiteSpace("preserve"); 365 fieldValidator.setValidator(typeValidator); 366 } 367 desc.setValidator(fieldValidator); 368 //-- _default 369 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_default", "default", NodeType.Attribute); 370 desc.setImmutable(true); 371 handler = (new XMLFieldHandler() { 372 public java.lang.Object getValue( java.lang.Object object ) 373 throws IllegalStateException 374 { 375 DarrtDbms target = (DarrtDbms) object; 376 return target.getDefault(); 377 } 378 public void setValue( java.lang.Object object, java.lang.Object value) 379 throws IllegalStateException, IllegalArgumentException 380 { 381 try { 382 DarrtDbms target = (DarrtDbms) object; 383 target.setDefault( (java.lang.String) value); 384 } 385 catch (Exception ex) { 386 throw new IllegalStateException(ex.toString()); 387 } 388 } 389 public java.lang.Object newInstance( java.lang.Object parent ) { 390 return null; 391 } 392 } ); 393 desc.setHandler(handler); 394 desc.setRequired(true); 395 addFieldDescriptor(desc); 396 397 //-- validation code for: _default 398 fieldValidator = new FieldValidator(); 399 fieldValidator.setMinOccurs(1); 400 { //-- local scope 401 StringValidator typeValidator = new StringValidator(); 402 typeValidator.setWhiteSpace("preserve"); 403 fieldValidator.setValidator(typeValidator); 404 } 405 desc.setValidator(fieldValidator); 406 //-- initialize element descriptors 407 408 //-- _functionList 409 desc = new XMLFieldDescriptorImpl(Function.class, "_functionList", "function", NodeType.Element); 410 handler = (new XMLFieldHandler() { 411 public java.lang.Object getValue( java.lang.Object object ) 412 throws IllegalStateException 413 { 414 DarrtDbms target = (DarrtDbms) object; 415 return target.getFunction(); 416 } 417 public void setValue( java.lang.Object object, java.lang.Object value) 418 throws IllegalStateException, IllegalArgumentException 419 { 420 try { 421 DarrtDbms target = (DarrtDbms) object; 422 target.addFunction( (Function) value); 423 } 424 catch (Exception ex) { 425 throw new IllegalStateException(ex.toString()); 426 } 427 } 428 public java.lang.Object newInstance( java.lang.Object parent ) { 429 return new Function(); 430 } 431 } ); 432 desc.setHandler(handler); 433 desc.setMultivalued(true); 434 addFieldDescriptor(desc); 435 436 //-- validation code for: _functionList 437 fieldValidator = new FieldValidator(); 438 fieldValidator.setMinOccurs(0); 439 { //-- local scope 440 } 441 desc.setValidator(fieldValidator); 442 //-- _jdbcMappingList 443 desc = new XMLFieldDescriptorImpl(JdbcMapping.class, "_jdbcMappingList", "jdbc-mapping", NodeType.Element); 444 handler = (new XMLFieldHandler() { 445 public java.lang.Object getValue( java.lang.Object object ) 446 throws IllegalStateException 447 { 448 DarrtDbms target = (DarrtDbms) object; 449 return target.getJdbcMapping(); 450 } 451 public void setValue( java.lang.Object object, java.lang.Object value) 452 throws IllegalStateException, IllegalArgumentException 453 { 454 try { 455 DarrtDbms target = (DarrtDbms) object; 456 target.addJdbcMapping( (JdbcMapping) value); 457 } 458 catch (Exception ex) { 459 throw new IllegalStateException(ex.toString()); 460 } 461 } 462 public java.lang.Object newInstance( java.lang.Object parent ) { 463 return new JdbcMapping(); 464 } 465 } ); 466 desc.setHandler(handler); 467 desc.setMultivalued(true); 468 addFieldDescriptor(desc); 469 470 //-- validation code for: _jdbcMappingList 471 fieldValidator = new FieldValidator(); 472 fieldValidator.setMinOccurs(0); 473 { //-- local scope 474 } 475 desc.setValidator(fieldValidator); 476 } //-- org.enableit.db.beans.DarrtDbmsDescriptor() 477 478 479 //-----------/ 480 //- Methods -/ 481 //-----------/ 482 483 /*** 484 **/ 485 public org.exolab.castor.mapping.AccessMode getAccessMode() 486 { 487 return null; 488 } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 489 490 /*** 491 **/ 492 public org.exolab.castor.mapping.ClassDescriptor getExtends() 493 { 494 return null; 495 } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 496 497 /*** 498 **/ 499 public org.exolab.castor.mapping.FieldDescriptor getIdentity() 500 { 501 return identity; 502 } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 503 504 /*** 505 **/ 506 public java.lang.Class getJavaClass() 507 { 508 return org.enableit.db.beans.DarrtDbms.class; 509 } //-- java.lang.Class getJavaClass() 510 511 /*** 512 **/ 513 public java.lang.String getNameSpacePrefix() 514 { 515 return nsPrefix; 516 } //-- java.lang.String getNameSpacePrefix() 517 518 /*** 519 **/ 520 public java.lang.String getNameSpaceURI() 521 { 522 return nsURI; 523 } //-- java.lang.String getNameSpaceURI() 524 525 /*** 526 **/ 527 public org.exolab.castor.xml.TypeValidator getValidator() 528 { 529 return this; 530 } //-- org.exolab.castor.xml.TypeValidator getValidator() 531 532 /*** 533 **/ 534 public java.lang.String getXMLName() 535 { 536 return xmlName; 537 } //-- java.lang.String getXMLName() 538 539 }

This page was automatically generated by Maven