public boolean useForSerialization(EClass eClass, EStructuralFeature eStructuralFeature) { if (this.getSchemaDefinition() == null) { return true; } return useForSerialization.get(eClass).contains(eStructuralFeature); }
public boolean useForDatabaseStorage(EClass eClass, EStructuralFeature eStructuralFeature) { if (this.getSchemaDefinition() == null) { return true; } Set<EStructuralFeature> set = useForDatabaseStorage.get(eClass); if (set == null) { return true; } return set.contains(eStructuralFeature); }
private void buildUseForSerializationSet(EClass eClass) { if (this.getSchemaDefinition() != null) { if (!useForSerialization.containsKey(eClass)) { HashSet<EStructuralFeature> set = new HashSet<>(); for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) { EntityDefinition entityBN = this.getSchemaDefinition().getEntityBN(eClass.getName()); // if (eStructuralFeature.getEAnnotation("hidden") != null) { // if (eStructuralFeature.getEAnnotation("asstring") == null) { // } else { // if (entityBN.isDerived(eStructuralFeature.getName().substring(0, eStructuralFeature.getName().length() - 8))) { // } else { // set.add(eStructuralFeature); // } // } // } if (entityBN != null) { Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName()); if (attribute != null && attribute instanceof ExplicitAttribute) { if (!entityBN.isDerived(eStructuralFeature.getName()) || entityBN.isDerivedOverride(eStructuralFeature.getName())) { set.add(eStructuralFeature); } } } } useForSerialization.put(eClass, set); } } }
private void buildUseForDatabaseStorage(EClass eClass) { if (this.getSchemaDefinition() != null) { HashSet<EStructuralFeature> set = new HashSet<>(); for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) { EntityDefinition entityBN = this.getSchemaDefinition().getEntityBN(eClass.getName()); if (entityBN == null) { set.add(eStructuralFeature);
public HideAllInversesObjectIDM(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) { addToGeneralIgnoreSet(new StructuralFeatureIdentifier(entity.getName(), attribute.getName())); } } } } }
@SuppressWarnings("rawtypes") public IfcModelInterface read(InputStream in, IfcModelInterface model, boolean checkWaitingList) throws DeserializeException { if (model.getPackageMetaData().getSchemaDefinition() == null) { throw new DeserializeException("No SchemaDefinition available");
protected boolean isInverse(EStructuralFeature eStructuralFeature) throws ObjectIDMException { if (eStructuralFeature instanceof EReference && eStructuralFeature.getEContainingClass().getEAnnotation("wrapped") == null) { if (eStructuralFeature.getEAnnotation("hidden") == null && eStructuralFeature.getEContainingClass().getEAnnotation("hidden") == null) { EntityDefinition entityBN = packageMetaData.getSchemaDefinition().getEntityBN(eStructuralFeature.getEContainingClass().getName()); if (entityBN == null) { throw new ObjectIDMException(eStructuralFeature.getEContainingClass().getName() + " not found"); } Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName()); return attribute instanceof InverseAttribute; } else { return false; } } return false; }
@SuppressWarnings("rawtypes") public void mark(Set<? extends IdEObject> rootObjects) { referencedObjects.addAll(rootObjects); SchemaDefinition schema = ifcModel.getPackageMetaData().getSchemaDefinition(); for (IdEObject rootObject : rootObjects) { for (EReference eReference : rootObject.eClass().getEAllReferences()) {
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)); } } }
String refType = jsonReader.nextString(); boolean isInverse = false; EntityDefinition entityBN = model.getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName()); if (entityBN != null) {