Source:
public void prepareDomainObject(VDomainModelReference domainModelReference, EObject domainObject) throws EMFFormsExpandingFailedException { Assert.create(domainModelReference).notNull(); Assert.create(domainObject).notNull(); Assert.create(domainModelReference).ofClass(VKeyAttributeDomainModelReference.class); final VKeyAttributeDomainModelReference keyAttributeDMR = VKeyAttributeDomainModelReference.class .cast(domainModelReference); final VFeaturePathDomainModelReference featurePathDMR = VViewFactory.eINSTANCE .createFeaturePathDomainModelReference(); featurePathDMR.setDomainModelEFeature(keyAttributeDMR.getDomainModelEFeature()); featurePathDMR.getDomainModelEReferencePath().addAll(keyAttributeDMR.getDomainModelEReferencePath()); IValueProperty valueProperty; try { valueProperty = databindingService.getValueProperty(featurePathDMR, domainObject); } catch (final DatabindingFailedException ex) { throw new EMFFormsExpandingFailedException( "Domain Expansion failed due to a failed databinding: " + ex.getMessage()); } final EStructuralFeature listEStructuralFeature = (EStructuralFeature) valueProperty.getValueType(); checkListType(listEStructuralFeature); getEMFFormsDomainExpander().prepareDomainObject(featurePathDMR, domainObject); @SuppressWarnings("unchecked") final List<EObject> eObjectsList = (List<EObject>) valueProperty.getValue(domainObject); for (final EObject targetDomainObject : eObjectsList) { IValueProperty keyValueProperty; try { keyValueProperty = databindingService.getValueProperty(keyAttributeDMR.getKeyDMR(), targetDomainObject); } catch (final DatabindingFailedException ex) { throw new EMFFormsExpandingFailedException( "Domain Expansion failed due to a failed databinding: " + ex.getMessage()); } final Object potentialKey = keyValueProperty.getValue(targetDomainObject); final boolean foundKey = keyAttributeDMR.getKeyValue().equals(potentialKey); if (foundKey) { domainExpander.prepareDomainObject(keyAttributeDMR.getValueDMR(), targetDomainObject); } } }

Target:
public void prepareDomainObject(VDomainModelReference domainModelReference, EObject domainObject) throws EMFFormsExpandingFailedException { Assert.create(domainModelReference).notNull(); Assert.create(domainObject).notNull(); Assert.create(domainModelReference).ofClass(VKeyAttributeDomainModelReference.class); final VKeyAttributeDomainModelReference keyAttributeDMR = VKeyAttributeDomainModelReference.class .cast(domainModelReference); final VFeaturePathDomainModelReference featurePathDMR = VViewFactory.eINSTANCE .createFeaturePathDomainModelReference(); featurePathDMR.setDomainModelEFeature(keyAttributeDMR.getDomainModelEFeature()); featurePathDMR.getDomainModelEReferencePath().addAll(keyAttributeDMR.getDomainModelEReferencePath()); getEMFFormsDomainExpander().prepareDomainObject(featurePathDMR, domainObject); IValueProperty valueProperty; try { valueProperty = databindingService.getValueProperty(featurePathDMR, domainObject); } catch (final DatabindingFailedException ex) { throw new EMFFormsExpandingFailedException( "Domain Expansion failed due to a failed databinding: " + ex.getMessage()); } final EStructuralFeature listEStructuralFeature = (EStructuralFeature) valueProperty.getValueType(); checkListType(listEStructuralFeature); @SuppressWarnings("unchecked") final List<EObject> eObjectsList = (List<EObject>) valueProperty.getValue(domainObject); for (final EObject targetDomainObject : eObjectsList) { IValueProperty keyValueProperty; try { keyValueProperty = databindingService.getValueProperty(keyAttributeDMR.getKeyDMR(), targetDomainObject); } catch (final DatabindingFailedException ex) { throw new EMFFormsExpandingFailedException( "Domain Expansion failed due to an invalid key attribute dmr: " + ex.getMessage()); } final Object potentialKey = keyValueProperty.getValue(targetDomainObject); final boolean foundKey = keyAttributeDMR.getKeyValue().equals(potentialKey); if (foundKey) { domainExpander.prepareDomainObject(keyAttributeDMR.getValueDMR(), targetDomainObject); } } }