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.ColumnType; 27 import org.enhydra.dods.editor.Doml.DirtyDO; 28 import org.enhydra.dods.editor.Doml.DomlPackage; 29 import org.enhydra.dods.editor.Doml.IndexType; 30 import org.enhydra.dods.editor.Doml.TableType; 31 import org.enhydra.dods.editor.Doml.TrueFalse; 32 33 56 public class TableTypeImpl extends EObjectImpl implements TableType { 57 65 protected EList column = null; 66 67 75 protected EList index = null; 76 77 85 protected static final String DB_TABLE_NAME_EDEFAULT = null; 86 87 95 protected String dbTableName = DB_TABLE_NAME_EDEFAULT; 96 97 105 protected static final DirtyDO DIRTY_DOS_EDEFAULT = DirtyDO.COMPATIBLE_LITERAL; 106 107 115 protected DirtyDO dirtyDOs = DIRTY_DOS_EDEFAULT; 116 117 124 protected boolean dirtyDOsESet = false; 125 126 134 protected static final TrueFalse GENERATE_INSECURE_EDEFAULT = TrueFalse.TRUE_LITERAL; 135 136 144 protected TrueFalse generateInsecure = GENERATE_INSECURE_EDEFAULT; 145 146 153 protected boolean generateInsecureESet = false; 154 155 163 protected static final TrueFalse GENERATE_SECURE_EDEFAULT = TrueFalse.FALSE_LITERAL; 164 165 173 protected TrueFalse generateSecure = GENERATE_SECURE_EDEFAULT; 174 175 182 protected boolean generateSecureESet = false; 183 184 192 protected static final String ID_EDEFAULT = null; 193 194 202 protected String id = ID_EDEFAULT; 203 204 212 protected static final TrueFalse IS_VIEW_EDEFAULT = TrueFalse.FALSE_LITERAL; 213 214 222 protected TrueFalse isView = IS_VIEW_EDEFAULT; 223 224 231 protected boolean isViewESet = false; 232 233 241 protected static final TrueFalse MASS_DELETES_EDEFAULT = TrueFalse.FALSE_LITERAL; 242 243 251 protected TrueFalse massDeletes = MASS_DELETES_EDEFAULT; 252 253 260 protected boolean massDeletesESet = false; 261 262 270 protected static final TrueFalse MASS_UPDATES_EDEFAULT = TrueFalse.FALSE_LITERAL; 271 272 280 protected TrueFalse massUpdates = MASS_UPDATES_EDEFAULT; 281 282 289 protected boolean massUpdatesESet = false; 290 291 299 protected static final TrueFalse MULTIDB_EDEFAULT = TrueFalse.FALSE_LITERAL; 300 301 309 protected TrueFalse multidb = MULTIDB_EDEFAULT; 310 311 318 protected boolean multidbESet = false; 319 320 325 protected TableTypeImpl() { 326 super(); 327 } 328 329 334 protected EClass eStaticClass() { 335 return DomlPackage.eINSTANCE.getTableType(); 336 } 337 338 343 public EList getColumn() { 344 if (column == null) { 345 column = new EObjectContainmentEList(ColumnType.class, this, DomlPackage.TABLE_TYPE__COLUMN); 346 } 347 return column; 348 } 349 350 355 public EList getIndex() { 356 if (index == null) { 357 index = new EObjectContainmentEList(IndexType.class, this, DomlPackage.TABLE_TYPE__INDEX); 358 } 359 return index; 360 } 361 362 367 public String getDbTableName() { 368 return dbTableName; 369 } 370 371 376 public void setDbTableName(String newDbTableName) { 377 String oldDbTableName = dbTableName; 378 dbTableName = newDbTableName; 379 if (eNotificationRequired()) 380 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__DB_TABLE_NAME, oldDbTableName, dbTableName)); 381 } 382 383 388 public DirtyDO getDirtyDOs() { 389 return dirtyDOs; 390 } 391 392 397 public void setDirtyDOs(DirtyDO newDirtyDOs) { 398 DirtyDO oldDirtyDOs = dirtyDOs; 399 dirtyDOs = newDirtyDOs == null ? DIRTY_DOS_EDEFAULT : newDirtyDOs; 400 boolean oldDirtyDOsESet = dirtyDOsESet; 401 dirtyDOsESet = true; 402 if (eNotificationRequired()) 403 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__DIRTY_DOS, oldDirtyDOs, dirtyDOs, !oldDirtyDOsESet)); 404 } 405 406 411 public void unsetDirtyDOs() { 412 DirtyDO oldDirtyDOs = dirtyDOs; 413 boolean oldDirtyDOsESet = dirtyDOsESet; 414 dirtyDOs = DIRTY_DOS_EDEFAULT; 415 dirtyDOsESet = false; 416 if (eNotificationRequired()) 417 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__DIRTY_DOS, oldDirtyDOs, DIRTY_DOS_EDEFAULT, oldDirtyDOsESet)); 418 } 419 420 425 public boolean isSetDirtyDOs() { 426 return dirtyDOsESet; 427 } 428 429 434 public TrueFalse getGenerateInsecure() { 435 return generateInsecure; 436 } 437 438 443 public void setGenerateInsecure(TrueFalse newGenerateInsecure) { 444 TrueFalse oldGenerateInsecure = generateInsecure; 445 generateInsecure = newGenerateInsecure == null ? GENERATE_INSECURE_EDEFAULT : newGenerateInsecure; 446 boolean oldGenerateInsecureESet = generateInsecureESet; 447 generateInsecureESet = true; 448 if (eNotificationRequired()) 449 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__GENERATE_INSECURE, oldGenerateInsecure, generateInsecure, !oldGenerateInsecureESet)); 450 } 451 452 457 public void unsetGenerateInsecure() { 458 TrueFalse oldGenerateInsecure = generateInsecure; 459 boolean oldGenerateInsecureESet = generateInsecureESet; 460 generateInsecure = GENERATE_INSECURE_EDEFAULT; 461 generateInsecureESet = false; 462 if (eNotificationRequired()) 463 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__GENERATE_INSECURE, oldGenerateInsecure, GENERATE_INSECURE_EDEFAULT, oldGenerateInsecureESet)); 464 } 465 466 471 public boolean isSetGenerateInsecure() { 472 return generateInsecureESet; 473 } 474 475 480 public TrueFalse getGenerateSecure() { 481 return generateSecure; 482 } 483 484 489 public void setGenerateSecure(TrueFalse newGenerateSecure) { 490 TrueFalse oldGenerateSecure = generateSecure; 491 generateSecure = newGenerateSecure == null ? GENERATE_SECURE_EDEFAULT : newGenerateSecure; 492 boolean oldGenerateSecureESet = generateSecureESet; 493 generateSecureESet = true; 494 if (eNotificationRequired()) 495 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__GENERATE_SECURE, oldGenerateSecure, generateSecure, !oldGenerateSecureESet)); 496 } 497 498 503 public void unsetGenerateSecure() { 504 TrueFalse oldGenerateSecure = generateSecure; 505 boolean oldGenerateSecureESet = generateSecureESet; 506 generateSecure = GENERATE_SECURE_EDEFAULT; 507 generateSecureESet = false; 508 if (eNotificationRequired()) 509 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__GENERATE_SECURE, oldGenerateSecure, GENERATE_SECURE_EDEFAULT, oldGenerateSecureESet)); 510 } 511 512 517 public boolean isSetGenerateSecure() { 518 return generateSecureESet; 519 } 520 521 526 public String getId() { 527 return id; 528 } 529 530 535 public void setId(String newId) { 536 String oldId = id; 537 id = newId; 538 if (eNotificationRequired()) 539 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__ID, oldId, id)); 540 } 541 542 547 public TrueFalse getIsView() { 548 return isView; 549 } 550 551 556 public void setIsView(TrueFalse newIsView) { 557 TrueFalse oldIsView = isView; 558 isView = newIsView == null ? IS_VIEW_EDEFAULT : newIsView; 559 boolean oldIsViewESet = isViewESet; 560 isViewESet = true; 561 if (eNotificationRequired()) 562 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__IS_VIEW, oldIsView, isView, !oldIsViewESet)); 563 } 564 565 570 public void unsetIsView() { 571 TrueFalse oldIsView = isView; 572 boolean oldIsViewESet = isViewESet; 573 isView = IS_VIEW_EDEFAULT; 574 isViewESet = false; 575 if (eNotificationRequired()) 576 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__IS_VIEW, oldIsView, IS_VIEW_EDEFAULT, oldIsViewESet)); 577 } 578 579 584 public boolean isSetIsView() { 585 return isViewESet; 586 } 587 588 593 public TrueFalse getMassDeletes() { 594 return massDeletes; 595 } 596 597 602 public void setMassDeletes(TrueFalse newMassDeletes) { 603 TrueFalse oldMassDeletes = massDeletes; 604 massDeletes = newMassDeletes == null ? MASS_DELETES_EDEFAULT : newMassDeletes; 605 boolean oldMassDeletesESet = massDeletesESet; 606 massDeletesESet = true; 607 if (eNotificationRequired()) 608 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__MASS_DELETES, oldMassDeletes, massDeletes, !oldMassDeletesESet)); 609 } 610 611 616 public void unsetMassDeletes() { 617 TrueFalse oldMassDeletes = massDeletes; 618 boolean oldMassDeletesESet = massDeletesESet; 619 massDeletes = MASS_DELETES_EDEFAULT; 620 massDeletesESet = false; 621 if (eNotificationRequired()) 622 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__MASS_DELETES, oldMassDeletes, MASS_DELETES_EDEFAULT, oldMassDeletesESet)); 623 } 624 625 630 public boolean isSetMassDeletes() { 631 return massDeletesESet; 632 } 633 634 639 public TrueFalse getMassUpdates() { 640 return massUpdates; 641 } 642 643 648 public void setMassUpdates(TrueFalse newMassUpdates) { 649 TrueFalse oldMassUpdates = massUpdates; 650 massUpdates = newMassUpdates == null ? MASS_UPDATES_EDEFAULT : newMassUpdates; 651 boolean oldMassUpdatesESet = massUpdatesESet; 652 massUpdatesESet = true; 653 if (eNotificationRequired()) 654 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__MASS_UPDATES, oldMassUpdates, massUpdates, !oldMassUpdatesESet)); 655 } 656 657 662 public void unsetMassUpdates() { 663 TrueFalse oldMassUpdates = massUpdates; 664 boolean oldMassUpdatesESet = massUpdatesESet; 665 massUpdates = MASS_UPDATES_EDEFAULT; 666 massUpdatesESet = false; 667 if (eNotificationRequired()) 668 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__MASS_UPDATES, oldMassUpdates, MASS_UPDATES_EDEFAULT, oldMassUpdatesESet)); 669 } 670 671 676 public boolean isSetMassUpdates() { 677 return massUpdatesESet; 678 } 679 680 685 public TrueFalse getMultidb() { 686 return multidb; 687 } 688 689 694 public void setMultidb(TrueFalse newMultidb) { 695 TrueFalse oldMultidb = multidb; 696 multidb = newMultidb == null ? MULTIDB_EDEFAULT : newMultidb; 697 boolean oldMultidbESet = multidbESet; 698 multidbESet = true; 699 if (eNotificationRequired()) 700 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.TABLE_TYPE__MULTIDB, oldMultidb, multidb, !oldMultidbESet)); 701 } 702 703 708 public void unsetMultidb() { 709 TrueFalse oldMultidb = multidb; 710 boolean oldMultidbESet = multidbESet; 711 multidb = MULTIDB_EDEFAULT; 712 multidbESet = false; 713 if (eNotificationRequired()) 714 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.TABLE_TYPE__MULTIDB, oldMultidb, MULTIDB_EDEFAULT, oldMultidbESet)); 715 } 716 717 722 public boolean isSetMultidb() { 723 return multidbESet; 724 } 725 726 731 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 732 if (featureID >= 0) { 733 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 734 case DomlPackage.TABLE_TYPE__COLUMN: 735 return ((InternalEList)getColumn()).basicRemove(otherEnd, msgs); 736 case DomlPackage.TABLE_TYPE__INDEX: 737 return ((InternalEList)getIndex()).basicRemove(otherEnd, msgs); 738 default: 739 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 740 } 741 } 742 return eBasicSetContainer(null, featureID, msgs); 743 } 744 745 750 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 751 switch (eDerivedStructuralFeatureID(eFeature)) { 752 case DomlPackage.TABLE_TYPE__COLUMN: 753 return getColumn(); 754 case DomlPackage.TABLE_TYPE__INDEX: 755 return getIndex(); 756 case DomlPackage.TABLE_TYPE__DB_TABLE_NAME: 757 return getDbTableName(); 758 case DomlPackage.TABLE_TYPE__DIRTY_DOS: 759 return getDirtyDOs(); 760 case DomlPackage.TABLE_TYPE__GENERATE_INSECURE: 761 return getGenerateInsecure(); 762 case DomlPackage.TABLE_TYPE__GENERATE_SECURE: 763 return getGenerateSecure(); 764 case DomlPackage.TABLE_TYPE__ID: 765 return getId(); 766 case DomlPackage.TABLE_TYPE__IS_VIEW: 767 return getIsView(); 768 case DomlPackage.TABLE_TYPE__MASS_DELETES: 769 return getMassDeletes(); 770 case DomlPackage.TABLE_TYPE__MASS_UPDATES: 771 return getMassUpdates(); 772 case DomlPackage.TABLE_TYPE__MULTIDB: 773 return getMultidb(); 774 } 775 return eDynamicGet(eFeature, resolve); 776 } 777 778 783 public void eSet(EStructuralFeature eFeature, Object newValue) { 784 switch (eDerivedStructuralFeatureID(eFeature)) { 785 case DomlPackage.TABLE_TYPE__COLUMN: 786 getColumn().clear(); 787 getColumn().addAll((Collection )newValue); 788 return; 789 case DomlPackage.TABLE_TYPE__INDEX: 790 getIndex().clear(); 791 getIndex().addAll((Collection )newValue); 792 return; 793 case DomlPackage.TABLE_TYPE__DB_TABLE_NAME: 794 setDbTableName((String )newValue); 795 return; 796 case DomlPackage.TABLE_TYPE__DIRTY_DOS: 797 setDirtyDOs((DirtyDO)newValue); 798 return; 799 case DomlPackage.TABLE_TYPE__GENERATE_INSECURE: 800 setGenerateInsecure((TrueFalse)newValue); 801 return; 802 case DomlPackage.TABLE_TYPE__GENERATE_SECURE: 803 setGenerateSecure((TrueFalse)newValue); 804 return; 805 case DomlPackage.TABLE_TYPE__ID: 806 setId((String )newValue); 807 return; 808 case DomlPackage.TABLE_TYPE__IS_VIEW: 809 setIsView((TrueFalse)newValue); 810 return; 811 case DomlPackage.TABLE_TYPE__MASS_DELETES: 812 setMassDeletes((TrueFalse)newValue); 813 return; 814 case DomlPackage.TABLE_TYPE__MASS_UPDATES: 815 setMassUpdates((TrueFalse)newValue); 816 return; 817 case DomlPackage.TABLE_TYPE__MULTIDB: 818 setMultidb((TrueFalse)newValue); 819 return; 820 } 821 eDynamicSet(eFeature, newValue); 822 } 823 824 829 public void eUnset(EStructuralFeature eFeature) { 830 switch (eDerivedStructuralFeatureID(eFeature)) { 831 case DomlPackage.TABLE_TYPE__COLUMN: 832 getColumn().clear(); 833 return; 834 case DomlPackage.TABLE_TYPE__INDEX: 835 getIndex().clear(); 836 return; 837 case DomlPackage.TABLE_TYPE__DB_TABLE_NAME: 838 setDbTableName(DB_TABLE_NAME_EDEFAULT); 839 return; 840 case DomlPackage.TABLE_TYPE__DIRTY_DOS: 841 unsetDirtyDOs(); 842 return; 843 case DomlPackage.TABLE_TYPE__GENERATE_INSECURE: 844 unsetGenerateInsecure(); 845 return; 846 case DomlPackage.TABLE_TYPE__GENERATE_SECURE: 847 unsetGenerateSecure(); 848 return; 849 case DomlPackage.TABLE_TYPE__ID: 850 setId(ID_EDEFAULT); 851 return; 852 case DomlPackage.TABLE_TYPE__IS_VIEW: 853 unsetIsView(); 854 return; 855 case DomlPackage.TABLE_TYPE__MASS_DELETES: 856 unsetMassDeletes(); 857 return; 858 case DomlPackage.TABLE_TYPE__MASS_UPDATES: 859 unsetMassUpdates(); 860 return; 861 case DomlPackage.TABLE_TYPE__MULTIDB: 862 unsetMultidb(); 863 return; 864 } 865 eDynamicUnset(eFeature); 866 } 867 868 873 public boolean eIsSet(EStructuralFeature eFeature) { 874 switch (eDerivedStructuralFeatureID(eFeature)) { 875 case DomlPackage.TABLE_TYPE__COLUMN: 876 return column != null && !column.isEmpty(); 877 case DomlPackage.TABLE_TYPE__INDEX: 878 return index != null && !index.isEmpty(); 879 case DomlPackage.TABLE_TYPE__DB_TABLE_NAME: 880 return DB_TABLE_NAME_EDEFAULT == null ? dbTableName != null : !DB_TABLE_NAME_EDEFAULT.equals(dbTableName); 881 case DomlPackage.TABLE_TYPE__DIRTY_DOS: 882 return isSetDirtyDOs(); 883 case DomlPackage.TABLE_TYPE__GENERATE_INSECURE: 884 return isSetGenerateInsecure(); 885 case DomlPackage.TABLE_TYPE__GENERATE_SECURE: 886 return isSetGenerateSecure(); 887 case DomlPackage.TABLE_TYPE__ID: 888 return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); 889 case DomlPackage.TABLE_TYPE__IS_VIEW: 890 return isSetIsView(); 891 case DomlPackage.TABLE_TYPE__MASS_DELETES: 892 return isSetMassDeletes(); 893 case DomlPackage.TABLE_TYPE__MASS_UPDATES: 894 return isSetMassUpdates(); 895 case DomlPackage.TABLE_TYPE__MULTIDB: 896 return isSetMultidb(); 897 } 898 return eDynamicIsSet(eFeature); 899 } 900 901 906 public String toString() { 907 if (eIsProxy()) return super.toString(); 908 909 StringBuffer result = new StringBuffer (super.toString()); 910 result.append(" (dbTableName: "); 911 result.append(dbTableName); 912 result.append(", dirtyDOs: "); 913 if (dirtyDOsESet) result.append(dirtyDOs); else result.append("<unset>"); 914 result.append(", generateInsecure: "); 915 if (generateInsecureESet) result.append(generateInsecure); else result.append("<unset>"); 916 result.append(", generateSecure: "); 917 if (generateSecureESet) result.append(generateSecure); else result.append("<unset>"); 918 result.append(", id: "); 919 result.append(id); 920 result.append(", isView: "); 921 if (isViewESet) result.append(isView); else result.append("<unset>"); 922 result.append(", massDeletes: "); 923 if (massDeletesESet) result.append(massDeletes); else result.append("<unset>"); 924 result.append(", massUpdates: "); 925 if (massUpdatesESet) result.append(massUpdates); else result.append("<unset>"); 926 result.append(", multidb: "); 927 if (multidbESet) result.append(multidb); else result.append("<unset>"); 928 result.append(')'); 929 return result.toString(); 930 } 931 932 } | Popular Tags |