Search in sources :

Example 1 with ListWaitingObject

use of org.bimserver.shared.ListWaitingObject in project BIMserver by opensourceBIM.

the class SharedJsonDeserializer method processRef.

@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));
        }
    }
}
Also used : EntityDefinition(nl.tue.buildingsmart.schema.EntityDefinition) EAttribute(org.eclipse.emf.ecore.EAttribute) Attribute(nl.tue.buildingsmart.schema.Attribute) InverseAttribute(nl.tue.buildingsmart.schema.InverseAttribute) EObject(org.eclipse.emf.ecore.EObject) ListWaitingObject(org.bimserver.shared.ListWaitingObject) InverseAttribute(nl.tue.buildingsmart.schema.InverseAttribute) EReference(org.eclipse.emf.ecore.EReference)

Aggregations

Attribute (nl.tue.buildingsmart.schema.Attribute)1 EntityDefinition (nl.tue.buildingsmart.schema.EntityDefinition)1 InverseAttribute (nl.tue.buildingsmart.schema.InverseAttribute)1 ListWaitingObject (org.bimserver.shared.ListWaitingObject)1 EAttribute (org.eclipse.emf.ecore.EAttribute)1 EObject (org.eclipse.emf.ecore.EObject)1 EReference (org.eclipse.emf.ecore.EReference)1