references.put(reference.getReferredObject(), rSet); if (reference.geteReference().getEOpposite() != null) { if (reference.geteReference().getEOpposite().isMany()) { MultiReference backReference = new MultiReference(reference.getReferredObject(), reference.getIdEObject(), reference.geteReference().getEOpposite()); if (references.containsKey(reference.getIdEObject())) references.get(reference.getIdEObject()).add(backReference); SingleReference backReference = new SingleReference(reference.getReferredObject(), reference.getIdEObject(), reference.geteReference().getEOpposite()); if (references.containsKey(reference.getIdEObject())) references.get(reference.getIdEObject()).add(backReference);
private void initOppositeInfo() { for (EClassifier eClassifier : ePackage.getEClassifiers()) { if (eClassifier instanceof EClass) { EClass eClass = (EClass)eClassifier; boolean hasOpposites = false; boolean hasManyOpposites = false; for (EReference eReference : eClass.getEAllReferences()) { if (eReference.getEOpposite() != null) { hasOpposites = true; if (eReference.isMany()) { hasManyOpposites = true; } } } oppositeInfos.put(eClass, new OppositeInfo(hasOpposites, hasManyOpposites)); } } }
if (resultModel.getByGuid(guid).eGet(eReference) != null && eReference.getEOpposite() != null) { IdEObject x = (IdEObject) resultModel.getByGuid(guid).eGet(eReference); if (eReference.getEOpposite().isMany()) { List l = (List) x.eGet(eReference.getEOpposite()); if (!clearedLists.contains(l)) { clearedLists.add(l); x.eSet(eReference.getEOpposite(), null); IdEObject referencedIDEObject = (IdEObject) referencedObject; if (resultModel.contains(referencedIDEObject.getOid())) { if (resultModel.getByGuid(guid).eGet(eReference) != null && eReference.getEOpposite() != null) { IdEObject x = (IdEObject) resultModel.getByGuid(guid).eGet(eReference); if (eReference.getEOpposite().isMany()) { List l = (List) x.eGet(eReference.getEOpposite()); if (!clearedLists.contains(l)) { clearedLists.add(l); x.eSet(eReference.getEOpposite(), null); } else { IdEObject smartCopy = copy(resultModel, referencedIDEObject, true); if (resultModel.getByGuid(guid).eGet(eReference) != null && eReference.getEOpposite() != null) { IdEObject re = (IdEObject) resultModel.getByGuid(guid).eGet(eReference); if (eReference.getEOpposite().isMany()) { List l = (List)re.eGet(eReference.getEOpposite()); if (!clearedLists.contains(l)) { clearedLists.add(l);
public SchemaFieldIgnoreMap(Set<? extends EPackage> packages, PackageMetaData packageMetaData) { super(packages); ArrayList<EntityDefinition> entities = packageMetaData.getSchemaDefinition().getEntities(); for (EntityDefinition entity : entities) { for (Attribute attribute : entity.getAttributes(true)) { if (attribute instanceof InverseAttribute) { if (attribute.getName().equals("HasOpenings") || attribute.getName().equals("ContainsElements") || attribute.getName().equals("IsDecomposedBy") || attribute.getName().equals("StyledByItem")) { // || attribute.getName().equals("IsDecomposedBy") || attribute.getName().equals("ContainedInStructure") || attribute.getName().equals("FillsVoids") || attribute.getName().equals("VoidsElements") // Exception: http://code.google.com/p/bimserver/issues/detail?id=303 // Addition: Leon says this should be done for all types } else { EStructuralFeature eStructuralFeature = getEClass(entity.getName()).getEStructuralFeature(attribute.getName()); if (((EReference)eStructuralFeature).getEOpposite() != null) { addToGeneralIgnoreSet(new StructuralFeatureIdentifier(entity.getName(), attribute.getName())); } } } } } } }
@SuppressWarnings({ "unchecked", "rawtypes" }) private void processRef(IfcModelInterface model, WaitingList<Long> waitingList, IdEObjectImpl object, EStructuralFeature eStructuralFeature, int index, AbstractEList list, long refOid) throws DeserializeException { EntityDefinition entityBN = model.getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName()); Attribute attributeBN = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName()); if (skipInverses && attributeBN instanceof InverseAttribute && ((EReference)eStructuralFeature).getEOpposite() != null) { // skip } else { if (model.contains(refOid)) { EObject referencedObject = model.get(refOid); if (referencedObject != null) { addToList(eStructuralFeature, index, list, referencedObject); } } else { waitingList.add(refOid, new ListWaitingObject(-1, object, (EReference) eStructuralFeature, index)); } } }
protected EStructuralFeature.Internal.SettingDelegate eSettingDelegate(EStructuralFeature eFeature) { SettingDelegate eSettingDelegate = super.eSettingDelegate(eFeature); if (useInverses) { return eSettingDelegate; } if (eFeature instanceof EReference && ((EReference)eFeature).getEOpposite() != null) { // TODO cache/pre-generate the objects created in this block if (eFeature.isMany()) { if (eFeature.isUnsettable()) { return new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_UNSETTABLE, eFeature); } else { return new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT, eFeature); } } else { if (eFeature.isUnsettable()) { return new InternalSettingDelegateSingleEObjectUnsettable((EClass) eFeature.getEType(), eFeature); } else { return new InternalSettingDelegateSingleEObject((EClass) eFeature.getEType(), eFeature); } } } else { return eSettingDelegate; } }
protected boolean isIncluded(EReference eReference) { return eReference.getEOpposite() == null && !eReference.isDerived(); }
private static boolean hasPersistentOpposite(EReference ref) { EReference eOpposite = ref.getEOpposite(); return eOpposite != null && EMFUtil.isPersistent(eOpposite); }
if (eReference.getEOpposite() != null) { hasInverse = isInverse(eReference.getEOpposite());
public boolean isFeatureMultiplicityOneTo(EStructuralFeature typeObject) { if (typeObject instanceof EReference) { final EReference feature = (EReference)typeObject; final EReference eOpposite = feature.getEOpposite(); return feature.isContainment() || (eOpposite != null && !eOpposite.isMany()); } else return false; }
public boolean isBidirectional() { if (isReferenceType()) { EReference eReverseFeature = ((EReference)getEcoreFeature()).getEOpposite(); return eReverseFeature != null; // && eReverseFeature.isNavigable(); } return false; }
public boolean isBidirectional() { if (isReferenceType()) { EReference eReverseFeature = ((EReference)getEcoreFeature()).getEOpposite(); return eReverseFeature != null; // && eReverseFeature.isNavigable(); } return false; }
public boolean isContainer() { if (isReferenceType()) { EReference opposite = ((EReference)getEcoreFeature()).getEOpposite(); return opposite != null && opposite.isContainment(); } return false; }
public boolean isContainer() { if (isReferenceType()) { EReference opposite = ((EReference)getEcoreFeature()).getEOpposite(); return opposite != null && opposite.isContainment(); } return false; }
boolean isCandidate(EReference eReference) { if (isFeatureMapEntry(eReference)) { return true; } if (FeatureMapUtil.isFeatureMap(eReference)) { return false; } if (eReference.isTransient() || JsonAnnotations.shouldIgnore(eReference)) { return false; } EReference opposite = eReference.getEOpposite(); return !(opposite != null && opposite.isContainment()); }
public NotificationChain eDynamicBasicRemoveFromContainer(NotificationChain msgs) { EReference inverseFeature = ((EReference)eClass().getEStructuralFeature(eContainerFeatureID())).getEOpposite(); return eInternalContainer().eInverseRemove(this, inverseFeature.getFeatureID(), inverseFeature.getContainerClass(), msgs); }
public NotificationChain eDynamicBasicRemoveFromContainer(NotificationChain msgs) { EReference inverseFeature = ((EReference)eClass().getEStructuralFeature(eContainerFeatureID())).getEOpposite(); return eInternalContainer().eInverseRemove(this, inverseFeature.getFeatureID(), inverseFeature.getContainerClass(), msgs); }
public boolean isVolatile() { // We treat the feature as volatile if it is volatile itself or if it is // a reference whose opposite end is volatile, // unless that opposite volatile reference delegates to a feature map, // in which case, a full implementation of the references can be generated. // EReference eReverseFeature = isReferenceType() ? ((EReference)getEcoreFeature()).getEOpposite() : null; return (getEcoreFeature().isVolatile() || (eReverseFeature != null && eReverseFeature.isVolatile() && !getReverse().hasDelegateFeature())); }
public boolean isVolatile() { // We treat the feature as volatile if it is volatile itself or if it is // a reference whose opposite end is volatile, // unless that opposite volatile reference delegates to a feature map, // in which case, a full implementation of the references can be generated. // EReference eReverseFeature = isReferenceType() ? ((EReference)getEcoreFeature()).getEOpposite() : null; return (getEcoreFeature().isVolatile() || (eReverseFeature != null && eReverseFeature.isVolatile() && !getReverse().hasDelegateFeature())); }
if (eReference.getEOpposite() != null) { return eReference.getEOpposite();