1 7 package org.enhydra.dods.editor.Doml.impl; 8 9 import java.util.Collection ; 10 11 import org.eclipse.emf.common.notify.Notification; 12 import org.eclipse.emf.common.notify.NotificationChain; 13 14 import org.eclipse.emf.common.util.EList; 15 16 import org.eclipse.emf.ecore.EClass; 17 import org.eclipse.emf.ecore.EStructuralFeature; 18 import org.eclipse.emf.ecore.InternalEObject; 19 20 import org.eclipse.emf.ecore.impl.ENotificationImpl; 21 import org.eclipse.emf.ecore.impl.EObjectImpl; 22 23 import org.eclipse.emf.ecore.util.EObjectContainmentEList; 24 import org.eclipse.emf.ecore.util.InternalEList; 25 26 import org.enhydra.dods.editor.Doml.DatabaseType; 27 import org.enhydra.dods.editor.Doml.DbVendor; 28 import org.enhydra.dods.editor.Doml.DomlPackage; 29 import org.enhydra.dods.editor.Doml.PackageType; 30 import org.enhydra.dods.editor.Doml.TrueFalse; 31 32 51 public class DatabaseTypeImpl extends EObjectImpl implements DatabaseType { 52 60 protected EList package_ = null; 61 62 70 protected static final DbVendor DATABASE_EDEFAULT = DbVendor.STANDARD_LITERAL; 71 72 80 protected DbVendor database = DATABASE_EDEFAULT; 81 82 89 protected boolean databaseESet = false; 90 91 99 protected static final TrueFalse GENERATE_INSECURE_EDEFAULT = TrueFalse.TRUE_LITERAL; 100 101 109 protected TrueFalse generateInsecure = GENERATE_INSECURE_EDEFAULT; 110 111 118 protected boolean generateInsecureESet = false; 119 120 128 protected static final TrueFalse GENERATE_SECURE_EDEFAULT = TrueFalse.FALSE_LITERAL; 129 130 138 protected TrueFalse generateSecure = GENERATE_SECURE_EDEFAULT; 139 140 147 protected boolean generateSecureESet = false; 148 149 157 protected static final TrueFalse MASS_DELETES_EDEFAULT = TrueFalse.FALSE_LITERAL; 158 159 167 protected TrueFalse massDeletes = MASS_DELETES_EDEFAULT; 168 169 176 protected boolean massDeletesESet = false; 177 178 186 protected static final TrueFalse MASS_UPDATES_EDEFAULT = TrueFalse.FALSE_LITERAL; 187 188 196 protected TrueFalse massUpdates = MASS_UPDATES_EDEFAULT; 197 198 205 protected boolean massUpdatesESet = false; 206 207 215 protected static final String TEMPLATESET_EDEFAULT = "Standard"; 216 217 225 protected String templateset = TEMPLATESET_EDEFAULT; 226 227 234 protected boolean templatesetESet = false; 235 236 241 protected DatabaseTypeImpl() { 242 super(); 243 } 244 245 250 protected EClass eStaticClass() { 251 return DomlPackage.eINSTANCE.getDatabaseType(); 252 } 253 254 259 public EList getPackage() { 260 if (package_ == null) { 261 package_ = new EObjectContainmentEList(PackageType.class, this, DomlPackage.DATABASE_TYPE__PACKAGE); 262 } 263 return package_; 264 } 265 266 271 public DbVendor getDatabase() { 272 return database; 273 } 274 275 280 public void setDatabase(DbVendor newDatabase) { 281 DbVendor oldDatabase = database; 282 database = newDatabase == null ? DATABASE_EDEFAULT : newDatabase; 283 boolean oldDatabaseESet = databaseESet; 284 databaseESet = true; 285 if (eNotificationRequired()) 286 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__DATABASE, oldDatabase, database, !oldDatabaseESet)); 287 } 288 289 294 public void unsetDatabase() { 295 DbVendor oldDatabase = database; 296 boolean oldDatabaseESet = databaseESet; 297 database = DATABASE_EDEFAULT; 298 databaseESet = false; 299 if (eNotificationRequired()) 300 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__DATABASE, oldDatabase, DATABASE_EDEFAULT, oldDatabaseESet)); 301 } 302 303 308 public boolean isSetDatabase() { 309 return databaseESet; 310 } 311 312 317 public TrueFalse getGenerateInsecure() { 318 return generateInsecure; 319 } 320 321 326 public void setGenerateInsecure(TrueFalse newGenerateInsecure) { 327 TrueFalse oldGenerateInsecure = generateInsecure; 328 generateInsecure = newGenerateInsecure == null ? GENERATE_INSECURE_EDEFAULT : newGenerateInsecure; 329 boolean oldGenerateInsecureESet = generateInsecureESet; 330 generateInsecureESet = true; 331 if (eNotificationRequired()) 332 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__GENERATE_INSECURE, oldGenerateInsecure, generateInsecure, !oldGenerateInsecureESet)); 333 } 334 335 340 public void unsetGenerateInsecure() { 341 TrueFalse oldGenerateInsecure = generateInsecure; 342 boolean oldGenerateInsecureESet = generateInsecureESet; 343 generateInsecure = GENERATE_INSECURE_EDEFAULT; 344 generateInsecureESet = false; 345 if (eNotificationRequired()) 346 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__GENERATE_INSECURE, oldGenerateInsecure, GENERATE_INSECURE_EDEFAULT, oldGenerateInsecureESet)); 347 } 348 349 354 public boolean isSetGenerateInsecure() { 355 return generateInsecureESet; 356 } 357 358 363 public TrueFalse getGenerateSecure() { 364 return generateSecure; 365 } 366 367 372 public void setGenerateSecure(TrueFalse newGenerateSecure) { 373 TrueFalse oldGenerateSecure = generateSecure; 374 generateSecure = newGenerateSecure == null ? GENERATE_SECURE_EDEFAULT : newGenerateSecure; 375 boolean oldGenerateSecureESet = generateSecureESet; 376 generateSecureESet = true; 377 if (eNotificationRequired()) 378 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__GENERATE_SECURE, oldGenerateSecure, generateSecure, !oldGenerateSecureESet)); 379 } 380 381 386 public void unsetGenerateSecure() { 387 TrueFalse oldGenerateSecure = generateSecure; 388 boolean oldGenerateSecureESet = generateSecureESet; 389 generateSecure = GENERATE_SECURE_EDEFAULT; 390 generateSecureESet = false; 391 if (eNotificationRequired()) 392 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__GENERATE_SECURE, oldGenerateSecure, GENERATE_SECURE_EDEFAULT, oldGenerateSecureESet)); 393 } 394 395 400 public boolean isSetGenerateSecure() { 401 return generateSecureESet; 402 } 403 404 409 public TrueFalse getMassDeletes() { 410 return massDeletes; 411 } 412 413 418 public void setMassDeletes(TrueFalse newMassDeletes) { 419 TrueFalse oldMassDeletes = massDeletes; 420 massDeletes = newMassDeletes == null ? MASS_DELETES_EDEFAULT : newMassDeletes; 421 boolean oldMassDeletesESet = massDeletesESet; 422 massDeletesESet = true; 423 if (eNotificationRequired()) 424 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__MASS_DELETES, oldMassDeletes, massDeletes, !oldMassDeletesESet)); 425 } 426 427 432 public void unsetMassDeletes() { 433 TrueFalse oldMassDeletes = massDeletes; 434 boolean oldMassDeletesESet = massDeletesESet; 435 massDeletes = MASS_DELETES_EDEFAULT; 436 massDeletesESet = false; 437 if (eNotificationRequired()) 438 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__MASS_DELETES, oldMassDeletes, MASS_DELETES_EDEFAULT, oldMassDeletesESet)); 439 } 440 441 446 public boolean isSetMassDeletes() { 447 return massDeletesESet; 448 } 449 450 455 public TrueFalse getMassUpdates() { 456 return massUpdates; 457 } 458 459 464 public void setMassUpdates(TrueFalse newMassUpdates) { 465 TrueFalse oldMassUpdates = massUpdates; 466 massUpdates = newMassUpdates == null ? MASS_UPDATES_EDEFAULT : newMassUpdates; 467 boolean oldMassUpdatesESet = massUpdatesESet; 468 massUpdatesESet = true; 469 if (eNotificationRequired()) 470 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__MASS_UPDATES, oldMassUpdates, massUpdates, !oldMassUpdatesESet)); 471 } 472 473 478 public void unsetMassUpdates() { 479 TrueFalse oldMassUpdates = massUpdates; 480 boolean oldMassUpdatesESet = massUpdatesESet; 481 massUpdates = MASS_UPDATES_EDEFAULT; 482 massUpdatesESet = false; 483 if (eNotificationRequired()) 484 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__MASS_UPDATES, oldMassUpdates, MASS_UPDATES_EDEFAULT, oldMassUpdatesESet)); 485 } 486 487 492 public boolean isSetMassUpdates() { 493 return massUpdatesESet; 494 } 495 496 501 public String getTemplateset() { 502 return templateset; 503 } 504 505 510 public void setTemplateset(String newTemplateset) { 511 String oldTemplateset = templateset; 512 templateset = newTemplateset; 513 boolean oldTemplatesetESet = templatesetESet; 514 templatesetESet = true; 515 if (eNotificationRequired()) 516 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.DATABASE_TYPE__TEMPLATESET, oldTemplateset, templateset, !oldTemplatesetESet)); 517 } 518 519 524 public void unsetTemplateset() { 525 String oldTemplateset = templateset; 526 boolean oldTemplatesetESet = templatesetESet; 527 templateset = TEMPLATESET_EDEFAULT; 528 templatesetESet = false; 529 if (eNotificationRequired()) 530 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.DATABASE_TYPE__TEMPLATESET, oldTemplateset, TEMPLATESET_EDEFAULT, oldTemplatesetESet)); 531 } 532 533 538 public boolean isSetTemplateset() { 539 return templatesetESet; 540 } 541 542 547 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 548 if (featureID >= 0) { 549 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 550 case DomlPackage.DATABASE_TYPE__PACKAGE: 551 return ((InternalEList)getPackage()).basicRemove(otherEnd, msgs); 552 default: 553 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 554 } 555 } 556 return eBasicSetContainer(null, featureID, msgs); 557 } 558 559 564 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 565 switch (eDerivedStructuralFeatureID(eFeature)) { 566 case DomlPackage.DATABASE_TYPE__PACKAGE: 567 return getPackage(); 568 case DomlPackage.DATABASE_TYPE__DATABASE: 569 return getDatabase(); 570 case DomlPackage.DATABASE_TYPE__GENERATE_INSECURE: 571 return getGenerateInsecure(); 572 case DomlPackage.DATABASE_TYPE__GENERATE_SECURE: 573 return getGenerateSecure(); 574 case DomlPackage.DATABASE_TYPE__MASS_DELETES: 575 return getMassDeletes(); 576 case DomlPackage.DATABASE_TYPE__MASS_UPDATES: 577 return getMassUpdates(); 578 case DomlPackage.DATABASE_TYPE__TEMPLATESET: 579 return getTemplateset(); 580 } 581 return eDynamicGet(eFeature, resolve); 582 } 583 584 589 public void eSet(EStructuralFeature eFeature, Object newValue) { 590 switch (eDerivedStructuralFeatureID(eFeature)) { 591 case DomlPackage.DATABASE_TYPE__PACKAGE: 592 getPackage().clear(); 593 getPackage().addAll((Collection )newValue); 594 return; 595 case DomlPackage.DATABASE_TYPE__DATABASE: 596 setDatabase((DbVendor)newValue); 597 return; 598 case DomlPackage.DATABASE_TYPE__GENERATE_INSECURE: 599 setGenerateInsecure((TrueFalse)newValue); 600 return; 601 case DomlPackage.DATABASE_TYPE__GENERATE_SECURE: 602 setGenerateSecure((TrueFalse)newValue); 603 return; 604 case DomlPackage.DATABASE_TYPE__MASS_DELETES: 605 setMassDeletes((TrueFalse)newValue); 606 return; 607 case DomlPackage.DATABASE_TYPE__MASS_UPDATES: 608 setMassUpdates((TrueFalse)newValue); 609 return; 610 case DomlPackage.DATABASE_TYPE__TEMPLATESET: 611 setTemplateset((String )newValue); 612 return; 613 } 614 eDynamicSet(eFeature, newValue); 615 } 616 617 622 public void eUnset(EStructuralFeature eFeature) { 623 switch (eDerivedStructuralFeatureID(eFeature)) { 624 case DomlPackage.DATABASE_TYPE__PACKAGE: 625 getPackage().clear(); 626 return; 627 case DomlPackage.DATABASE_TYPE__DATABASE: 628 unsetDatabase(); 629 return; 630 case DomlPackage.DATABASE_TYPE__GENERATE_INSECURE: 631 unsetGenerateInsecure(); 632 return; 633 case DomlPackage.DATABASE_TYPE__GENERATE_SECURE: 634 unsetGenerateSecure(); 635 return; 636 case DomlPackage.DATABASE_TYPE__MASS_DELETES: 637 unsetMassDeletes(); 638 return; 639 case DomlPackage.DATABASE_TYPE__MASS_UPDATES: 640 unsetMassUpdates(); 641 return; 642 case DomlPackage.DATABASE_TYPE__TEMPLATESET: 643 unsetTemplateset(); 644 return; 645 } 646 eDynamicUnset(eFeature); 647 } 648 649 654 public boolean eIsSet(EStructuralFeature eFeature) { 655 switch (eDerivedStructuralFeatureID(eFeature)) { 656 case DomlPackage.DATABASE_TYPE__PACKAGE: 657 return package_ != null && !package_.isEmpty(); 658 case DomlPackage.DATABASE_TYPE__DATABASE: 659 return isSetDatabase(); 660 case DomlPackage.DATABASE_TYPE__GENERATE_INSECURE: 661 return isSetGenerateInsecure(); 662 case DomlPackage.DATABASE_TYPE__GENERATE_SECURE: 663 return isSetGenerateSecure(); 664 case DomlPackage.DATABASE_TYPE__MASS_DELETES: 665 return isSetMassDeletes(); 666 case DomlPackage.DATABASE_TYPE__MASS_UPDATES: 667 return isSetMassUpdates(); 668 case DomlPackage.DATABASE_TYPE__TEMPLATESET: 669 return isSetTemplateset(); 670 } 671 return eDynamicIsSet(eFeature); 672 } 673 674 679 public String toString() { 680 if (eIsProxy()) return super.toString(); 681 682 StringBuffer result = new StringBuffer (super.toString()); 683 result.append(" (database: "); 684 if (databaseESet) result.append(database); else result.append("<unset>"); 685 result.append(", generateInsecure: "); 686 if (generateInsecureESet) result.append(generateInsecure); else result.append("<unset>"); 687 result.append(", generateSecure: "); 688 if (generateSecureESet) result.append(generateSecure); else result.append("<unset>"); 689 result.append(", massDeletes: "); 690 if (massDeletesESet) result.append(massDeletes); else result.append("<unset>"); 691 result.append(", massUpdates: "); 692 if (massUpdatesESet) result.append(massUpdates); else result.append("<unset>"); 693 result.append(", templateset: "); 694 if (templatesetESet) result.append(templateset); else result.append("<unset>"); 695 result.append(')'); 696 return result.toString(); 697 } 698 699 } | Popular Tags |