當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityDefinition類代碼示例

本文整理匯總了Java中nl.tue.buildingsmart.schema.EntityDefinition的典型用法代碼示例。如果您正苦於以下問題:Java EntityDefinition類的具體用法?Java EntityDefinition怎麽用?Java EntityDefinition使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityDefinition類屬於nl.tue.buildingsmart.schema包,在下文中一共展示了EntityDefinition類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeEClass

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEClass(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof IdEObject && ((IdEObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
		writeWrappedValue(object, feature, ((EObject)referencedObject).eClass());
	} else {
		if (referencedObject instanceof EObject && model.contains((IdEObject) referencedObject)) {
			print(DASH);
			print(String.valueOf(getExpressId((IdEObject) referencedObject)));
		} else {
			EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:21,代碼來源:IfcStepSerializer.java

示例2: writeEClass

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEClass(HashMapVirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof AbstractHashMapVirtualObject && ((AbstractHashMapVirtualObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
		writeWrappedValue(object, feature, ((AbstractHashMapVirtualObject)referencedObject).eClass());
	} else {
		if (referencedObject instanceof Long) {
			if (object.useFeatureForSerialization(feature)) {
				print(DASH);
				print(String.valueOf(getExpressId((Long) referencedObject)));
			} else {
				print(DOLLAR);
			}
		} else {
			EntityDefinition entityBN = getSchemaDefinition().getEntityBN(object.eClass().getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:IfcPlugins,代碼行數:25,代碼來源:IfcStepStreamingSerializer.java

示例3: SchemaFieldIgnoreMap

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
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()));
					}
				}
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:21,代碼來源:SchemaFieldIgnoreMap.java

示例4: addSupertypes

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void addSupertypes() {
	Iterator<EntityDefinition> entIter = schema.getEntities().iterator();
	while (entIter.hasNext()) {
		EntityDefinition ent = entIter.next();
		if (ent.getSupertypes().size() > 0) {
			EClass cls = getOrCreateEClass(ent.getName());
			if (ent.getSupertypes().size() > 0) {
				EClass parent = getOrCreateEClass(ent.getSupertypes().get(0).getName());
				if (!directSubTypes.containsKey(parent)) {
					directSubTypes.put(parent, new HashSet<EClass>());
				}
				directSubTypes.get(parent).add(cls);
				cls.getESuperTypes().add(parent);
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:18,代碼來源:Express2EMF.java

示例5: processRef

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
@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));
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:20,代碼來源:SharedJsonDeserializer.java

示例6: writeEDataType

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEDataType(VirtualObject object, EntityDefinition entityBN, EStructuralFeature feature)
		throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:11,代碼來源:IfcStepStreamingSerializer.java

示例7: writeEClass

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEClass(VirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof VirtualObject) {
		EClass referencedObjectEClass = ((VirtualObject) referencedObject).eClass();
		if (referencedObjectEClass.getEAnnotation("wrapped") != null) {
			writeWrappedValue(object, feature, referencedObjectEClass);
		}
	} else {
		if (referencedObject instanceof Long) {
			if (object.useFeatureForSerialization(feature)) {
				print(DASH);
				print(String.valueOf(getExpressId((Long) referencedObject)));
			} else {
				print(DOLLAR);
			}
		} else {
			EClass objectEClass = platformService.getEClassForCid(object.getEClassId());
			EntityDefinition entityBN = getSchemaDefinition().getEntityBN(objectEClass.getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:29,代碼來源:IfcStepStreamingSerializer.java

示例8: buildUseForSerializationSet

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
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);
			}
		}
	}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:30,代碼來源:PackageMetaData.java

示例9: buildUseForDatabaseStorage

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
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);
			} else {
				if (!entityBN.isDerived(eStructuralFeature.getName())) {
					boolean derived = false;
					if (eStructuralFeature.getEAnnotation("hidden") != null) {
						if (eStructuralFeature.getEAnnotation("asstring") == null) {
						} else {
							if (entityBN.isDerived(eStructuralFeature.getName().substring(0, eStructuralFeature.getName().length() - 8))) {
								derived = true;
							} else {
								set.add(eStructuralFeature);
							}
						}
					}
					Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName());
					if (attribute == null) {
						// geometry, *AsString
						if (!derived) {
							set.add(eStructuralFeature);
						}
					} else {
						if (attribute instanceof ExplicitAttribute || attribute instanceof InverseAttribute) {
							if (!entityBN.isDerived(attribute.getName())) {
								set.add(eStructuralFeature);
							}
						}
					}
				}
			}
		}
		useForDatabaseStorage.put(eClass, set);
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:40,代碼來源:PackageMetaData.java

示例10: isInverse

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
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;
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:16,代碼來源:AbstractObjectIDM.java

示例11: writeEDataType

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEDataType(IdEObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:10,代碼來源:IfcStepSerializer.java

示例12: writeEDataType

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void writeEDataType(HashMapVirtualObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
開發者ID:opensourceBIM,項目名稱:IfcPlugins,代碼行數:10,代碼來源:IfcStepStreamingSerializer.java

示例13: mark

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
@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()) {
			Attribute attributeBNWithSuper = null;
			if (schema != null) {
				EntityDefinition entityBN = schema.getEntityBN(rootObject.eClass().getName());
				if (entityBN == null) {
					LOGGER.info(rootObject.eClass().getName() + " not found");
				} else {
					attributeBNWithSuper = entityBN.getAttributeBNWithSuper(eReference.getName());
					if (attributeBNWithSuper == null) {
						LOGGER.info(eReference.getName() + " not found");
					}
				}
			}
			if (schema == null || !(attributeBNWithSuper instanceof InverseAttribute)) {
				Object referredObject = rootObject.eGet(eReference);
				if (eReference.isMany()) {
					List list = (List) referredObject;
					for (Object o : list) {
						if (!referencedObjects.contains(o)) {
							mark(makeSet((IdEObject) o));
						}
					}
				} else {
					IdEObject referredIdEObject = (IdEObject) referredObject;
					if (referredIdEObject != null) {
						if (!referencedObjects.contains(referredObject)) {
							mark(makeSet(referredIdEObject));
						}
					}
				}
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:40,代碼來源:TracingGarbageCollector.java

示例14: addAttributes

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
private void addAttributes() {
	Iterator<EntityDefinition> entIter = schema.getEntities().iterator();
	while (entIter.hasNext()) {
		EntityDefinition ent = (EntityDefinition) entIter.next();
		Iterator<Attribute> attribIter = ent.getAttributes(false).iterator();
		while (attribIter.hasNext()) {
			Attribute attrib = (Attribute) attribIter.next();
			if (attrib instanceof ExplicitAttribute) {
				processAttribute(ent, attrib);
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:14,代碼來源:Express2EMF.java

示例15: HideAllInversesObjectIDM

import nl.tue.buildingsmart.schema.EntityDefinition; //導入依賴的package包/類
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()));
			}
		}
	}
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:12,代碼來源:HideAllInversesObjectIDM.java


注:本文中的nl.tue.buildingsmart.schema.EntityDefinition類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。