本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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()));
}
}
}
}
}
}
示例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);
}
}
}
}
示例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));
}
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
}
}
}
}
}
示例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);
}
}
}
}
示例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()));
}
}
}
}