1 7 package Olj.impl; 8 9 import Olj.FromHexType; 10 import Olj.OljPackage; 11 import Olj.ToHexType; 12 import Olj.ValueColumnType; 13 import Olj.ValueModeType5; 14 15 import org.eclipse.emf.common.notify.Notification; 16 17 import org.eclipse.emf.ecore.EClass; 18 import org.eclipse.emf.ecore.EStructuralFeature; 19 20 import org.eclipse.emf.ecore.impl.ENotificationImpl; 21 import org.eclipse.emf.ecore.impl.EObjectImpl; 22 23 43 public class ValueColumnTypeImpl extends EObjectImpl implements ValueColumnType { 44 52 protected static final String DEFAULT_VALUE_EDEFAULT = null; 53 54 62 protected String defaultValue = DEFAULT_VALUE_EDEFAULT; 63 64 72 protected static final FromHexType FROM_HEX_EDEFAULT = FromHexType.TRUE_LITERAL; 73 74 82 protected FromHexType fromHex = FROM_HEX_EDEFAULT; 83 84 91 protected boolean fromHexESet = false; 92 93 101 protected static final String SOURCE_COLUMN_NAME_EDEFAULT = null; 102 103 111 protected String sourceColumnName = SOURCE_COLUMN_NAME_EDEFAULT; 112 113 121 protected static final String TARGET_COLUMN_NAME_EDEFAULT = null; 122 123 131 protected String targetColumnName = TARGET_COLUMN_NAME_EDEFAULT; 132 133 141 protected static final String TARGET_TABLE_ID_EDEFAULT = null; 142 143 151 protected String targetTableID = TARGET_TABLE_ID_EDEFAULT; 152 153 161 protected static final String TARGET_TABLE_NAME_EDEFAULT = null; 162 163 171 protected String targetTableName = TARGET_TABLE_NAME_EDEFAULT; 172 173 181 protected static final ToHexType TO_HEX_EDEFAULT = ToHexType.TRUE_LITERAL; 182 183 191 protected ToHexType toHex = TO_HEX_EDEFAULT; 192 193 200 protected boolean toHexESet = false; 201 202 210 protected static final ValueModeType5 VALUE_MODE_EDEFAULT = ValueModeType5.KEY_LITERAL; 211 212 220 protected ValueModeType5 valueMode = VALUE_MODE_EDEFAULT; 221 222 229 protected boolean valueModeESet = false; 230 231 236 protected ValueColumnTypeImpl() { 237 super(); 238 } 239 240 245 protected EClass eStaticClass() { 246 return OljPackage.eINSTANCE.getValueColumnType(); 247 } 248 249 254 public String getDefaultValue() { 255 return defaultValue; 256 } 257 258 263 public void setDefaultValue(String newDefaultValue) { 264 String oldDefaultValue = defaultValue; 265 defaultValue = newDefaultValue; 266 if (eNotificationRequired()) 267 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE, oldDefaultValue, defaultValue)); 268 } 269 270 275 public FromHexType getFromHex() { 276 return fromHex; 277 } 278 279 284 public void setFromHex(FromHexType newFromHex) { 285 FromHexType oldFromHex = fromHex; 286 fromHex = newFromHex == null ? FROM_HEX_EDEFAULT : newFromHex; 287 boolean oldFromHexESet = fromHexESet; 288 fromHexESet = true; 289 if (eNotificationRequired()) 290 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__FROM_HEX, oldFromHex, fromHex, !oldFromHexESet)); 291 } 292 293 298 public void unsetFromHex() { 299 FromHexType oldFromHex = fromHex; 300 boolean oldFromHexESet = fromHexESet; 301 fromHex = FROM_HEX_EDEFAULT; 302 fromHexESet = false; 303 if (eNotificationRequired()) 304 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.VALUE_COLUMN_TYPE__FROM_HEX, oldFromHex, FROM_HEX_EDEFAULT, oldFromHexESet)); 305 } 306 307 312 public boolean isSetFromHex() { 313 return fromHexESet; 314 } 315 316 321 public String getSourceColumnName() { 322 return sourceColumnName; 323 } 324 325 330 public void setSourceColumnName(String newSourceColumnName) { 331 String oldSourceColumnName = sourceColumnName; 332 sourceColumnName = newSourceColumnName; 333 if (eNotificationRequired()) 334 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME, oldSourceColumnName, sourceColumnName)); 335 } 336 337 342 public String getTargetColumnName() { 343 return targetColumnName; 344 } 345 346 351 public void setTargetColumnName(String newTargetColumnName) { 352 String oldTargetColumnName = targetColumnName; 353 targetColumnName = newTargetColumnName; 354 if (eNotificationRequired()) 355 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME, oldTargetColumnName, targetColumnName)); 356 } 357 358 363 public String getTargetTableID() { 364 return targetTableID; 365 } 366 367 372 public void setTargetTableID(String newTargetTableID) { 373 String oldTargetTableID = targetTableID; 374 targetTableID = newTargetTableID; 375 if (eNotificationRequired()) 376 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID, oldTargetTableID, targetTableID)); 377 } 378 379 384 public String getTargetTableName() { 385 return targetTableName; 386 } 387 388 393 public void setTargetTableName(String newTargetTableName) { 394 String oldTargetTableName = targetTableName; 395 targetTableName = newTargetTableName; 396 if (eNotificationRequired()) 397 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME, oldTargetTableName, targetTableName)); 398 } 399 400 405 public ToHexType getToHex() { 406 return toHex; 407 } 408 409 414 public void setToHex(ToHexType newToHex) { 415 ToHexType oldToHex = toHex; 416 toHex = newToHex == null ? TO_HEX_EDEFAULT : newToHex; 417 boolean oldToHexESet = toHexESet; 418 toHexESet = true; 419 if (eNotificationRequired()) 420 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__TO_HEX, oldToHex, toHex, !oldToHexESet)); 421 } 422 423 428 public void unsetToHex() { 429 ToHexType oldToHex = toHex; 430 boolean oldToHexESet = toHexESet; 431 toHex = TO_HEX_EDEFAULT; 432 toHexESet = false; 433 if (eNotificationRequired()) 434 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.VALUE_COLUMN_TYPE__TO_HEX, oldToHex, TO_HEX_EDEFAULT, oldToHexESet)); 435 } 436 437 442 public boolean isSetToHex() { 443 return toHexESet; 444 } 445 446 451 public ValueModeType5 getValueMode() { 452 return valueMode; 453 } 454 455 460 public void setValueMode(ValueModeType5 newValueMode) { 461 ValueModeType5 oldValueMode = valueMode; 462 valueMode = newValueMode == null ? VALUE_MODE_EDEFAULT : newValueMode; 463 boolean oldValueModeESet = valueModeESet; 464 valueModeESet = true; 465 if (eNotificationRequired()) 466 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE, oldValueMode, valueMode, !oldValueModeESet)); 467 } 468 469 474 public void unsetValueMode() { 475 ValueModeType5 oldValueMode = valueMode; 476 boolean oldValueModeESet = valueModeESet; 477 valueMode = VALUE_MODE_EDEFAULT; 478 valueModeESet = false; 479 if (eNotificationRequired()) 480 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE, oldValueMode, VALUE_MODE_EDEFAULT, oldValueModeESet)); 481 } 482 483 488 public boolean isSetValueMode() { 489 return valueModeESet; 490 } 491 492 497 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 498 switch (eDerivedStructuralFeatureID(eFeature)) { 499 case OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE: 500 return getDefaultValue(); 501 case OljPackage.VALUE_COLUMN_TYPE__FROM_HEX: 502 return getFromHex(); 503 case OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME: 504 return getSourceColumnName(); 505 case OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME: 506 return getTargetColumnName(); 507 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID: 508 return getTargetTableID(); 509 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME: 510 return getTargetTableName(); 511 case OljPackage.VALUE_COLUMN_TYPE__TO_HEX: 512 return getToHex(); 513 case OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE: 514 return getValueMode(); 515 } 516 return eDynamicGet(eFeature, resolve); 517 } 518 519 524 public void eSet(EStructuralFeature eFeature, Object newValue) { 525 switch (eDerivedStructuralFeatureID(eFeature)) { 526 case OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE: 527 setDefaultValue((String )newValue); 528 return; 529 case OljPackage.VALUE_COLUMN_TYPE__FROM_HEX: 530 setFromHex((FromHexType)newValue); 531 return; 532 case OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME: 533 setSourceColumnName((String )newValue); 534 return; 535 case OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME: 536 setTargetColumnName((String )newValue); 537 return; 538 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID: 539 setTargetTableID((String )newValue); 540 return; 541 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME: 542 setTargetTableName((String )newValue); 543 return; 544 case OljPackage.VALUE_COLUMN_TYPE__TO_HEX: 545 setToHex((ToHexType)newValue); 546 return; 547 case OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE: 548 setValueMode((ValueModeType5)newValue); 549 return; 550 } 551 eDynamicSet(eFeature, newValue); 552 } 553 554 559 public void eUnset(EStructuralFeature eFeature) { 560 switch (eDerivedStructuralFeatureID(eFeature)) { 561 case OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE: 562 setDefaultValue(DEFAULT_VALUE_EDEFAULT); 563 return; 564 case OljPackage.VALUE_COLUMN_TYPE__FROM_HEX: 565 unsetFromHex(); 566 return; 567 case OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME: 568 setSourceColumnName(SOURCE_COLUMN_NAME_EDEFAULT); 569 return; 570 case OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME: 571 setTargetColumnName(TARGET_COLUMN_NAME_EDEFAULT); 572 return; 573 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID: 574 setTargetTableID(TARGET_TABLE_ID_EDEFAULT); 575 return; 576 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME: 577 setTargetTableName(TARGET_TABLE_NAME_EDEFAULT); 578 return; 579 case OljPackage.VALUE_COLUMN_TYPE__TO_HEX: 580 unsetToHex(); 581 return; 582 case OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE: 583 unsetValueMode(); 584 return; 585 } 586 eDynamicUnset(eFeature); 587 } 588 589 594 public boolean eIsSet(EStructuralFeature eFeature) { 595 switch (eDerivedStructuralFeatureID(eFeature)) { 596 case OljPackage.VALUE_COLUMN_TYPE__DEFAULT_VALUE: 597 return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue); 598 case OljPackage.VALUE_COLUMN_TYPE__FROM_HEX: 599 return isSetFromHex(); 600 case OljPackage.VALUE_COLUMN_TYPE__SOURCE_COLUMN_NAME: 601 return SOURCE_COLUMN_NAME_EDEFAULT == null ? sourceColumnName != null : !SOURCE_COLUMN_NAME_EDEFAULT.equals(sourceColumnName); 602 case OljPackage.VALUE_COLUMN_TYPE__TARGET_COLUMN_NAME: 603 return TARGET_COLUMN_NAME_EDEFAULT == null ? targetColumnName != null : !TARGET_COLUMN_NAME_EDEFAULT.equals(targetColumnName); 604 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_ID: 605 return TARGET_TABLE_ID_EDEFAULT == null ? targetTableID != null : !TARGET_TABLE_ID_EDEFAULT.equals(targetTableID); 606 case OljPackage.VALUE_COLUMN_TYPE__TARGET_TABLE_NAME: 607 return TARGET_TABLE_NAME_EDEFAULT == null ? targetTableName != null : !TARGET_TABLE_NAME_EDEFAULT.equals(targetTableName); 608 case OljPackage.VALUE_COLUMN_TYPE__TO_HEX: 609 return isSetToHex(); 610 case OljPackage.VALUE_COLUMN_TYPE__VALUE_MODE: 611 return isSetValueMode(); 612 } 613 return eDynamicIsSet(eFeature); 614 } 615 616 621 public String toString() { 622 if (eIsProxy()) return super.toString(); 623 624 StringBuffer result = new StringBuffer (super.toString()); 625 result.append(" (defaultValue: "); 626 result.append(defaultValue); 627 result.append(", fromHex: "); 628 if (fromHexESet) result.append(fromHex); else result.append("<unset>"); 629 result.append(", sourceColumnName: "); 630 result.append(sourceColumnName); 631 result.append(", targetColumnName: "); 632 result.append(targetColumnName); 633 result.append(", targetTableID: "); 634 result.append(targetTableID); 635 result.append(", targetTableName: "); 636 result.append(targetTableName); 637 result.append(", toHex: "); 638 if (toHexESet) result.append(toHex); else result.append("<unset>"); 639 result.append(", valueMode: "); 640 if (valueModeESet) result.append(valueMode); else result.append("<unset>"); 641 result.append(')'); 642 return result.toString(); 643 } 644 645 } | Popular Tags |