1 7 package Olj.impl; 8 9 import Olj.AutoMapColumnsType; 10 import Olj.DefaultModeType; 11 import Olj.InsertType; 12 import Olj.OidLogicType; 13 import Olj.OljPackage; 14 import Olj.TableModeType; 15 import Olj.TableType; 16 17 import org.eclipse.emf.common.notify.Notification; 18 19 import org.eclipse.emf.ecore.EClass; 20 import org.eclipse.emf.ecore.EStructuralFeature; 21 22 import org.eclipse.emf.ecore.impl.ENotificationImpl; 23 import org.eclipse.emf.ecore.impl.EObjectImpl; 24 25 44 public class TableTypeImpl extends EObjectImpl implements TableType { 45 53 protected static final AutoMapColumnsType AUTO_MAP_COLUMNS_EDEFAULT = AutoMapColumnsType.TRUE_LITERAL; 54 55 63 protected AutoMapColumnsType autoMapColumns = AUTO_MAP_COLUMNS_EDEFAULT; 64 65 72 protected boolean autoMapColumnsESet = false; 73 74 82 protected static final DefaultModeType DEFAULT_MODE_EDEFAULT = DefaultModeType.OVERWRITE_LITERAL; 83 84 92 protected DefaultModeType defaultMode = DEFAULT_MODE_EDEFAULT; 93 94 101 protected boolean defaultModeESet = false; 102 103 111 protected static final InsertType INSERT_EDEFAULT = InsertType.TRUE_LITERAL; 112 113 121 protected InsertType insert = INSERT_EDEFAULT; 122 123 130 protected boolean insertESet = false; 131 132 140 protected static final OidLogicType OID_LOGIC_EDEFAULT = OidLogicType.TRUE_LITERAL; 141 142 150 protected OidLogicType oidLogic = OID_LOGIC_EDEFAULT; 151 152 159 protected boolean oidLogicESet = false; 160 161 169 protected static final String TABLE_ID_EDEFAULT = null; 170 171 179 protected String tableID = TABLE_ID_EDEFAULT; 180 181 189 protected static final TableModeType TABLE_MODE_EDEFAULT = TableModeType.CACHE_LITERAL; 190 191 199 protected TableModeType tableMode = TABLE_MODE_EDEFAULT; 200 201 208 protected boolean tableModeESet = false; 209 210 218 protected static final String TABLE_NAME_EDEFAULT = null; 219 220 228 protected String tableName = TABLE_NAME_EDEFAULT; 229 230 235 protected TableTypeImpl() { 236 super(); 237 } 238 239 244 protected EClass eStaticClass() { 245 return OljPackage.eINSTANCE.getTableType(); 246 } 247 248 253 public AutoMapColumnsType getAutoMapColumns() { 254 return autoMapColumns; 255 } 256 257 262 public void setAutoMapColumns(AutoMapColumnsType newAutoMapColumns) { 263 AutoMapColumnsType oldAutoMapColumns = autoMapColumns; 264 autoMapColumns = newAutoMapColumns == null ? AUTO_MAP_COLUMNS_EDEFAULT : newAutoMapColumns; 265 boolean oldAutoMapColumnsESet = autoMapColumnsESet; 266 autoMapColumnsESet = true; 267 if (eNotificationRequired()) 268 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS, oldAutoMapColumns, autoMapColumns, !oldAutoMapColumnsESet)); 269 } 270 271 276 public void unsetAutoMapColumns() { 277 AutoMapColumnsType oldAutoMapColumns = autoMapColumns; 278 boolean oldAutoMapColumnsESet = autoMapColumnsESet; 279 autoMapColumns = AUTO_MAP_COLUMNS_EDEFAULT; 280 autoMapColumnsESet = false; 281 if (eNotificationRequired()) 282 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS, oldAutoMapColumns, AUTO_MAP_COLUMNS_EDEFAULT, oldAutoMapColumnsESet)); 283 } 284 285 290 public boolean isSetAutoMapColumns() { 291 return autoMapColumnsESet; 292 } 293 294 299 public DefaultModeType getDefaultMode() { 300 return defaultMode; 301 } 302 303 308 public void setDefaultMode(DefaultModeType newDefaultMode) { 309 DefaultModeType oldDefaultMode = defaultMode; 310 defaultMode = newDefaultMode == null ? DEFAULT_MODE_EDEFAULT : newDefaultMode; 311 boolean oldDefaultModeESet = defaultModeESet; 312 defaultModeESet = true; 313 if (eNotificationRequired()) 314 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__DEFAULT_MODE, oldDefaultMode, defaultMode, !oldDefaultModeESet)); 315 } 316 317 322 public void unsetDefaultMode() { 323 DefaultModeType oldDefaultMode = defaultMode; 324 boolean oldDefaultModeESet = defaultModeESet; 325 defaultMode = DEFAULT_MODE_EDEFAULT; 326 defaultModeESet = false; 327 if (eNotificationRequired()) 328 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.TABLE_TYPE__DEFAULT_MODE, oldDefaultMode, DEFAULT_MODE_EDEFAULT, oldDefaultModeESet)); 329 } 330 331 336 public boolean isSetDefaultMode() { 337 return defaultModeESet; 338 } 339 340 345 public InsertType getInsert() { 346 return insert; 347 } 348 349 354 public void setInsert(InsertType newInsert) { 355 InsertType oldInsert = insert; 356 insert = newInsert == null ? INSERT_EDEFAULT : newInsert; 357 boolean oldInsertESet = insertESet; 358 insertESet = true; 359 if (eNotificationRequired()) 360 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__INSERT, oldInsert, insert, !oldInsertESet)); 361 } 362 363 368 public void unsetInsert() { 369 InsertType oldInsert = insert; 370 boolean oldInsertESet = insertESet; 371 insert = INSERT_EDEFAULT; 372 insertESet = false; 373 if (eNotificationRequired()) 374 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.TABLE_TYPE__INSERT, oldInsert, INSERT_EDEFAULT, oldInsertESet)); 375 } 376 377 382 public boolean isSetInsert() { 383 return insertESet; 384 } 385 386 391 public OidLogicType getOidLogic() { 392 return oidLogic; 393 } 394 395 400 public void setOidLogic(OidLogicType newOidLogic) { 401 OidLogicType oldOidLogic = oidLogic; 402 oidLogic = newOidLogic == null ? OID_LOGIC_EDEFAULT : newOidLogic; 403 boolean oldOidLogicESet = oidLogicESet; 404 oidLogicESet = true; 405 if (eNotificationRequired()) 406 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__OID_LOGIC, oldOidLogic, oidLogic, !oldOidLogicESet)); 407 } 408 409 414 public void unsetOidLogic() { 415 OidLogicType oldOidLogic = oidLogic; 416 boolean oldOidLogicESet = oidLogicESet; 417 oidLogic = OID_LOGIC_EDEFAULT; 418 oidLogicESet = false; 419 if (eNotificationRequired()) 420 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.TABLE_TYPE__OID_LOGIC, oldOidLogic, OID_LOGIC_EDEFAULT, oldOidLogicESet)); 421 } 422 423 428 public boolean isSetOidLogic() { 429 return oidLogicESet; 430 } 431 432 437 public String getTableID() { 438 return tableID; 439 } 440 441 446 public void setTableID(String newTableID) { 447 String oldTableID = tableID; 448 tableID = newTableID; 449 if (eNotificationRequired()) 450 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__TABLE_ID, oldTableID, tableID)); 451 } 452 453 458 public TableModeType getTableMode() { 459 return tableMode; 460 } 461 462 467 public void setTableMode(TableModeType newTableMode) { 468 TableModeType oldTableMode = tableMode; 469 tableMode = newTableMode == null ? TABLE_MODE_EDEFAULT : newTableMode; 470 boolean oldTableModeESet = tableModeESet; 471 tableModeESet = true; 472 if (eNotificationRequired()) 473 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__TABLE_MODE, oldTableMode, tableMode, !oldTableModeESet)); 474 } 475 476 481 public void unsetTableMode() { 482 TableModeType oldTableMode = tableMode; 483 boolean oldTableModeESet = tableModeESet; 484 tableMode = TABLE_MODE_EDEFAULT; 485 tableModeESet = false; 486 if (eNotificationRequired()) 487 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.TABLE_TYPE__TABLE_MODE, oldTableMode, TABLE_MODE_EDEFAULT, oldTableModeESet)); 488 } 489 490 495 public boolean isSetTableMode() { 496 return tableModeESet; 497 } 498 499 504 public String getTableName() { 505 return tableName; 506 } 507 508 513 public void setTableName(String newTableName) { 514 String oldTableName = tableName; 515 tableName = newTableName; 516 if (eNotificationRequired()) 517 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.TABLE_TYPE__TABLE_NAME, oldTableName, tableName)); 518 } 519 520 525 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 526 switch (eDerivedStructuralFeatureID(eFeature)) { 527 case OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS: 528 return getAutoMapColumns(); 529 case OljPackage.TABLE_TYPE__DEFAULT_MODE: 530 return getDefaultMode(); 531 case OljPackage.TABLE_TYPE__INSERT: 532 return getInsert(); 533 case OljPackage.TABLE_TYPE__OID_LOGIC: 534 return getOidLogic(); 535 case OljPackage.TABLE_TYPE__TABLE_ID: 536 return getTableID(); 537 case OljPackage.TABLE_TYPE__TABLE_MODE: 538 return getTableMode(); 539 case OljPackage.TABLE_TYPE__TABLE_NAME: 540 return getTableName(); 541 } 542 return eDynamicGet(eFeature, resolve); 543 } 544 545 550 public void eSet(EStructuralFeature eFeature, Object newValue) { 551 switch (eDerivedStructuralFeatureID(eFeature)) { 552 case OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS: 553 setAutoMapColumns((AutoMapColumnsType)newValue); 554 return; 555 case OljPackage.TABLE_TYPE__DEFAULT_MODE: 556 setDefaultMode((DefaultModeType)newValue); 557 return; 558 case OljPackage.TABLE_TYPE__INSERT: 559 setInsert((InsertType)newValue); 560 return; 561 case OljPackage.TABLE_TYPE__OID_LOGIC: 562 setOidLogic((OidLogicType)newValue); 563 return; 564 case OljPackage.TABLE_TYPE__TABLE_ID: 565 setTableID((String )newValue); 566 return; 567 case OljPackage.TABLE_TYPE__TABLE_MODE: 568 setTableMode((TableModeType)newValue); 569 return; 570 case OljPackage.TABLE_TYPE__TABLE_NAME: 571 setTableName((String )newValue); 572 return; 573 } 574 eDynamicSet(eFeature, newValue); 575 } 576 577 582 public void eUnset(EStructuralFeature eFeature) { 583 switch (eDerivedStructuralFeatureID(eFeature)) { 584 case OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS: 585 unsetAutoMapColumns(); 586 return; 587 case OljPackage.TABLE_TYPE__DEFAULT_MODE: 588 unsetDefaultMode(); 589 return; 590 case OljPackage.TABLE_TYPE__INSERT: 591 unsetInsert(); 592 return; 593 case OljPackage.TABLE_TYPE__OID_LOGIC: 594 unsetOidLogic(); 595 return; 596 case OljPackage.TABLE_TYPE__TABLE_ID: 597 setTableID(TABLE_ID_EDEFAULT); 598 return; 599 case OljPackage.TABLE_TYPE__TABLE_MODE: 600 unsetTableMode(); 601 return; 602 case OljPackage.TABLE_TYPE__TABLE_NAME: 603 setTableName(TABLE_NAME_EDEFAULT); 604 return; 605 } 606 eDynamicUnset(eFeature); 607 } 608 609 614 public boolean eIsSet(EStructuralFeature eFeature) { 615 switch (eDerivedStructuralFeatureID(eFeature)) { 616 case OljPackage.TABLE_TYPE__AUTO_MAP_COLUMNS: 617 return isSetAutoMapColumns(); 618 case OljPackage.TABLE_TYPE__DEFAULT_MODE: 619 return isSetDefaultMode(); 620 case OljPackage.TABLE_TYPE__INSERT: 621 return isSetInsert(); 622 case OljPackage.TABLE_TYPE__OID_LOGIC: 623 return isSetOidLogic(); 624 case OljPackage.TABLE_TYPE__TABLE_ID: 625 return TABLE_ID_EDEFAULT == null ? tableID != null : !TABLE_ID_EDEFAULT.equals(tableID); 626 case OljPackage.TABLE_TYPE__TABLE_MODE: 627 return isSetTableMode(); 628 case OljPackage.TABLE_TYPE__TABLE_NAME: 629 return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName); 630 } 631 return eDynamicIsSet(eFeature); 632 } 633 634 639 public String toString() { 640 if (eIsProxy()) return super.toString(); 641 642 StringBuffer result = new StringBuffer (super.toString()); 643 result.append(" (autoMapColumns: "); 644 if (autoMapColumnsESet) result.append(autoMapColumns); else result.append("<unset>"); 645 result.append(", defaultMode: "); 646 if (defaultModeESet) result.append(defaultMode); else result.append("<unset>"); 647 result.append(", insert: "); 648 if (insertESet) result.append(insert); else result.append("<unset>"); 649 result.append(", oidLogic: "); 650 if (oidLogicESet) result.append(oidLogic); else result.append("<unset>"); 651 result.append(", tableID: "); 652 result.append(tableID); 653 result.append(", tableMode: "); 654 if (tableModeESet) result.append(tableMode); else result.append("<unset>"); 655 result.append(", tableName: "); 656 result.append(tableName); 657 result.append(')'); 658 return result.toString(); 659 } 660 661 } | Popular Tags |