1 17 package org.eclipse.emf.ecore.sdo.impl; 18 19 20 import java.io.ObjectStreamException ; 21 import java.math.BigDecimal ; 22 import java.math.BigInteger ; 23 import java.util.Collection ; 24 import java.util.Date ; 25 import java.util.List ; 26 import java.util.Map ; 27 28 import org.eclipse.emf.common.notify.NotificationChain; 29 import org.eclipse.emf.common.util.EList; 30 import org.eclipse.emf.ecore.EClass; 31 import org.eclipse.emf.ecore.EObject; 32 import org.eclipse.emf.ecore.EStructuralFeature; 33 import org.eclipse.emf.ecore.InternalEObject; 34 import org.eclipse.emf.ecore.change.impl.FeatureChangeImpl; 35 import org.eclipse.emf.ecore.sdo.EChangeSummarySetting; 36 import org.eclipse.emf.ecore.sdo.InternalEDataObject; 37 import org.eclipse.emf.ecore.sdo.SDOPackage; 38 import org.eclipse.emf.ecore.sdo.util.SDOUtil; 39 import org.eclipse.emf.ecore.util.InternalEList; 40 41 import commonj.sdo.ChangeSummary; 42 import commonj.sdo.DataGraph; 43 import commonj.sdo.DataObject; 44 import commonj.sdo.Property; 45 import commonj.sdo.Sequence; 46 import commonj.sdo.Type; 47 48 49 62 public class EChangeSummarySettingImpl extends FeatureChangeImpl implements EChangeSummarySetting, InternalEDataObject 63 { 64 69 protected EChangeSummarySettingImpl() 70 { 71 super(); 72 } 73 74 protected EChangeSummarySettingImpl(EStructuralFeature feature, Object value, boolean isSet) 75 { 76 super(feature, value, isSet); 77 } 78 79 84 protected EClass eStaticClass() 85 { 86 return SDOPackage.eINSTANCE.getEChangeSummarySetting(); 87 } 88 89 94 public Object getValue() 95 { 96 EStructuralFeature feature = getFeature(); 97 if (feature.isMany()) 98 { 99 if (value == null) 100 { 101 EObject eObject = (EObject)((Map.Entry )eContainer()).getKey(); 102 value = getListValue((EList)eObject.eGet(feature)); 103 } 104 return value; 105 } 106 else 107 { 108 return super.getValue(); 109 } 110 } 111 112 117 public Property getProperty() 118 { 119 return SDOUtil.adaptProperty(getFeature()); 120 } 121 122 127 public boolean isSet() 128 { 129 return super.isSet(); 130 } 131 132 137 public Object get(String path) 138 { 139 return SDOUtil.get(this, path); 140 } 141 142 147 public void set(String path, Object value) 148 { 149 SDOUtil.set(this, path, value); 150 } 151 152 157 public boolean isSet(String path) 158 { 159 return SDOUtil.isSet(this, path); 160 } 161 162 167 public void unset(String path) 168 { 169 SDOUtil.unset(this, path); 170 } 171 172 177 public Object get(int propertyIndex) 178 { 179 return SDOUtil.get(this, propertyIndex); 180 } 181 182 187 public void set(int propertyIndex, Object value) 188 { 189 SDOUtil.set(this, propertyIndex, value); 190 } 191 192 197 public boolean isSet(int propertyIndex) 198 { 199 return SDOUtil.isSet(this, propertyIndex); 200 } 201 202 207 public void unset(int propertyIndex) 208 { 209 SDOUtil.unset(this, propertyIndex); 210 } 211 212 217 public Object get(Property property) 218 { 219 return SDOUtil.get(this, property); 220 } 221 222 227 public void set(Property property, Object value) 228 { 229 SDOUtil.set(this, property, value); 230 } 231 232 237 public boolean isSet(Property property) 238 { 239 return SDOUtil.isSet(this, property); 240 } 241 242 247 public void unset(Property property) 248 { 249 SDOUtil.unset(this, property); 250 } 251 252 257 public DataObject getContainer() 258 { 259 return SDOUtil.getContainer(this); 260 } 261 262 267 public Property getContainmentProperty() 268 { 269 return SDOUtil.getContainmentProperty(this); 270 } 271 272 277 public DataGraph getDataGraph() 278 { 279 return SDOUtil.getDataGraph(this); 280 } 281 282 287 public Type getType() 288 { 289 return SDOUtil.getType(this); 290 } 291 292 297 public BigDecimal getBigDecimal(String path) 298 { 299 return SDOUtil.getBigDecimal(this, path); 300 } 301 302 307 public BigInteger getBigInteger(String path) 308 { 309 return SDOUtil.getBigInteger(this, path); 310 } 311 312 317 public boolean getBoolean(String path) 318 { 319 return SDOUtil.getBoolean(this, path); 320 } 321 322 327 public byte getByte(String path) 328 { 329 return SDOUtil.getByte(this, path); 330 } 331 332 337 public byte[] getBytes(String path) 338 { 339 return SDOUtil.getBytes(this, path); 340 } 341 342 347 public char getChar(String path) 348 { 349 return SDOUtil.getChar(this, path); 350 } 351 352 357 public DataObject getDataObject(String path) 358 { 359 return SDOUtil.getDataObject(this, path); 360 } 361 362 367 public Date getDate(String path) 368 { 369 return SDOUtil.getDate(this, path); 370 } 371 372 377 public double getDouble(String path) 378 { 379 return SDOUtil.getDouble(this, path); 380 } 381 382 387 public float getFloat(String path) 388 { 389 return SDOUtil.getFloat(this, path); 390 } 391 392 397 public int getInt(String path) 398 { 399 return SDOUtil.getInt(this, path); 400 } 401 402 407 public List getList(String path) 408 { 409 return SDOUtil.getList(this, path); 410 } 411 412 417 public long getLong(String path) 418 { 419 return SDOUtil.getLong(this, path); 420 } 421 422 427 public Sequence getSequence(String path) 428 { 429 return SDOUtil.getSequence(this, path); 430 } 431 432 437 public short getShort(String path) 438 { 439 return SDOUtil.getShort(this, path); 440 } 441 442 447 public String getString(String path) 448 { 449 return SDOUtil.getString(this, path); 450 } 451 452 457 public void setBigDecimal(String path, BigDecimal value) 458 { 459 SDOUtil.setBigDecimal(this, path, value); 460 } 461 462 467 public void setBigInteger(String path, BigInteger value) 468 { 469 SDOUtil.setBigInteger(this, path, value); 470 } 471 472 477 public void setBoolean(String path, boolean value) 478 { 479 SDOUtil.setBoolean(this, path, value); 480 } 481 482 487 public void setByte(String path, byte value) 488 { 489 SDOUtil.setByte(this, path, value); 490 } 491 492 497 public void setBytes(String path, byte[] value) 498 { 499 SDOUtil.setBytes(this, path, value); 500 } 501 502 507 public void setChar(String path, char value) 508 { 509 SDOUtil.setChar(this, path, value); 510 } 511 512 517 public void setDataObject(String path, DataObject value) 518 { 519 SDOUtil.setDataObject(this, path, value); 520 } 521 522 527 public void setDate(String path, Date value) 528 { 529 SDOUtil.setDate(this, path, value); 530 } 531 532 537 public void setDouble(String path, double value) 538 { 539 SDOUtil.setDouble(this, path, value); 540 } 541 542 547 public void setFloat(String path, float value) 548 { 549 SDOUtil.setFloat(this, path, value); 550 } 551 552 557 public void setInt(String path, int value) 558 { 559 SDOUtil.setInt(this, path, value); 560 } 561 562 567 public void setList(String path, List value) 568 { 569 SDOUtil.setList(this, path, value); 570 } 571 572 577 public void setLong(String path, long value) 578 { 579 SDOUtil.setLong(this, path, value); 580 } 581 582 587 public void setShort(String path, short value) 588 { 589 SDOUtil.setShort(this, path, value); 590 } 591 592 597 public void setString(String path, String value) 598 { 599 SDOUtil.setString(this, path, value); 600 } 601 602 607 public BigDecimal getBigDecimal(int propertyIndex) 608 { 609 return SDOUtil.getBigDecimal(this, propertyIndex); 610 } 611 612 617 public BigInteger getBigInteger(int propertyIndex) 618 { 619 return SDOUtil.getBigInteger(this, propertyIndex); 620 } 621 622 627 public boolean getBoolean(int propertyIndex) 628 { 629 return SDOUtil.getBoolean(this, propertyIndex); 630 } 631 632 637 public byte getByte(int propertyIndex) 638 { 639 return SDOUtil.getByte(this, propertyIndex); 640 } 641 642 647 public byte[] getBytes(int propertyIndex) 648 { 649 return SDOUtil.getBytes(this, propertyIndex); 650 } 651 652 657 public char getChar(int propertyIndex) 658 { 659 return SDOUtil.getChar(this, propertyIndex); 660 } 661 662 667 public DataObject getDataObject(int propertyIndex) 668 { 669 return SDOUtil.getDataObject(this, propertyIndex); 670 } 671 672 677 public Date getDate(int propertyIndex) 678 { 679 return SDOUtil.getDate(this, propertyIndex); 680 } 681 682 687 public double getDouble(int propertyIndex) 688 { 689 return SDOUtil.getDouble(this, propertyIndex); 690 } 691 692 697 public float getFloat(int propertyIndex) 698 { 699 return SDOUtil.getFloat(this, propertyIndex); 700 } 701 702 707 public int getInt(int propertyIndex) 708 { 709 return SDOUtil.getInt(this, propertyIndex); 710 } 711 712 717 public List getList(int propertyIndex) 718 { 719 return SDOUtil.getList(this, propertyIndex); 720 } 721 722 727 public long getLong(int propertyIndex) 728 { 729 return SDOUtil.getLong(this, propertyIndex); 730 } 731 732 737 public Sequence getSequence(int propertyIndex) 738 { 739 return SDOUtil.getSequence(this, propertyIndex); 740 } 741 742 747 public short getShort(int propertyIndex) 748 { 749 return SDOUtil.getShort(this, propertyIndex); 750 } 751 752 757 public String getString(int propertyIndex) 758 { 759 return SDOUtil.getString(this, propertyIndex); 760 } 761 762 767 public void setBigDecimal(int propertyIndex, BigDecimal value) 768 { 769 SDOUtil.setBigDecimal(this, propertyIndex, value); 770 } 771 772 777 public void setBigInteger(int propertyIndex, BigInteger value) 778 { 779 SDOUtil.setBigInteger(this, propertyIndex, value); 780 } 781 782 787 public void setBoolean(int propertyIndex, boolean value) 788 { 789 SDOUtil.setBoolean(this, propertyIndex, value); 790 } 791 792 797 public void setByte(int propertyIndex, byte value) 798 { 799 SDOUtil.setByte(this, propertyIndex, value); 800 } 801 802 807 public void setBytes(int propertyIndex, byte[] value) 808 { 809 SDOUtil.setBytes(this, propertyIndex, value); 810 } 811 812 817 public void setChar(int propertyIndex, char value) 818 { 819 SDOUtil.setChar(this, propertyIndex, value); 820 } 821 822 827 public void setDataObject(int propertyIndex, DataObject value) 828 { 829 SDOUtil.setDataObject(this, propertyIndex, value); 830 } 831 832 837 public void setDate(int propertyIndex, Date value) 838 { 839 SDOUtil.setDate(this, propertyIndex, value); 840 } 841 842 847 public void setDouble(int propertyIndex, double value) 848 { 849 SDOUtil.setDouble(this, propertyIndex, value); 850 } 851 852 857 public void setFloat(int propertyIndex, float value) 858 { 859 SDOUtil.setFloat(this, propertyIndex, value); 860 } 861 862 867 public void setInt(int propertyIndex, int value) 868 { 869 SDOUtil.setInt(this, propertyIndex, value); 870 } 871 872 877 public void setList(int propertyIndex, List value) 878 { 879 SDOUtil.setList(this, propertyIndex, value); 880 } 881 882 887 public void setLong(int propertyIndex, long value) 888 { 889 SDOUtil.setLong(this, propertyIndex, value); 890 } 891 892 897 public void setShort(int propertyIndex, short value) 898 { 899 SDOUtil.setShort(this, propertyIndex, value); 900 } 901 902 907 public void setString(int propertyIndex, String value) 908 { 909 SDOUtil.setString(this, propertyIndex, value); 910 } 911 912 917 public BigDecimal getBigDecimal(Property property) 918 { 919 return SDOUtil.getBigDecimal(this, property); 920 } 921 922 927 public BigInteger getBigInteger(Property property) 928 { 929 return SDOUtil.getBigInteger(this, property); 930 } 931 932 937 public boolean getBoolean(Property property) 938 { 939 return SDOUtil.getBoolean(this, property); 940 } 941 942 947 public byte getByte(Property property) 948 { 949 return SDOUtil.getByte(this, property); 950 } 951 952 957 public byte[] getBytes(Property property) 958 { 959 return SDOUtil.getBytes(this, property); 960 } 961 962 967 public char getChar(Property property) 968 { 969 return SDOUtil.getChar(this, property); 970 } 971 972 977 public DataObject getDataObject(Property property) 978 { 979 return SDOUtil.getDataObject(this, property); 980 } 981 982 987 public Date getDate(Property property) 988 { 989 return SDOUtil.getDate(this, property); 990 } 991 992 997 public double getDouble(Property property) 998 { 999 return SDOUtil.getDouble(this, property); 1000 } 1001 1002 1007 public float getFloat(Property property) 1008 { 1009 return SDOUtil.getFloat(this, property); 1010 } 1011 1012 1017 public int getInt(Property property) 1018 { 1019 return SDOUtil.getInt(this, property); 1020 } 1021 1022 1027 public List getList(Property property) 1028 { 1029 return SDOUtil.getList(this, property); 1030 } 1031 1032 1037 public long getLong(Property property) 1038 { 1039 return SDOUtil.getLong(this, property); 1040 } 1041 1042 1047 public Sequence getSequence(Property property) 1048 { 1049 return SDOUtil.getSequence(this, property); 1050 } 1051 1052 1057 public short getShort(Property property) 1058 { 1059 return SDOUtil.getShort(this, property); 1060 } 1061 1062 1067 public String getString(Property property) 1068 { 1069 return SDOUtil.getString(this, property); 1070 } 1071 1072 1077 public void setBigDecimal(Property property, BigDecimal value) 1078 { 1079 SDOUtil.setBigDecimal(this, property, value); 1080 } 1081 1082 1087 public void setBigInteger(Property property, BigInteger value) 1088 { 1089 SDOUtil.setBigInteger(this, property, value); 1090 } 1091 1092 1097 public void setBoolean(Property property, boolean value) 1098 { 1099 SDOUtil.setBoolean(this, property, value); 1100 } 1101 1102 1107 public void setByte(Property property, byte value) 1108 { 1109 SDOUtil.setByte(this, property, value); 1110 } 1111 1112 1117 public void setBytes(Property property, byte[] value) 1118 { 1119 SDOUtil.setBytes(this, property, value); 1120 } 1121 1122 1127 public void setChar(Property property, char value) 1128 { 1129 SDOUtil.setChar(this, property, value); 1130 } 1131 1132 1137 public void setDataObject(Property property, DataObject value) 1138 { 1139 SDOUtil.setDataObject(this, property, value); 1140 } 1141 1142 1147 public void setDate(Property property, Date value) 1148 { 1149 SDOUtil.setDate(this, property, value); 1150 } 1151 1152 1157 public void setDouble(Property property, double value) 1158 { 1159 SDOUtil.setDouble(this, property, value); 1160 } 1161 1162 1167 public void setFloat(Property property, float value) 1168 { 1169 SDOUtil.setFloat(this, property, value); 1170 } 1171 1172 1177 public void setInt(Property property, int value) 1178 { 1179 SDOUtil.setInt(this, property, value); 1180 } 1181 1182 1187 public void setList(Property property, List value) 1188 { 1189 SDOUtil.setList(this, property, value); 1190 } 1191 1192 1197 public void setLong(Property property, long value) 1198 { 1199 SDOUtil.setLong(this, property, value); 1200 } 1201 1202 1207 public void setShort(Property property, short value) 1208 { 1209 SDOUtil.setShort(this, property, value); 1210 } 1211 1212 1217 public void setString(Property property, String value) 1218 { 1219 SDOUtil.setString(this, property, value); 1220 } 1221 1222 1227 public DataObject createDataObject(String propertyName) 1228 { 1229 return SDOUtil.createDataObject(this, propertyName); 1230 } 1231 1232 1237 public DataObject createDataObject(int propertyIndex) 1238 { 1239 return SDOUtil.createDataObject(this, propertyIndex); 1240 } 1241 1242 1247 public DataObject createDataObject(Property property) 1248 { 1249 return SDOUtil.createDataObject(this, property); 1250 } 1251 1252 1257 public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) 1258 { 1259 return SDOUtil.createDataObject(this, propertyName, namespaceURI, typeName); 1260 } 1261 1262 1267 public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) 1268 { 1269 return SDOUtil.createDataObject(this, propertyIndex, namespaceURI, typeName); 1270 } 1271 1272 1277 public DataObject createDataObject(Property property, Type type) 1278 { 1279 return SDOUtil.createDataObject(this, property, type); 1280 } 1281 1282 1287 public void delete() 1288 { 1289 SDOUtil.delete(this); 1290 } 1291 1292 1297 public List getInstanceProperties() 1298 { 1299 return SDOUtil.getInstanceProperties(this); 1300 } 1301 1302 1307 public Object writeReplace() throws ObjectStreamException 1308 { 1309 return SDOUtil.writeReplace(this); 1310 } 1311 1312 1317 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) 1318 { 1319 if (featureID >= 0) 1320 { 1321 switch (eDerivedStructuralFeatureID(featureID, baseClass)) 1322 { 1323 case SDOPackage.ECHANGE_SUMMARY_SETTING__LIST_CHANGES: 1324 return ((InternalEList)getListChanges()).basicRemove(otherEnd, msgs); 1325 default: 1326 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 1327 } 1328 } 1329 return eBasicSetContainer(null, featureID, msgs); 1330 } 1331 1332 1337 public Object eGet(EStructuralFeature eFeature, boolean resolve) 1338 { 1339 switch (eDerivedStructuralFeatureID(eFeature)) 1340 { 1341 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE_NAME: 1342 return getFeatureName(); 1343 case SDOPackage.ECHANGE_SUMMARY_SETTING__DATA_VALUE: 1344 return getDataValue(); 1345 case SDOPackage.ECHANGE_SUMMARY_SETTING__SET: 1346 return isSet() ? Boolean.TRUE : Boolean.FALSE; 1347 case SDOPackage.ECHANGE_SUMMARY_SETTING__VALUE: 1348 return getValue(); 1349 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE: 1350 if (resolve) return getFeature(); 1351 return basicGetFeature(); 1352 case SDOPackage.ECHANGE_SUMMARY_SETTING__REFERENCE_VALUE: 1353 if (resolve) return getReferenceValue(); 1354 return basicGetReferenceValue(); 1355 case SDOPackage.ECHANGE_SUMMARY_SETTING__LIST_CHANGES: 1356 return getListChanges(); 1357 case SDOPackage.ECHANGE_SUMMARY_SETTING__PROPERTY: 1358 return getProperty(); 1359 } 1360 return eDynamicGet(eFeature, resolve); 1361 } 1362 1363 1368 public void eSet(EStructuralFeature eFeature, Object newValue) 1369 { 1370 switch (eDerivedStructuralFeatureID(eFeature)) 1371 { 1372 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE_NAME: 1373 setFeatureName((String )newValue); 1374 return; 1375 case SDOPackage.ECHANGE_SUMMARY_SETTING__DATA_VALUE: 1376 setDataValue((String )newValue); 1377 return; 1378 case SDOPackage.ECHANGE_SUMMARY_SETTING__SET: 1379 setSet(((Boolean )newValue).booleanValue()); 1380 return; 1381 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE: 1382 setFeature((EStructuralFeature)newValue); 1383 return; 1384 case SDOPackage.ECHANGE_SUMMARY_SETTING__REFERENCE_VALUE: 1385 setReferenceValue((EObject)newValue); 1386 return; 1387 case SDOPackage.ECHANGE_SUMMARY_SETTING__LIST_CHANGES: 1388 getListChanges().clear(); 1389 getListChanges().addAll((Collection )newValue); 1390 return; 1391 } 1392 eDynamicSet(eFeature, newValue); 1393 } 1394 1395 1400 public void eUnset(EStructuralFeature eFeature) 1401 { 1402 switch (eDerivedStructuralFeatureID(eFeature)) 1403 { 1404 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE_NAME: 1405 unsetFeatureName(); 1406 return; 1407 case SDOPackage.ECHANGE_SUMMARY_SETTING__DATA_VALUE: 1408 setDataValue(DATA_VALUE_EDEFAULT); 1409 return; 1410 case SDOPackage.ECHANGE_SUMMARY_SETTING__SET: 1411 setSet(SET_EDEFAULT); 1412 return; 1413 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE: 1414 unsetFeature(); 1415 return; 1416 case SDOPackage.ECHANGE_SUMMARY_SETTING__REFERENCE_VALUE: 1417 setReferenceValue((EObject)null); 1418 return; 1419 case SDOPackage.ECHANGE_SUMMARY_SETTING__LIST_CHANGES: 1420 getListChanges().clear(); 1421 return; 1422 } 1423 eDynamicUnset(eFeature); 1424 } 1425 1426 1431 public boolean eIsSet(EStructuralFeature eFeature) 1432 { 1433 switch (eDerivedStructuralFeatureID(eFeature)) 1434 { 1435 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE_NAME: 1436 return isSetFeatureName(); 1437 case SDOPackage.ECHANGE_SUMMARY_SETTING__DATA_VALUE: 1438 return DATA_VALUE_EDEFAULT == null ? getDataValue() != null : !DATA_VALUE_EDEFAULT.equals(getDataValue()); 1439 case SDOPackage.ECHANGE_SUMMARY_SETTING__SET: 1440 return set != SET_EDEFAULT; 1441 case SDOPackage.ECHANGE_SUMMARY_SETTING__VALUE: 1442 return VALUE_EDEFAULT == null ? getValue() != null : !VALUE_EDEFAULT.equals(getValue()); 1443 case SDOPackage.ECHANGE_SUMMARY_SETTING__FEATURE: 1444 return isSetFeature(); 1445 case SDOPackage.ECHANGE_SUMMARY_SETTING__REFERENCE_VALUE: 1446 return basicGetReferenceValue() != null; 1447 case SDOPackage.ECHANGE_SUMMARY_SETTING__LIST_CHANGES: 1448 return listChanges != null && !listChanges.isEmpty(); 1449 case SDOPackage.ECHANGE_SUMMARY_SETTING__PROPERTY: 1450 return getProperty() != null; 1451 } 1452 return eDynamicIsSet(eFeature); 1453 } 1454 1455 1460 public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) 1461 { 1462 if (baseClass == ChangeSummary.Setting.class) 1463 { 1464 switch (derivedFeatureID) 1465 { 1466 case SDOPackage.ECHANGE_SUMMARY_SETTING__PROPERTY: return SDOPackage.CHANGE_SUMMARY_SETTING__PROPERTY; 1467 default: return -1; 1468 } 1469 } 1470 return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); 1471 } 1472 1473 1478 public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) 1479 { 1480 if (baseClass == ChangeSummary.Setting.class) 1481 { 1482 switch (baseFeatureID) 1483 { 1484 case SDOPackage.CHANGE_SUMMARY_SETTING__PROPERTY: return SDOPackage.ECHANGE_SUMMARY_SETTING__PROPERTY; 1485 default: return -1; 1486 } 1487 } 1488 return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); 1489 } 1490 1491} | Popular Tags |