/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setStart(Parameter newStart) { if (newStart != start) { NotificationChain msgs = null; if (start != null) msgs = ((InternalEObject)start).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__START, null, msgs); if (newStart != null) msgs = ((InternalEObject)newStart).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BpsimPackage.SCENARIO_PARAMETERS__START, null, msgs); msgs = basicSetStart(newStart, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BpsimPackage.SCENARIO_PARAMETERS__START, newStart, newStart)); }
if (isResolveProxies(feature)) if (isNotificationRequired()) EStructuralFeature affiliatedFeature = ExtendedMetaData.INSTANCE.getAffiliation(owner.eClass(), feature); if (affiliatedFeature != getEStructuralFeature()) FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); int featureIndex = 0; Entry [] entries = (Entry[])data; false); notifications.add(createNotification(Notification.RESOLVE, entry, newEntry, index, false)); notifications = object.eInverseRemove(owner, object.eClass().getFeatureID(opposite), null, notifications); notifications = ((InternalEObject)resolved).eInverseAdd(owner, resolved.eClass().getFeatureID(opposite), null, notifications); else if (reference.isContainment()) int inverseFeatureID = InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(reference); notifications = object.eInverseRemove(owner, inverseFeatureID, null, null); if (((InternalEObject)resolved).eInternalContainer() == null) notifications = ((InternalEObject)resolved).eInverseAdd(owner, inverseFeatureID, null, notifications); notifications.dispatch();
EStructuralFeature affiliatedFeature = ExtendedMetaData.INSTANCE.getAffiliation(owner.eClass(), feature); if (affiliatedFeature != getEStructuralFeature()) FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); int featureIndex = 0; for (int i = 0; i < index; ++i) false); notifications.add(createNotification(Notification.RESOLVE, entry, newEntry, index, false)); EReference opposite = reference.getEOpposite(); if (opposite != null) notifications = object.eInverseRemove(owner, object.eClass().getFeatureID(opposite), null, notifications); notifications = ((InternalEObject)resolved).eInverseAdd(owner, resolved.eClass().getFeatureID(opposite), null, notifications); else if (reference.isContainment()) int inverseFeatureID = InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(reference); notifications = object.eInverseRemove(owner, inverseFeatureID, null, null); if (((InternalEObject)resolved).eInternalContainer() == null) notifications = ((InternalEObject)resolved).eInverseAdd(owner, inverseFeatureID, null, notifications); notifications.dispatch();
public EObject create(EClassifier classifier) { if (classifier == null) throw new NullPointerException("Classifier may not be null."); if (!(classifier instanceof EClass)) throw new IllegalArgumentException("Cannot create instance of datatype '" + classifier.getName() + "'"); EClass clazz = (EClass) classifier; if (clazz.isAbstract() || clazz.isInterface()) throw new IllegalArgumentException("Cannot create instance of abstract class '" + clazz.getName() + "'"); if (classifier.eIsProxy()) throw new IllegalStateException("Unresolved proxy "+((InternalEObject)classifier).eProxyURI()+". Make sure the EPackage has been registered."); return clazz.getEPackage().getEFactoryInstance().create(clazz); }
public void dynamicUnset(InternalEObject owner, EStructuralFeature.Internal.DynamicValueHolder settings, int index) { EObject eContainer = owner.eInternalContainer(); if (eContainer != null) { NotificationChain notifications = owner.eBasicRemoveFromContainer(null); int featureID = owner.eClass().getFeatureID(feature); notifications = owner.eBasicSetContainer(null, featureID, notifications); if (notifications != null) notifications.dispatch(); } else { if (owner.eNotificationRequired()) owner.eNotify(new ENotificationImpl(owner, Notification.SET, feature, null, null)); } }
if (feature.isUnsettable() && !view.getStore().isSet(this, feature)) instance.eUnset(feature); return; if (feature.isMany()) InternalEList<Object> list = (InternalEList<Object>)instance.eGet(feature); if (feature.isUnsettable() && object.equals(CDORevisionData.NIL)) int featureID = instance.eClass().getFeatureID(feature); Class<? extends Object> baseClass = object == null ? null : object.getClass(); EStructuralFeature.Internal internalFeature = (EStructuralFeature.Internal)feature; if (object != instance.eContainer()) instance.eInverseAdd((InternalEObject)object, featureID, baseClass, null); if (reference.isContainment()) instance.eSet(feature, object); instance.eSet(feature, null); instance.eSet(feature, object); instance.eSet(feature, null);
@Override public NotificationChain eDynamicInverseAdd(InternalEObject otherEnd, int featureID, Class<?> inverseClass, NotificationChain notifications) { EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); if (feature.isMany()) { return featureMap.basicAdd(feature, otherEnd, notifications); } else if (feature instanceof EReference && ((EReference)feature).isContainer()) { return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); } else { InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); if (oldValue != null) { notifications = oldValue.eInverseRemove (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); notifications = featureMap.basicRemove(feature, oldValue, notifications); } return featureMap.basicAdd(feature, otherEnd, notifications); } }
@Override public NotificationChain eDynamicInverseAdd(InternalEObject otherEnd, int featureID, Class<?> inverseClass, NotificationChain notifications) { EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); if (feature.isMany()) { return featureMap.basicAdd(feature, otherEnd, notifications); } else if (feature instanceof EReference && ((EReference)feature).isContainer()) { return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); } else { InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); if (oldValue != null) { notifications = oldValue.eInverseRemove (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); notifications = featureMap.basicRemove(feature, oldValue, notifications); } return featureMap.basicAdd(feature, otherEnd, notifications); } }
private static void getURI(EObject parent, EObject target, Appendable buf) throws Exception { Resource r = target.eResource(); buf.append(target.eClass().getName()); buf.append("@"); if (r == null) { if (((InternalEObject)target).eIsProxy()) { buf.append("(unresolved proxy "+((InternalEObject)target).eProxyURI()+")"); } else { buf.append("(resource null)"); } } else if (parent.eResource() == r) buf.append(r.getURIFragment(target)); else buf.append(r.getURI().toString()).append("#").append(r.getURIFragment(target)); }
@Override public String toString() { StringBuilder result = new StringBuilder(eClass().getName()); result.append(": "); if (type == null) { result.append(" type is null"); } else if (type.eIsProxy()) { result.append(" (type uri: "); result.append(((InternalEObject) type).eProxyURI()); result.append(')'); } else { result.append(NameConcatHelper.computeFor(this, '$', NameType.TO_STRING)); } return result.toString(); }
public NotificationChain eDynamicBasicRemoveFromContainer(NotificationChain msgs) { EReference inverseFeature = ((EReference)eClass().getEStructuralFeature(eContainerFeatureID())).getEOpposite(); return eInternalContainer().eInverseRemove(this, inverseFeature.getFeatureID(), inverseFeature.getContainerClass(), msgs); }
protected final NotificationChain inverseAdd(InternalEObject owner, InternalEObject otherEnd, int featureID, NotificationChain notifications) { if (otherEnd != null) { int containmentFeatureID = owner.eClass().getFeatureID(eStructuralFeature); notifications = otherEnd.eInverseAdd (owner, InternalEObject.EOPPOSITE_FEATURE_BASE - (containmentFeatureID == -1 ? featureID : containmentFeatureID), null, notifications); } return notifications; }
for (EReference eReference : proxy.eClass().getEAllReferences()) EReference oppositeEReference = eReference.getEOpposite(); if (oppositeEReference != null && oppositeEReference.isChangeable() && proxy.eIsSet(eReference)) resolvedEObject = xmlResource.getEObject(proxy.eProxyURI().fragment()); EObject proxyHolder = (EObject)(eReference.isMany() ? ((List<?>)proxy.eGet(eReference)).get(0) : proxy.eGet(eReference));
protected final NotificationChain inverseRemove(InternalEObject owner, InternalEObject otherEnd, int featureID, NotificationChain notifications) { if (otherEnd != null) { int containmentFeatureID = owner.eClass().getFeatureID(eStructuralFeature); notifications = otherEnd.eInverseRemove (owner, InternalEObject.EOPPOSITE_FEATURE_BASE - (containmentFeatureID == -1 ? featureID : containmentFeatureID), null, notifications); } return notifications; } }
msg = String.format(msg, ePackage.getNsURI(), ((InternalEObject)r).eProxyURI()); throw new IllegalStateException(msg); EClass ownerClass = (EClass)feature.eContainer(); pkg = ownerClass.getEPackage();
private void saveObject(InternalEObject xmiObject, InternalCDOObject cdoObject) for (EStructuralFeature feature : xmiObject.eClass().getEAllStructuralFeatures()) Object xmiValue = xmiObject.eGet(feature); if (feature instanceof EReference) if (reference.isContainment()) if (reference.isMany()) if (reference.isMany()) InternalCDOObject cdoElement; org.eclipse.emf.common.util.URI eProxyURI = xmiElement.eProxyURI(); if (eProxyURI != null) if (xmiValue != null) org.eclipse.emf.common.util.URI eProxyURI = ((InternalEObject)xmiValue).eProxyURI(); if (eProxyURI != null)
EObject eContainer = resolve ? eObject.eContainer() : ((InternalEObject)eObject).eInternalContainer(); if (eContainer != null) result.add(((InternalEObject)eContainer).eSetting(eObject.eContainmentFeature())); for (EReference eReference : eObject.eClass().getEAllReferences()) EReference eOpposite = eReference.getEOpposite(); if (eOpposite != null && !eReference.isContainer() && eObject.eIsSet(eReference)) if (eReference.isMany()) result.add(referencingEObject.eSetting(eOpposite)); result.add(((InternalEObject)eObject.eGet(eReference, resolve())).eSetting(eOpposite));
protected void resolveLazyCrossReference(InternalEObject source, EStructuralFeature crossRef) { if (crossRef.isDerived() || (crossRef instanceof EReference && !((EReference)crossRef).isResolveProxies()) || crossRef.isTransient()) return; if (crossRef.isMany()) { @SuppressWarnings("unchecked") InternalEList<EObject> list = (InternalEList<EObject>) source.eGet(crossRef); for (int i = 0; i < list.size(); i++) { EObject proxy = list.basicGet(i); if (proxy.eIsProxy()) { URI proxyURI = ((InternalEObject) proxy).eProxyURI(); if (getURI().equals(proxyURI.trimFragment())) { final String fragment = proxyURI.fragment(); if (target != null) { try { source.eSetDeliver(false); list.setUnique(i, target); } finally { source.eSetDeliver(true); EObject proxy = (EObject) source.eGet(crossRef, false); if (proxy != null && proxy.eIsProxy()) { URI proxyURI = ((InternalEObject) proxy).eProxyURI(); if (getURI().equals(proxyURI.trimFragment())) { final String fragment = proxyURI.fragment(); if (target != null) { try {
if (((InternalEObject)eObject1).eProxyURI().equals(((InternalEObject)eObject2).eProxyURI())) for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) EStructuralFeature feature = eClass.getEStructuralFeature(i); if (!feature.isDerived())
protected void writeTopAttributes(EObject top) { if (useEncodedAttributeStyle) { InternalEObject container = ((InternalEObject)top).eInternalContainer(); if (container != null) { EReference containmentReference = top.eContainmentFeature(); EReference containerReference = containmentReference.getEOpposite(); if (containerReference != null && !containerReference.isTransient()) { saveEObjectSingle(top, containerReference); } } } }