1 7 package org.enhydra.dods.editor.Doml.impl; 8 9 import org.eclipse.emf.common.notify.Notification; 10 import org.eclipse.emf.common.notify.NotificationChain; 11 12 import org.eclipse.emf.ecore.EClass; 13 import org.eclipse.emf.ecore.EStructuralFeature; 14 import org.eclipse.emf.ecore.InternalEObject; 15 16 import org.eclipse.emf.ecore.impl.ENotificationImpl; 17 import org.eclipse.emf.ecore.impl.EObjectImpl; 18 19 import org.enhydra.dods.editor.Doml.ColumnType; 20 import org.enhydra.dods.editor.Doml.DomlPackage; 21 import org.enhydra.dods.editor.Doml.ReferenceObjectType; 22 import org.enhydra.dods.editor.Doml.TrueFalse; 23 import org.enhydra.dods.editor.Doml.TypeType; 24 25 47 public class ColumnTypeImpl extends EObjectImpl implements ColumnType { 48 56 protected static final String ERROR_EDEFAULT = null; 57 58 66 protected String error = ERROR_EDEFAULT; 67 68 76 protected static final String JAVADOC_EDEFAULT = null; 77 78 86 protected String javadoc = JAVADOC_EDEFAULT; 87 88 96 protected ReferenceObjectType referenceObject = null; 97 98 106 protected TypeType type = null; 107 108 116 protected static final String INITIAL_VALUE_EDEFAULT = null; 117 118 126 protected String initialValue = INITIAL_VALUE_EDEFAULT; 127 128 136 protected static final TrueFalse GENERATE_INSECURE_EDEFAULT = TrueFalse.TRUE_LITERAL; 137 138 146 protected TrueFalse generateInsecure = GENERATE_INSECURE_EDEFAULT; 147 148 155 protected boolean generateInsecureESet = false; 156 157 165 protected static final TrueFalse GENERATE_SECURE_EDEFAULT = TrueFalse.FALSE_LITERAL; 166 167 175 protected TrueFalse generateSecure = GENERATE_SECURE_EDEFAULT; 176 177 184 protected boolean generateSecureESet = false; 185 186 194 protected static final String ID_EDEFAULT = null; 195 196 204 protected String id = ID_EDEFAULT; 205 206 214 protected static final TrueFalse IS_CONSTANT_EDEFAULT = TrueFalse.FALSE_LITERAL; 215 216 224 protected TrueFalse isConstant = IS_CONSTANT_EDEFAULT; 225 226 233 protected boolean isConstantESet = false; 234 235 243 protected static final TrueFalse USED_FOR_QUERY_EDEFAULT = TrueFalse.FALSE_LITERAL; 244 245 253 protected TrueFalse usedForQuery = USED_FOR_QUERY_EDEFAULT; 254 255 262 protected boolean usedForQueryESet = false; 263 264 269 protected ColumnTypeImpl() { 270 super(); 271 } 272 273 278 protected EClass eStaticClass() { 279 return DomlPackage.eINSTANCE.getColumnType(); 280 } 281 282 287 public String getError() { 288 return error; 289 } 290 291 296 public void setError(String newError) { 297 String oldError = error; 298 error = newError; 299 if (eNotificationRequired()) 300 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__ERROR, oldError, error)); 301 } 302 303 308 public String getJavadoc() { 309 return javadoc; 310 } 311 312 317 public void setJavadoc(String newJavadoc) { 318 String oldJavadoc = javadoc; 319 javadoc = newJavadoc; 320 if (eNotificationRequired()) 321 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__JAVADOC, oldJavadoc, javadoc)); 322 } 323 324 329 public ReferenceObjectType getReferenceObject() { 330 return referenceObject; 331 } 332 333 338 public NotificationChain basicSetReferenceObject(ReferenceObjectType newReferenceObject, NotificationChain msgs) { 339 ReferenceObjectType oldReferenceObject = referenceObject; 340 referenceObject = newReferenceObject; 341 if (eNotificationRequired()) { 342 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT, oldReferenceObject, newReferenceObject); 343 if (msgs == null) msgs = notification; else msgs.add(notification); 344 } 345 return msgs; 346 } 347 348 353 public void setReferenceObject(ReferenceObjectType newReferenceObject) { 354 if (newReferenceObject != referenceObject) { 355 NotificationChain msgs = null; 356 if (referenceObject != null) 357 msgs = ((InternalEObject)referenceObject).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT, null, msgs); 358 if (newReferenceObject != null) 359 msgs = ((InternalEObject)newReferenceObject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT, null, msgs); 360 msgs = basicSetReferenceObject(newReferenceObject, msgs); 361 if (msgs != null) msgs.dispatch(); 362 } 363 else if (eNotificationRequired()) 364 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT, newReferenceObject, newReferenceObject)); 365 } 366 367 372 public TypeType getType() { 373 return type; 374 } 375 376 381 public NotificationChain basicSetType(TypeType newType, NotificationChain msgs) { 382 TypeType oldType = type; 383 type = newType; 384 if (eNotificationRequired()) { 385 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__TYPE, oldType, newType); 386 if (msgs == null) msgs = notification; else msgs.add(notification); 387 } 388 return msgs; 389 } 390 391 396 public void setType(TypeType newType) { 397 if (newType != type) { 398 NotificationChain msgs = null; 399 if (type != null) 400 msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomlPackage.COLUMN_TYPE__TYPE, null, msgs); 401 if (newType != null) 402 msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomlPackage.COLUMN_TYPE__TYPE, null, msgs); 403 msgs = basicSetType(newType, msgs); 404 if (msgs != null) msgs.dispatch(); 405 } 406 else if (eNotificationRequired()) 407 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__TYPE, newType, newType)); 408 } 409 410 415 public String getInitialValue() { 416 return initialValue; 417 } 418 419 424 public void setInitialValue(String newInitialValue) { 425 String oldInitialValue = initialValue; 426 initialValue = newInitialValue; 427 if (eNotificationRequired()) 428 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__INITIAL_VALUE, oldInitialValue, initialValue)); 429 } 430 431 436 public TrueFalse getGenerateInsecure() { 437 return generateInsecure; 438 } 439 440 445 public void setGenerateInsecure(TrueFalse newGenerateInsecure) { 446 TrueFalse oldGenerateInsecure = generateInsecure; 447 generateInsecure = newGenerateInsecure == null ? GENERATE_INSECURE_EDEFAULT : newGenerateInsecure; 448 boolean oldGenerateInsecureESet = generateInsecureESet; 449 generateInsecureESet = true; 450 if (eNotificationRequired()) 451 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__GENERATE_INSECURE, oldGenerateInsecure, generateInsecure, !oldGenerateInsecureESet)); 452 } 453 454 459 public void unsetGenerateInsecure() { 460 TrueFalse oldGenerateInsecure = generateInsecure; 461 boolean oldGenerateInsecureESet = generateInsecureESet; 462 generateInsecure = GENERATE_INSECURE_EDEFAULT; 463 generateInsecureESet = false; 464 if (eNotificationRequired()) 465 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.COLUMN_TYPE__GENERATE_INSECURE, oldGenerateInsecure, GENERATE_INSECURE_EDEFAULT, oldGenerateInsecureESet)); 466 } 467 468 473 public boolean isSetGenerateInsecure() { 474 return generateInsecureESet; 475 } 476 477 482 public TrueFalse getGenerateSecure() { 483 return generateSecure; 484 } 485 486 491 public void setGenerateSecure(TrueFalse newGenerateSecure) { 492 TrueFalse oldGenerateSecure = generateSecure; 493 generateSecure = newGenerateSecure == null ? GENERATE_SECURE_EDEFAULT : newGenerateSecure; 494 boolean oldGenerateSecureESet = generateSecureESet; 495 generateSecureESet = true; 496 if (eNotificationRequired()) 497 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__GENERATE_SECURE, oldGenerateSecure, generateSecure, !oldGenerateSecureESet)); 498 } 499 500 505 public void unsetGenerateSecure() { 506 TrueFalse oldGenerateSecure = generateSecure; 507 boolean oldGenerateSecureESet = generateSecureESet; 508 generateSecure = GENERATE_SECURE_EDEFAULT; 509 generateSecureESet = false; 510 if (eNotificationRequired()) 511 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.COLUMN_TYPE__GENERATE_SECURE, oldGenerateSecure, GENERATE_SECURE_EDEFAULT, oldGenerateSecureESet)); 512 } 513 514 519 public boolean isSetGenerateSecure() { 520 return generateSecureESet; 521 } 522 523 528 public String getId() { 529 return id; 530 } 531 532 537 public void setId(String newId) { 538 String oldId = id; 539 id = newId; 540 if (eNotificationRequired()) 541 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__ID, oldId, id)); 542 } 543 544 549 public TrueFalse getIsConstant() { 550 return isConstant; 551 } 552 553 558 public void setIsConstant(TrueFalse newIsConstant) { 559 TrueFalse oldIsConstant = isConstant; 560 isConstant = newIsConstant == null ? IS_CONSTANT_EDEFAULT : newIsConstant; 561 boolean oldIsConstantESet = isConstantESet; 562 isConstantESet = true; 563 if (eNotificationRequired()) 564 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__IS_CONSTANT, oldIsConstant, isConstant, !oldIsConstantESet)); 565 } 566 567 572 public void unsetIsConstant() { 573 TrueFalse oldIsConstant = isConstant; 574 boolean oldIsConstantESet = isConstantESet; 575 isConstant = IS_CONSTANT_EDEFAULT; 576 isConstantESet = false; 577 if (eNotificationRequired()) 578 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.COLUMN_TYPE__IS_CONSTANT, oldIsConstant, IS_CONSTANT_EDEFAULT, oldIsConstantESet)); 579 } 580 581 586 public boolean isSetIsConstant() { 587 return isConstantESet; 588 } 589 590 595 public TrueFalse getUsedForQuery() { 596 return usedForQuery; 597 } 598 599 604 public void setUsedForQuery(TrueFalse newUsedForQuery) { 605 TrueFalse oldUsedForQuery = usedForQuery; 606 usedForQuery = newUsedForQuery == null ? USED_FOR_QUERY_EDEFAULT : newUsedForQuery; 607 boolean oldUsedForQueryESet = usedForQueryESet; 608 usedForQueryESet = true; 609 if (eNotificationRequired()) 610 eNotify(new ENotificationImpl(this, Notification.SET, DomlPackage.COLUMN_TYPE__USED_FOR_QUERY, oldUsedForQuery, usedForQuery, !oldUsedForQueryESet)); 611 } 612 613 618 public void unsetUsedForQuery() { 619 TrueFalse oldUsedForQuery = usedForQuery; 620 boolean oldUsedForQueryESet = usedForQueryESet; 621 usedForQuery = USED_FOR_QUERY_EDEFAULT; 622 usedForQueryESet = false; 623 if (eNotificationRequired()) 624 eNotify(new ENotificationImpl(this, Notification.UNSET, DomlPackage.COLUMN_TYPE__USED_FOR_QUERY, oldUsedForQuery, USED_FOR_QUERY_EDEFAULT, oldUsedForQueryESet)); 625 } 626 627 632 public boolean isSetUsedForQuery() { 633 return usedForQueryESet; 634 } 635 636 641 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 642 if (featureID >= 0) { 643 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 644 case DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT: 645 return basicSetReferenceObject(null, msgs); 646 case DomlPackage.COLUMN_TYPE__TYPE: 647 return basicSetType(null, msgs); 648 default: 649 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 650 } 651 } 652 return eBasicSetContainer(null, featureID, msgs); 653 } 654 655 660 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 661 switch (eDerivedStructuralFeatureID(eFeature)) { 662 case DomlPackage.COLUMN_TYPE__ERROR: 663 return getError(); 664 case DomlPackage.COLUMN_TYPE__JAVADOC: 665 return getJavadoc(); 666 case DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT: 667 return getReferenceObject(); 668 case DomlPackage.COLUMN_TYPE__TYPE: 669 return getType(); 670 case DomlPackage.COLUMN_TYPE__INITIAL_VALUE: 671 return getInitialValue(); 672 case DomlPackage.COLUMN_TYPE__GENERATE_INSECURE: 673 return getGenerateInsecure(); 674 case DomlPackage.COLUMN_TYPE__GENERATE_SECURE: 675 return getGenerateSecure(); 676 case DomlPackage.COLUMN_TYPE__ID: 677 return getId(); 678 case DomlPackage.COLUMN_TYPE__IS_CONSTANT: 679 return getIsConstant(); 680 case DomlPackage.COLUMN_TYPE__USED_FOR_QUERY: 681 return getUsedForQuery(); 682 } 683 return eDynamicGet(eFeature, resolve); 684 } 685 686 691 public void eSet(EStructuralFeature eFeature, Object newValue) { 692 switch (eDerivedStructuralFeatureID(eFeature)) { 693 case DomlPackage.COLUMN_TYPE__ERROR: 694 setError((String )newValue); 695 return; 696 case DomlPackage.COLUMN_TYPE__JAVADOC: 697 setJavadoc((String )newValue); 698 return; 699 case DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT: 700 setReferenceObject((ReferenceObjectType)newValue); 701 return; 702 case DomlPackage.COLUMN_TYPE__TYPE: 703 setType((TypeType)newValue); 704 return; 705 case DomlPackage.COLUMN_TYPE__INITIAL_VALUE: 706 setInitialValue((String )newValue); 707 return; 708 case DomlPackage.COLUMN_TYPE__GENERATE_INSECURE: 709 setGenerateInsecure((TrueFalse)newValue); 710 return; 711 case DomlPackage.COLUMN_TYPE__GENERATE_SECURE: 712 setGenerateSecure((TrueFalse)newValue); 713 return; 714 case DomlPackage.COLUMN_TYPE__ID: 715 setId((String )newValue); 716 return; 717 case DomlPackage.COLUMN_TYPE__IS_CONSTANT: 718 setIsConstant((TrueFalse)newValue); 719 return; 720 case DomlPackage.COLUMN_TYPE__USED_FOR_QUERY: 721 setUsedForQuery((TrueFalse)newValue); 722 return; 723 } 724 eDynamicSet(eFeature, newValue); 725 } 726 727 732 public void eUnset(EStructuralFeature eFeature) { 733 switch (eDerivedStructuralFeatureID(eFeature)) { 734 case DomlPackage.COLUMN_TYPE__ERROR: 735 setError(ERROR_EDEFAULT); 736 return; 737 case DomlPackage.COLUMN_TYPE__JAVADOC: 738 setJavadoc(JAVADOC_EDEFAULT); 739 return; 740 case DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT: 741 setReferenceObject((ReferenceObjectType)null); 742 return; 743 case DomlPackage.COLUMN_TYPE__TYPE: 744 setType((TypeType)null); 745 return; 746 case DomlPackage.COLUMN_TYPE__INITIAL_VALUE: 747 setInitialValue(INITIAL_VALUE_EDEFAULT); 748 return; 749 case DomlPackage.COLUMN_TYPE__GENERATE_INSECURE: 750 unsetGenerateInsecure(); 751 return; 752 case DomlPackage.COLUMN_TYPE__GENERATE_SECURE: 753 unsetGenerateSecure(); 754 return; 755 case DomlPackage.COLUMN_TYPE__ID: 756 setId(ID_EDEFAULT); 757 return; 758 case DomlPackage.COLUMN_TYPE__IS_CONSTANT: 759 unsetIsConstant(); 760 return; 761 case DomlPackage.COLUMN_TYPE__USED_FOR_QUERY: 762 unsetUsedForQuery(); 763 return; 764 } 765 eDynamicUnset(eFeature); 766 } 767 768 773 public boolean eIsSet(EStructuralFeature eFeature) { 774 switch (eDerivedStructuralFeatureID(eFeature)) { 775 case DomlPackage.COLUMN_TYPE__ERROR: 776 return ERROR_EDEFAULT == null ? error != null : !ERROR_EDEFAULT.equals(error); 777 case DomlPackage.COLUMN_TYPE__JAVADOC: 778 return JAVADOC_EDEFAULT == null ? javadoc != null : !JAVADOC_EDEFAULT.equals(javadoc); 779 case DomlPackage.COLUMN_TYPE__REFERENCE_OBJECT: 780 return referenceObject != null; 781 case DomlPackage.COLUMN_TYPE__TYPE: 782 return type != null; 783 case DomlPackage.COLUMN_TYPE__INITIAL_VALUE: 784 return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue); 785 case DomlPackage.COLUMN_TYPE__GENERATE_INSECURE: 786 return isSetGenerateInsecure(); 787 case DomlPackage.COLUMN_TYPE__GENERATE_SECURE: 788 return isSetGenerateSecure(); 789 case DomlPackage.COLUMN_TYPE__ID: 790 return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); 791 case DomlPackage.COLUMN_TYPE__IS_CONSTANT: 792 return isSetIsConstant(); 793 case DomlPackage.COLUMN_TYPE__USED_FOR_QUERY: 794 return isSetUsedForQuery(); 795 } 796 return eDynamicIsSet(eFeature); 797 } 798 799 804 public String toString() { 805 if (eIsProxy()) return super.toString(); 806 807 StringBuffer result = new StringBuffer (super.toString()); 808 result.append(" (error: "); 809 result.append(error); 810 result.append(", javadoc: "); 811 result.append(javadoc); 812 result.append(", initialValue: "); 813 result.append(initialValue); 814 result.append(", generateInsecure: "); 815 if (generateInsecureESet) result.append(generateInsecure); else result.append("<unset>"); 816 result.append(", generateSecure: "); 817 if (generateSecureESet) result.append(generateSecure); else result.append("<unset>"); 818 result.append(", id: "); 819 result.append(id); 820 result.append(", isConstant: "); 821 if (isConstantESet) result.append(isConstant); else result.append("<unset>"); 822 result.append(", usedForQuery: "); 823 if (usedForQueryESet) result.append(usedForQuery); else result.append("<unset>"); 824 result.append(')'); 825 return result.toString(); 826 } 827 828 } | Popular Tags |