本文整理汇总了Java中org.eclipse.emf.ecore.util.EcoreUtil.Copier.containsKey方法的典型用法代码示例。如果您正苦于以下问题:Java Copier.containsKey方法的具体用法?Java Copier.containsKey怎么用?Java Copier.containsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.util.EcoreUtil.Copier
的用法示例。
在下文中一共展示了Copier.containsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateEObjectsAltered
import org.eclipse.emf.ecore.util.EcoreUtil.Copier; //导入方法依赖的package包/类
@Test
public void updateEObjectsAltered() throws Exception {
final IBase base = new BaseRegistryTests.TestBase();
base.getFactory().addDescriptor(IEObjectLocation.class,
new BaseElementFactory.FactoryDescriptor<TestEObjectLocation>(TestEObjectLocation.class));
base.getFactory().addDescriptor(ICouple.class, new BaseElementFactory.FactoryDescriptor<TestCouple>(
TestCouple.class));
final TestEObjectContainerLocation container = new TestEObjectContainerLocation();
container.setContainer(base);
final Copier copier = new Copier();
EPackage copy = (EPackage)copier.copy(AnydslPackage.eINSTANCE);
if (!copier.containsKey(altered[0])) {
copier.copy((EObject)altered[0]);
}
copier.copyReferences();
final List<EObject> testEObjects = new ArrayList<EObject>(copy.getEClassifiers());
final Resource initialResource = createResource("initialResource");
container.setResource(initialResource);
initialResource.getContents().addAll(testEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, initialResource);
final IEObjectLocation location = createEObjectLocation(copier, container);
final EObject expectedEObject = copier.get(altered[0]);
final EStructuralFeature expectedFeature = (EStructuralFeature)altered[1];
final Object expectedValue;
if (altered[2] instanceof EObject) {
expectedValue = copier.get(altered[2]);
} else {
expectedValue = altered[2];
}
List<EObject> newEObjects = testEObjects;
newEObjects = alterEObjects(copier, newEObjects);
final Resource newResource = createResource("newResource");
newResource.getContents().addAll(newEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, newResource);
container.setResource(newResource);
assertEObjectLocation(location, expectedEObject, expectedFeature, expectedValue);
}
示例2: updateEObjectsPlusShiftAltered
import org.eclipse.emf.ecore.util.EcoreUtil.Copier; //导入方法依赖的package包/类
@Test
public void updateEObjectsPlusShiftAltered() throws Exception {
final IBase base = new BaseRegistryTests.TestBase();
base.getFactory().addDescriptor(IEObjectLocation.class,
new BaseElementFactory.FactoryDescriptor<TestEObjectLocation>(TestEObjectLocation.class));
base.getFactory().addDescriptor(ICouple.class, new BaseElementFactory.FactoryDescriptor<TestCouple>(
TestCouple.class));
final TestEObjectContainerLocation container = new TestEObjectContainerLocation();
container.setContainer(base);
final Copier copier = new Copier();
EPackage copy = (EPackage)copier.copy(AnydslPackage.eINSTANCE);
if (!copier.containsKey(altered[0])) {
copier.copy((EObject)altered[0]);
}
copier.copyReferences();
final List<EObject> testEObjects = new ArrayList<EObject>(copy.getEClassifiers());
final Resource initialResource = createResource("initialResource");
container.setResource(initialResource);
initialResource.getContents().addAll(testEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, initialResource);
final IEObjectLocation location = createEObjectLocation(copier, container);
final EObject expectedEObject = copier.get(altered[0]);
final EStructuralFeature expectedFeature = (EStructuralFeature)original[1];
final Object expectedValue;
if (altered[2] instanceof EObject) {
expectedValue = copier.get(altered[2]);
} else {
expectedValue = altered[2];
}
List<EObject> newEObjects = new ArrayList<EObject>(MappingPackage.eINSTANCE.getEClassifiers());
newEObjects.addAll(testEObjects);
newEObjects = alterEObjects(copier, newEObjects);
final Resource newResource = createResource("newResource");
newResource.getContents().addAll(newEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, newResource);
container.setResource(newResource);
assertEObjectLocation(location, expectedEObject, expectedFeature, expectedValue);
}
示例3: updateEObjectsMinusShiftAltered
import org.eclipse.emf.ecore.util.EcoreUtil.Copier; //导入方法依赖的package包/类
@Test
public void updateEObjectsMinusShiftAltered() throws Exception {
final IBase base = new BaseRegistryTests.TestBase();
base.getFactory().addDescriptor(IEObjectLocation.class,
new BaseElementFactory.FactoryDescriptor<TestEObjectLocation>(TestEObjectLocation.class));
base.getFactory().addDescriptor(ICouple.class, new BaseElementFactory.FactoryDescriptor<TestCouple>(
TestCouple.class));
final TestEObjectContainerLocation container = new TestEObjectContainerLocation();
container.setContainer(base);
final Copier copier = new Copier();
EPackage copy = (EPackage)copier.copy(AnydslPackage.eINSTANCE);
if (!copier.containsKey(altered[0])) {
copier.copy((EObject)altered[0]);
}
copier.copyReferences();
final List<EObject> testEObjects = new ArrayList<EObject>(copy.getEClassifiers());
final Resource initialResource = createResource("initialResource");
container.setResource(initialResource);
initialResource.getContents().addAll(testEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, initialResource);
final IEObjectLocation location = createEObjectLocation(copier, container);
final EObject expectedEObject = copier.get(altered[0]);
final EStructuralFeature expectedFeature = (EStructuralFeature)original[1];
final Object expectedValue;
if (altered[2] instanceof EObject) {
expectedValue = copier.get(altered[2]);
} else {
expectedValue = altered[2];
}
List<EObject> newEObjects = new ArrayList<EObject>(testEObjects);
newEObjects.remove(0);
newEObjects.remove(0);
newEObjects = alterEObjects(copier, newEObjects);
final Resource newResource = createResource("newResource");
newResource.getContents().addAll(newEObjects);
eObjectContainerHelper.updateEObjectContainer(container.getContainer(), container, newResource);
container.setResource(newResource);
assertEObjectLocation(location, expectedEObject, expectedFeature, expectedValue);
}