| 1 17 package org.eclipse.emf.codegen.ecore.genmodel.impl; 18 19 20 import java.util.ArrayList ; 21 import java.util.Arrays ; 22 import java.util.Collection ; 23 import java.util.Collections ; 24 import java.util.HashSet ; 25 import java.util.Iterator ; 26 import java.util.LinkedHashMap ; 27 import java.util.List ; 28 import java.util.Map ; 29 import java.util.Set ; 30 31 import org.eclipse.core.runtime.IProgressMonitor; 32 import org.eclipse.core.runtime.SubProgressMonitor; 33 import org.eclipse.emf.codegen.ecore.CodeGenEcorePlugin; 34 import org.eclipse.emf.codegen.ecore.Generator; 35 import org.eclipse.emf.codegen.ecore.genmodel.GenClass; 36 import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier; 37 import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; 38 import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage; 39 import org.eclipse.emf.codegen.ecore.genmodel.GenOperation; 40 import org.eclipse.emf.codegen.ecore.genmodel.GenParameter; 41 import org.eclipse.emf.codegen.ecore.genmodel.GenProviderKind; 42 import org.eclipse.emf.common.notify.Notification; 43 import org.eclipse.emf.common.notify.NotificationChain; 44 import org.eclipse.emf.common.util.EList; 45 import org.eclipse.emf.common.util.UniqueEList; 46 import org.eclipse.emf.ecore.EAttribute; 47 import org.eclipse.emf.ecore.EClass; 48 import org.eclipse.emf.ecore.EClassifier; 49 import org.eclipse.emf.ecore.EOperation; 50 import org.eclipse.emf.ecore.EReference; 51 import org.eclipse.emf.ecore.EStructuralFeature; 52 import org.eclipse.emf.ecore.InternalEObject; 53 import org.eclipse.emf.ecore.impl.ENotificationImpl; 54 import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; 55 import org.eclipse.emf.ecore.util.ExtendedMetaData; 56 import org.eclipse.emf.ecore.util.InternalEList; 57 58 59 77 public class GenClassImpl extends GenClassifierImpl implements GenClass 78 { 79 87 protected static final GenProviderKind PROVIDER_EDEFAULT = GenProviderKind.SINGLETON_LITERAL; 88 89 97 protected GenProviderKind provider = PROVIDER_EDEFAULT; 98 99 107 protected static final boolean IMAGE_EDEFAULT = true; 108 109 117 protected boolean image = IMAGE_EDEFAULT; 118 119 127 protected EClass ecoreClass = null; 128 129 137 protected EList genFeatures = null; 138 139 147 protected EList genOperations = null; 148 149 157 protected GenFeature labelFeature = null; 158 159 164 protected GenClassImpl() 165 { 166 super(); 167 } 168 169 174 protected EClass eStaticClass() 175 { 176 return GenModelPackage.eINSTANCE.getGenClass(); 177 } 178 179 184 public GenProviderKind getProvider() 185 { 186 return provider; 187 } 188 189 public boolean isProviderSingleton() 190 { 191 return provider == GenProviderKind.SINGLETON_LITERAL; 192 } 193 194 199 public void setProvider(GenProviderKind newProvider) 200 { 201 GenProviderKind oldProvider = provider; 202 provider = newProvider == null ? PROVIDER_EDEFAULT : newProvider; 203 if (eNotificationRequired()) 204 eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_CLASS__PROVIDER, oldProvider, provider)); 205 } 206 207 212 public boolean isImage() 213 { 214 return image; 215 } 216 217 222 public void setImage(boolean newImage) 223 { 224 boolean oldImage = image; 225 image = newImage; 226 if (eNotificationRequired()) 227 eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_CLASS__IMAGE, oldImage, image)); 228 } 229 230 235 public EClass getEcoreClass() 236 { 237 if (ecoreClass != null && ecoreClass.eIsProxy()) 238 { 239 EClass oldEcoreClass = ecoreClass; 240 ecoreClass = (EClass)eResolveProxy((InternalEObject)ecoreClass); 241 if (ecoreClass != oldEcoreClass) 242 { 243 if (eNotificationRequired()) 244 eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenModelPackage.GEN_CLASS__ECORE_CLASS, oldEcoreClass, ecoreClass)); 245 } 246 } 247 return ecoreClass; 248 } 249 250 255 public EClass basicGetEcoreClass() 256 { 257 return ecoreClass; 258 } 259 260 265 public void setEcoreClass(EClass newEcoreClass) 266 { 267 EClass oldEcoreClass = ecoreClass; 268 ecoreClass = newEcoreClass; 269 if (eNotificationRequired()) 270 eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_CLASS__ECORE_CLASS, oldEcoreClass, ecoreClass)); 271 } 272 273 278 public EList getGenFeatures() 279 { 280 if (genFeatures == null) 281 { 282 genFeatures = new EObjectContainmentWithInverseEList(GenFeature.class, this, GenModelPackage.GEN_CLASS__GEN_FEATURES, GenModelPackage.GEN_FEATURE__GEN_CLASS); 283 } 284 return genFeatures; 285 } 286 287 292 public EList getGenOperations() 293 { 294 if (genOperations == null) 295 { 296 genOperations = new EObjectContainmentWithInverseEList(GenOperation.class, this, GenModelPackage.GEN_CLASS__GEN_OPERATIONS, GenModelPackage.GEN_OPERATION__GEN_CLASS); 297 } 298 return genOperations; 299 } 300 301 public EClassifier getEcoreClassifier() 302 { 303 return getEcoreClass(); 304 } 305 306 public String getImportedMetaType() 307 { 308 return getGenModel().getImportedName("org.eclipse.emf.ecore.EClass"); 309 } 310 311 public String getInterfaceName() 312 { 313 return getName(); 314 } 315 316 public String getQualifiedInterfaceName() 317 { 318 return getInternalQualifiedInterfaceName().replace('$', '.'); 319 } 320 321 protected String getInternalQualifiedInterfaceName() 322 { 323 return isExternalInterface() ? 324 getEcoreClass().getInstanceClassName() : 325 getGenPackage().getInterfacePackageName() + "." + getInterfaceName(); 326 } 327 328 public String getImportedInstanceClassName() 329 { 330 return getImportedInterfaceName(); 331 } 332 333 public String getImportedInterfaceName() 334 { 335 return getGenModel().getImportedName(getInternalQualifiedInterfaceName()); 336 } 337 338 public String getClassName() 339 { 340 return getImplClassName(getInterfaceName()); 341 } 342 343 public String getQualifiedClassName() 344 { 345 return getGenPackage().getClassPackageName() + "." + getClassName(); 346 } 347 348 public String getImportedClassName() 349 { 350 return getGenModel().getImportedName(getQualifiedClassName()); 351 } 352 353 public List getBaseGenClasses() 354 { 355 return collectGenClasses(getEcoreClass().getESuperTypes(), null); 356 } 357 358 public List getAllBaseGenClasses() 359 { 360 return collectGenClasses(getEcoreClass().getEAllSuperTypes(), null); 361 } 362 363 public List getSwitchGenClasses() 364 { 365 List result = 368 collectGenClasses 369 (getEcoreClass().getESuperTypes(), 370 new GenClassFilter() 371 { 372 public boolean accept(GenClass genClass) 373 { 374 return !genClass.isEObject(); 375 } 376 }); 377 Set resultSet = new HashSet (result); 378 379 for (int i = 0; i < result.size(); i++) 380 { 381 GenClass base = (GenClass)result.get(i); 382 for (Iterator iter = base.getBaseGenClasses().iterator(); iter.hasNext(); ) 383 { 384 GenClass baseOfBase = (GenClass)iter.next(); 385 if (!baseOfBase.isEObject() && resultSet.add(baseOfBase)) 386 { 387 result.add(baseOfBase); 388 } 389 } 390 } 391 return result; 392 } 393 394 public GenClass getBaseGenClass() 395 { 396 List s = getEcoreClass().getESuperTypes(); 397 return s.isEmpty() ? null : findGenClass((EClass)s.iterator().next()); 398 } 399 400 public GenClass getClassExtendsGenClass() 401 { 402 GenClass base = getBaseGenClass(); 403 while (base != this) 404 { 405 if (base == null || !base.isInterface()) return base; 406 base = base.getBaseGenClass(); 407 } 408 throw new RuntimeException ("inheritance loop at " + getName()); 409 } 410 411 public String getClassExtends() 412 { 413 GenClass extendsClass = getClassExtendsGenClass(); 414 if (extendsClass != null) 415 { 416 return " extends " + extendsClass.getImportedClassName(); 417 } 418 else if (!isEObject()) 419 { 420 String rootExtendsClass = getGenModel().getRootExtendsClass(); 421 if (!isBlank(rootExtendsClass)) 422 { 423 return " extends " + getGenModel().getImportedName(rootExtendsClass); 424 } 425 } 426 return ""; 427 } 428 429 public boolean needsRootImplementsInterfaceOperations() 430 { 431 if (!isMapEntry()) 432 { 433 String rootImplementsInterface = getGenModel().getRootImplementsInterface(); 434 if (!isBlank(rootImplementsInterface)) 435 { 436 GenClass extendsClass = getClassExtendsGenClass(); 437 438 if (extendsClass != null && !rootImplementsInterface.equals(extendsClass.getGenModel().getRootImplementsInterface())) 441 { 442 return true; 443 } 444 } 445 } 446 return false; 447 } 448 449 public String getClassImplements() 450 { 451 if (isMapEntry()) 452 { 453 return " implements " + getGenModel().getImportedName("org.eclipse.emf.common.util.BasicEMap$Entry"); 454 } 455 else 456 { 457 String result = " implements " + getImportedInterfaceName(); 458 String rootImplementsInterface = getGenModel().getRootImplementsInterface(); 459 if (!isBlank(rootImplementsInterface)) 460 { 461 GenClass extendsClass = getClassExtendsGenClass(); 462 463 if (extendsClass != null && !rootImplementsInterface.equals(extendsClass.getGenModel().getRootImplementsInterface())) 466 { 467 result += ", " + getGenModel().getImportedName(rootImplementsInterface); 468 } 469 } 470 471 return result; 472 } 473 } 474 475 public boolean needsRootExtendsInterfaceExtendsTag() 476 { 477 String rootExtendsInterface = getGenModel().getRootExtendsInterface(); 478 if (rootExtendsInterface == null) 479 { 480 rootExtendsInterface = ""; 481 } 482 if (isBlank(rootExtendsInterface) || getBaseGenClasses().isEmpty() && getGenPackage().isEcorePackage()) 483 { 484 return false; 485 } 486 487 for (Iterator iter = getAllBaseGenClasses().iterator(); iter.hasNext(); ) 488 { 489 GenClass genClass = (GenClass)iter.next(); 490 if (genClass.getEcoreClass().getInstanceClassName() == null && 491 rootExtendsInterface.equals(genClass.getGenModel().getRootExtendsInterface())) 492 { 493 return false; 494 } 495 } 496 497 return !rootExtendsInterface.equals("org.eclipse.emf.ecore.EObject"); 498 } 499 500 public String getInterfaceExtends() 501 { 502 String rootExtendsInterface = getGenModel().getRootExtendsInterface(); 503 if (rootExtendsInterface == null) 504 { 505 rootExtendsInterface = ""; 506 } 507 if (getBaseGenClasses().isEmpty()) 508 { 509 if (getGenPackage().isEcorePackage()) 510 { 511 return ""; 512 } 513 else 514 { 515 if (!isBlank(rootExtendsInterface)) 516 { 517 return " extends " + getGenModel().getImportedName(rootExtendsInterface); 518 } 519 else 520 { 521 return ""; 522 } 523 } 524 } 525 526 boolean needsRootExtendsInterface = true; 527 for (Iterator iter = getAllBaseGenClasses().iterator(); iter.hasNext(); ) 528 { 529 GenClass genClass = (GenClass)iter.next(); 530 if (genClass.getEcoreClass().getInstanceClassName() == null && 531 rootExtendsInterface.equals(genClass.getGenModel().getRootExtendsInterface())) 532 { 533 needsRootExtendsInterface = false; 534 break; 535 } 536 } 537 538 StringBuffer result = new StringBuffer (" extends "); 539 if (needsRootExtendsInterface) 540 { 541 if (!isBlank(rootExtendsInterface)) 542 { 543 result.append(getGenModel().getImportedName(rootExtendsInterface)); 544 result.append(", "); 545 } 546 } 547 548 for (Iterator iter = getBaseGenClasses().iterator(); iter.hasNext(); ) 549 { 550 result.append(((GenClass)iter.next()).getImportedInterfaceName()); 551 if (iter.hasNext()) result.append(", "); 552 } 553 return result.toString(); 554 } 555 556 public List getAllGenFeatures() 557 { 558 return collectGenFeatures(getAllBaseGenClasses(), getGenFeatures(), null); 559 } 560 561 public List getInheritedGenFeatures() 562 { 563 return collectGenFeatures(getAllBaseGenClasses(), null, null); 564 } 565 566 public List getAllGenOperations() 567 { 568 return collectGenOperations(getAllBaseGenClasses(), getGenOperations(), null); 569 } 570 571 public String getFeatureID(GenFeature genFeature) 572 { 573 return getClassifierID() + "__" + format(genFeature.getName(), '_', null, false).toUpperCase(); 574 } 575 576 public String getQualifiedFeatureID(GenFeature genFeature) 577 { 578 return getGenPackage().getImportedPackageInterfaceName() + "." + getFeatureID(genFeature); 579 } 580 581 public String getOperationID(GenOperation genOperation) 582 { 583 return getClassifierID() + "__" + format(genOperation.getName(), '_', null, false).toUpperCase(); 584 } 585 586 public String getFeatureValue(GenFeature genFeature) 587 { 588 List allFeatures = getAllGenFeatures(); 589 int i = allFeatures.indexOf(genFeature); 590 GenClass base = getBaseGenClass(); 591 592 if (base == null) 593 { 594 return Integer.toString(i); 595 } 596 597 int baseCount = base.getFeatureCount(); 598 if (i < baseCount) 599 { 600 return getGenPackage() == base.getGenPackage() ? 601 base.getFeatureID(genFeature) : base.getQualifiedFeatureID(genFeature); 602 } 603 604 String baseCountID = getGenPackage() == base.getGenPackage() ? 605 base.getFeatureCountID() : base.getQualifiedFeatureCountID(); 606 return baseCountID + " + " + Integer.toString(i - baseCount); 607 } 608 609 public String getLocalFeatureIndex(GenFeature genFeature) 610 { 611 return Integer.toString(getEcoreClass().getEStructuralFeatures().indexOf(genFeature.getEcoreFeature())); 612 } 613 614 public String getFlagsField(GenFeature genFeature) 615 { 616 if (isFlag(genFeature)) 617 { 618 String flagsField = getImplementedGenFeatures().contains(genFeature) ? getGenModel().getBooleanFlagsField() 619 : genFeature.getGenModel().getBooleanFlagsField(); 620 if (!isBlank(flagsField)) 621 { 622 int flagIndex = getFlagIndex(genFeature); 623 if (flagIndex / 32 > 0) 624 { 625 flagsField += String.valueOf(flagIndex / 32); 626 } 627 return flagsField; 628 } 629 } 630 return null; 631 } 632 633 public int getFlagIndex(GenFeature genFeature) 634 { 635 if (isFlag(genFeature)) 636 { 637 int reservedBooleanFlags = getImplementedGenFeatures().contains(genFeature) ? getGenModel().getBooleanFlagsReservedBits() 638 : genFeature.getGenModel().getBooleanFlagsReservedBits(); 639 int index = reservedBooleanFlags > 0 ? reservedBooleanFlags - 1 : -1; 640 641 for (Iterator otherGenFeatures = getAllGenFeatures().iterator(); otherGenFeatures.hasNext();) 642 { 643 GenFeature otherGenFeature = (GenFeature)otherGenFeatures.next(); 644 if (isFlag(otherGenFeature)) 645 { 646 index++; 647 648 if (otherGenFeature.getEcoreFeature() == genFeature.getEcoreFeature()) 649 return index; 650 } 651 if (isESetFlag(otherGenFeature)) 652 { 653 index++; 654 } 655 } 656 } 657 return -1; 658 } 659 660 public String getESetFlagsField(GenFeature genFeature) 661 { 662 if (isESetFlag(genFeature)) 663 { 664 String isSetFlagsField = getImplementedGenFeatures().contains(genFeature) ? getGenModel().getBooleanFlagsField() 665 : genFeature.getGenModel().getBooleanFlagsField(); 666 if (!isBlank(isSetFlagsField)) 667 { 668 int isSetFlagIndex = getESetFlagIndex(genFeature); 669 if (isSetFlagIndex / 32 > 0) 670 { 671 isSetFlagsField += String.valueOf(isSetFlagIndex / 32); 672 } 673 return isSetFlagsField; 674 } 675 } 676 return null; 677 } 678 679 public int getESetFlagIndex(GenFeature genFeature) 680 { 681 if (isESetFlag(genFeature)) 682 { 683 int reservedBooleanFlags = getImplementedGenFeatures().contains(genFeature) ? getGenModel().getBooleanFlagsReservedBits() 684 : genFeature.getGenModel().getBooleanFlagsReservedBits(); 685 int index = reservedBooleanFlags > 0 ? reservedBooleanFlags - 1 : -1; 686 687 for (Iterator otherGenFeatures = getAllGenFeatures().iterator(); otherGenFeatures.hasNext();) 688 { 689 GenFeature otherGenFeature = (GenFeature)otherGenFeatures.next(); 690 if (isFlag(otherGenFeature)) 691 { 692 index++; 693 } 694 if (isESetFlag(otherGenFeature)) 695 { 696 index++; 697 698 if (otherGenFeature.getEcoreFeature() == genFeature.getEcoreFeature()) 699 return index; 700 } 701 } 702 } 703 return -1; 704 } 705 706 public String getFeatureCountID() 707 { 708 return getClassifierID() + "_FEATURE_COUNT"; 709 } 710 711 public String getQualifiedFeatureCountID() 712 { 713 return getGenPackage().getImportedPackageInterfaceName() + "." + getFeatureCountID(); 714 } 715 716 public String getFeatureCountValue() 717 { 718 GenClass base = getBaseGenClass(); 719 if (base == null) 720 { 721 return Integer.toString(getFeatureCount()); 722 } 723 724 String baseCountID = getGenPackage() == base.getGenPackage() ? 725 base.getFeatureCountID() : base.getQualifiedFeatureCountID(); 726 return baseCountID + " + " + Integer.toString(getFeatureCount() - base.getFeatureCount()); 727 } 728 729 public int getFeatureCount() 730 { 731 return getAllGenFeatures().size(); 732 } 733 734 public boolean isEObject() 735 { 736 return getName().equals("EObject") && getGenPackage().isEcorePackage(); 737 } 738 739 public boolean isEObjectExtension() 740 { 741 if (isMapEntry()) 742 { 743 return false; 744 } 745 else 746 { 747 for (Iterator iter = getAllBaseGenClasses().iterator(); iter.hasNext(); ) 748 { 749 GenClass genClass = (GenClass)iter.next(); 750 if (genClass.isEObjectExtension()) 751 { 752 return true; 753 } 754 } 755 756 return getGenPackage().isEcorePackage() || "org.eclipse.emf.ecore.EObject".equals(getGenModel().getRootExtendsInterface()); 757 } 758 } 759 760 public boolean isAbstract() 761 { 762 return getEcoreClass().isAbstract() || getEcoreClass().isInterface(); 765 } 766 767 public String getAbstractFlag() 768 { 769 String result = !isAbstract() ? "!" : ""; 770 return result + "IS_ABSTRACT"; 771 } 772 773 public boolean isInterface() 774 { 775 return getEcoreClass().isInterface(); 776 } 777 778 public String getInterfaceFlag() 779 { 780 String result = !getEcoreClass().isInterface() ? "!" : ""; 781 return result + "IS_INTERFACE"; 782 } 783 784 public String getGeneratedInstanceClassFlag() 785 { 786 String result = isExternalInterface() ? "!" : ""; 787 return result + "IS_GENERATED_INSTANCE_CLASS"; 788 } 789 790 public boolean isExternalInterface() 791 { 792 return getEcoreClass().getInstanceClassName() != null; 793 } 794 795 public boolean isMapEntry() 796 { 797 return 798 isJavaUtilMapEntry(getEcoreClass().getInstanceClassName()) && 799 getEcoreClass().getEStructuralFeature("key") != null && 800 getEcoreClass().getEStructuralFeature("value") != null; 801 } 802 803 public GenFeature getMapEntryKeyFeature() 804 { 805 return findGenFeature(getEcoreClass().getEStructuralFeature("key")); 806 } 807 808 public GenFeature getMapEntryValueFeature() 809 { 810 return findGenFeature(getEcoreClass().getEStructuralFeature("value")); 811 } 812 813 public List getImplementedGenClasses() 814 { 815 List allBases = getAllBaseGenClasses(); 816 GenClass extendedBase = getClassExtendsGenClass(); 817 int i = extendedBase == null ? 0 : allBases.indexOf(extendedBase) + 1; 818 List result = new ArrayList (allBases.subList(i, allBases.size())); 819 result.add(this); 820 return result; 821 } 822 823 public List getImplementedGenFeatures() 824 { 825 return collectGenFeatures(getImplementedGenClasses(), null, null); 826 } 827 828 public List getImplementedGenOperations() 829 { 830 List implementedGenClasses = new UniqueEList(getImplementedGenClasses()); 831 if (needsRootImplementsInterfaceOperations()) 832 { 833 GenClass rootImplementsInterface = getGenModel().getRootImplementsInterfaceGenClass(); 834 if (rootImplementsInterface != null) 835 { 836 List allBaseClasses = new UniqueEList(rootImplementsInterface.getAllBaseGenClasses()); 837 for (Iterator i = allBaseClasses.iterator(); i.hasNext(); ) 838 { 839 GenClass genClass = (GenClass)i.next(); 840 if (genClass.isEObject()) 841 { 842 i.remove(); 843 } 844 } 845 allBaseClasses.add(rootImplementsInterface); 846 implementedGenClasses.addAll(allBaseClasses); 847 } 848 } 849 return 850 collectGenOperations 851 (implementedGenClasses, 852 null, 853 new CollidingGenOperationFilter()); 854 } 855 856 public List getExtendedGenClasses() 857 { 858 List allBases = getAllBaseGenClasses(); 859 GenClass extendedBase = getClassExtendsGenClass(); 860 int i = extendedBase == null ? 0 : allBases.indexOf(extendedBase) + 1; 861 return new ArrayList (allBases.subList(0, i)); 862 } 863 864 public List getExtendedGenFeatures() 865 { 866 return collectGenFeatures(getExtendedGenClasses(), null, null); 867 } 868 869 public List getExtendedGenOperations() 870 { 871 return 872 collectGenOperations 873 (getExtendedGenClasses(), 874 null, 875 new CollidingGenOperationFilter()); 876 } 877 878 public List getDeclaredGenFeatures() 879 { 880 return getGenFeatures(); 881 } 882 883 public List getDeclaredGenOperations() 884 { 885 return getGenOperations(); 886 } 887 888 public List getFlagGenFeatures() 889 { 890 return collectGenFeatures(null, getImplementedGenFeatures(), new GenFeatureFilter() 891 { 892 public boolean accept(GenFeature genFeature) 893 { 894 return isFlag(genFeature); 895 } 896 }); 897 } 898 899 public List getFlagGenFeatures(final String staticDefaultValue) 900 { 901 return collectGenFeatures(null, getFlagGenFeatures(), new GenFeatureFilter() 902 { 903 public boolean accept(GenFeature genFeature) 904 { 905 return staticDefaultValue.equalsIgnoreCase(genFeature.getStaticDefaultValue()); 906 } 907 }); 908 } 909 910 public List getESetGenFeatures() 911 { 912 return 913 collectGenFeatures 914 (getAllBaseGenClasses(), 915 getGenFeatures(), 916 new GenFeatureFilter() 917 { 918 public boolean accept(GenFeature genFeature) 919 { 920 return genFeature.isChangeable(); 921 } 922 }); 923 } 924 925 public List getEInverseAddGenFeatures() 926 { 927 return 928 collectGenFeatures 929 (getAllBaseGenClasses(), 930 getGenFeatures(), 931 new GenFeatureFilter() 932 { 933 public boolean accept(GenFeature genFeature) 934 { 935 return genFeature.isBidirectional() && !genFeature.isVolatile(); 936 } 937 }); 938 } 939 940 public List getEInverseRemoveGenFeatures() 941 { 942 return 943 collectGenFeatures 944 (getAllBaseGenClasses(), 945 getGenFeatures(), 946 new GenFeatureFilter() 947 { 948 public boolean accept(GenFeature genFeature) 949 { 950 return genFeature.isContains() || 951 (genFeature.isBidirectional() && 952 !genFeature.getReverse().isVolatile()) || 953 genFeature.isFeatureMapType(); 954 } 955 }); 956 } 957 958 public List getEBasicRemoveFromContainerGenFeatures() 959 { 960 <
|