当前位置: 首页>>代码示例>>Java>>正文


Java EClass.isSuperTypeOf方法代码示例

本文整理汇总了Java中org.eclipse.emf.ecore.EClass.isSuperTypeOf方法的典型用法代码示例。如果您正苦于以下问题:Java EClass.isSuperTypeOf方法的具体用法?Java EClass.isSuperTypeOf怎么用?Java EClass.isSuperTypeOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.emf.ecore.EClass的用法示例。


在下文中一共展示了EClass.isSuperTypeOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processPossibleInclude

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
protected void processPossibleInclude(CanInclude previousInclude, Include include) throws QueryException, DatabaseException {
		if (include.hasTypes()) {
			for (EClass filterClass : include.getTypes()) {
				if (!filterClass.isSuperTypeOf(currentObject.eClass())) {
//					System.out.println(filterClass.getName() + " / " + currentObject.eClass().getName());
					return;
				}
			}
		}
		if (include.hasDirectFields()) {
			for (EReference eReference : include.getFieldsDirect()) {
				Object ref = currentObject.get(eReference.getName());
				if (ref != null) {
					currentObject.setReference(eReference, (Long)ref);
				}
			}
		}
//		if (include.hasFields()) {
//			for (EStructuralFeature eStructuralFeature : include.getFields()) {
//				// TODO do we really have to iterate through the EAtrributes as well?
//				currentObject.addUseForSerialization(eStructuralFeature);
//			}
//		}

		getQueryObjectProvider().push(new RunnableQueryIncludeStackFrame(getQueryObjectProvider(), getReusable(), previousInclude, include, currentObject, getQueryPart()));
	}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:27,代码来源:RunnableQueryTypeStackFrame.java

示例2: processPossibleInclude

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
protected void processPossibleInclude(CanInclude previousInclude, Include include) throws QueryException, DatabaseException {
		if (include.hasTypes()) {
			for (EClass filterClass : include.getTypes()) {
				if (!filterClass.isSuperTypeOf(currentObject.eClass())) {
//					System.out.println(filterClass.getName() + " / " + currentObject.eClass().getName());
					return;
				}
			}
		}
		if (include.hasFields()) {
			for (EStructuralFeature eStructuralFeature : include.getFields()) {
				currentObject.addUseForSerialization(eStructuralFeature);
			}
		}
		getQueryObjectProvider().push(new RunnableQueryIncludeStackFrame(getQueryObjectProvider(), getReusable(), previousInclude, include, currentObject, queryPart));
	}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:17,代码来源:RunnableDatabaseReadingStackFrame.java

示例3: processPossibleInclude

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
protected void processPossibleInclude(CanInclude previousInclude, Include include) throws QueryException, DatabaseException {
		if (include.hasTypes()) {
			for (EClass filterClass : include.getTypes()) {
				if (!filterClass.isSuperTypeOf(currentObject.eClass())) {
//					System.out.println(filterClass.getName() + " / " + currentObject.eClass().getName());
					return;
				}
			}
		}
		if (include.hasFields()) {
			for (EStructuralFeature eStructuralFeature : include.getFields()) {
				currentObject.addUseForSerialization(eStructuralFeature);
			}
		}
		getQueryObjectProvider().push(new QueryIncludeStackFrame(getQueryObjectProvider(), getReusable(), previousInclude, include, currentObject, queryPart));
	}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:17,代码来源:DatabaseReadingStackFrame.java

示例4: processPossibleInclude

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
protected void processPossibleInclude(CanInclude previousInclude, Include include) throws QueryException, DatabaseException {
		if (include.hasTypes()) {
			for (EClass filterClass : include.getTypes()) {
				if (!filterClass.isSuperTypeOf(currentObject.eClass())) {
//					System.out.println(filterClass.getName() + " / " + currentObject.eClass().getName());
					return;
				}
			}
		}
		if (include.hasDirectFields()) {
			for (EReference eReference : include.getFieldsDirect()) {
				Object ref = currentObject.get(eReference.getName());
				if (ref != null) {
					currentObject.setReference(eReference, (Long)ref);
				}
			}
		}
//		if (include.hasFields()) {
//			for (EStructuralFeature eStructuralFeature : include.getFields()) {
//				// TODO do we really have to iterate through the EAtrributes as well?
//				currentObject.addUseForSerialization(eStructuralFeature);
//			}
//		}

		getQueryObjectProvider().push(new QueryIncludeStackFrame(getQueryObjectProvider(), getReusable(), previousInclude, include, currentObject, getQueryPart()));
	}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:27,代码来源:QueryTypeStackFrame.java

示例5: generateProperty

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public void generateProperty(PackageMetaData packageMetaData, VirtualObject ifcPropertySingleValue, PropertySet propertySet) {
	EClass ifcPropertySingleValueClass = packageMetaData.getEClass("IfcPropertySingleValue");
	if (!ifcPropertySingleValueClass.isSuperTypeOf(ifcPropertySingleValue.eClass())) {
		return;
	}
	String name = (String) ifcPropertySingleValue.get("Name");
	Object nominalValue = ifcPropertySingleValue.get("NominalValue");
	if (nominalValue != null) {
		WrappedVirtualObject ifcValue = (WrappedVirtualObject) nominalValue;
		if (ifcValue.eClass().getEAnnotation("wrapped") != null) {
			Object value = ifcValue.eGet("wrappedValue");
			Propertry property = new Propertry();
			property.setName(name);
			property.setValue(value);
			propertySet.getPropertiySet().add(property);
		}
		
	}
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:20,代码来源:StreamPropertyGenerator.java

示例6: proccessBuild

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public List<BuildingCellContainer> proccessBuild() {
	EClass ifcProjectEClass = (EClass) packageMetaData.getEClassifierCaseInsensitive("IfcProduct");
	Set<EClass> subClasses = packageMetaData.getAllSubClasses(ifcProjectEClass);
	Integer rid = concreteRevision.getRevisionId();
	Map<String, BuildingCellContainer> containers = new HashMap<>();
	EClass ifcSpaceEClass = packageMetaData.getEClass("IfcSpace");
	for (EClass eClass : subClasses) {
		Short cid = catalogService.getCidOfEClass(eClass);
		CloseableIterator<VirtualObject> productIterator = virtualObjectService.streamByRidAndCid(rid, cid);
		while (productIterator.hasNext()) {
			VirtualObject product = productIterator.next();
			Object geometryInfo = product.get("geometry");
			if (geometryInfo != null && !ifcSpaceEClass.isSuperTypeOf(product.eClass())) {
				processCell(product, containers);
			}
		}
	}
	List<BuildingCellContainer> result = new ArrayList<>();
	result.addAll(containers.values());
	return result;
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:22,代码来源:StreamBuildingCellGenerator.java

示例7: generatePropertySet

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes" })
public PropertySet generatePropertySet(PackageMetaData packageMetaData, IdEObject ifcPropertySet, PropertySetCollection collection) {
	
	EClass ifcPropertySetClass = packageMetaData.getEClass("IfcPropertySet");
	if (!ifcPropertySetClass.isSuperTypeOf(ifcPropertySet.eClass())) {
		return null;
	}
	
	Long setOid = ifcPropertySet.getOid();
	String setName = (String) ifcPropertySet.eGet(ifcPropertySetClass.getEStructuralFeature("Name"));
	
	PropertySet propertySet = new PropertySet();
	propertySet.setOid(setOid);
	propertySet.setName(setName);
	
	List hasProperties = (List) ifcPropertySet.eGet(ifcPropertySetClass.getEStructuralFeature("HasProperties"));
	for (Object hasProperty : hasProperties) {
		if (hasProperty instanceof IdEObject) {
			IdEObject ifcPropertySingleValue = (IdEObject) hasProperty;
			generateProperty(packageMetaData, ifcPropertySingleValue, propertySet);
		}
	}
	
	return propertySet;
	
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:27,代码来源:PropertyGenerator.java

示例8: generateProperty

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public void generateProperty(PackageMetaData packageMetaData, IdEObject ifcPropertySingleValue, PropertySet propertySet) {
		EClass ifcPropertySingleValueClass = packageMetaData.getEClass("IfcPropertySingleValue");
		if (!ifcPropertySingleValueClass.isSuperTypeOf(ifcPropertySingleValue.eClass())) {
			return;
		}
//		Long oid = ifcPropertySingleValue.getOid();
		String name = (String) ifcPropertySingleValue.eGet(ifcPropertySingleValueClass.getEStructuralFeature("Name"));
		Object nominalValue = ifcPropertySingleValue.eGet(ifcPropertySingleValueClass.getEStructuralFeature("NominalValue"));
		if (nominalValue != null) {
			IdEObject ifcValue = (IdEObject) nominalValue;
			if (ifcValue.eClass().getEAnnotation("wrapped") != null) {
				EStructuralFeature wrappedFeature = ifcValue.eClass().getEStructuralFeature("wrappedValue");
				Object value = ifcValue.eGet(wrappedFeature);
				Propertry property = new Propertry();
				property.setName(name);
				property.setValue(value);
				propertySet.getPropertiySet().add(property);
			}
			
		}
	}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:22,代码来源:PropertyGenerator.java

示例9: getFirstContainer

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
/**
 * Gets the first container with the specified class type of the specified
 * element.
 * 
 * @param elt
 *            The element to check container.
 * @param cls
 *            The expected container class.
 * @return The corresponding container elsewhere <code>null</code>.
 */
public static EObject getFirstContainer(EObject elt, EClass cls) {
	EObject container = null;

	if (elt != null) {
		container = elt.eContainer();
	}

	if (container == null) {
		return null;
	}

	if (cls.isSuperTypeOf(container.eClass())) {
		return container;
	}

	return getFirstContainer(container, cls);
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:28,代码来源:EcoreUtil2.java

示例10: getProperty

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public List<PropertySet> getProperty() {
	
	EClass productClass = packageMetaData.getEClass("IfcProduct");
	if (!productClass.isSuperTypeOf(product.eClass())) {
		return null;
	}
	List<PropertySet> result = new ArrayList<PropertySet>();
	PropertySetCollection collection = new PropertySetCollection();
	Object isDefinedByReference = product.get("IsDefinedBy");
	if (isDefinedByReference != null) {
		List isDefinedByList = (List) isDefinedByReference;
		for (Object isDefinedBy : isDefinedByList) {
			VirtualObject ifcRelDefinesByProperties = oidContainer.get((Long) isDefinedBy);
			Object relatingPropertyDefinitionRef = ifcRelDefinesByProperties.get("RelatingPropertyDefinition");
			if (relatingPropertyDefinitionRef != null) {
				VirtualObject relatingPropertyDefinition = oidContainer.get((Long) relatingPropertyDefinitionRef);
				PropertySet propertySet = generatePropertySet(packageMetaData, relatingPropertyDefinition, collection);
				if (propertySet != null) {
					result.add(propertySet);
				}
				
			}
			
		}
	}
	return result;
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:29,代码来源:StreamPropertyGenerator.java

示例11: generatePropertySet

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes" })
public PropertySet generatePropertySet(PackageMetaData packageMetaData, VirtualObject ifcPropertySet, PropertySetCollection collection) {
	
	EClass ifcPropertySetClass = packageMetaData.getEClass("IfcPropertySet");
	if (!ifcPropertySetClass.isSuperTypeOf(ifcPropertySet.eClass())) {
		return null;
	}
	
	Long setOid = ifcPropertySet.getOid();
	String setName = (String) ifcPropertySet.eGet(ifcPropertySetClass.getEStructuralFeature("Name"));
	
	PropertySet propertySet = new PropertySet();
	propertySet.setOid(setOid);
	propertySet.setName(setName);
	
	Object hasProperties = ifcPropertySet.get("HasProperties");
	if (hasProperties != null) {
		List hasPropertiesList = (List) hasProperties;
		for (Object hasProperty : hasPropertiesList) {
			VirtualObject ifcPropertySingleValue = oidContainer.get((Long) hasProperty);
				generateProperty(packageMetaData, ifcPropertySingleValue, propertySet);
		}
	}
	
	
	return propertySet;
	
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:29,代码来源:StreamPropertyGenerator.java

示例12: getProperty

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public List<PropertySet> getProperty(PackageMetaData packageMetaData, IdEObject product) {
	
	EClass productClass = packageMetaData.getEClass("IfcProduct");
	if (!productClass.isSuperTypeOf(product.eClass())) {
		return null;
	}
	List<PropertySet> result = new ArrayList<PropertySet>();
	PropertySetCollection collection = new PropertySetCollection();
	EReference isDefinedByReference = packageMetaData.getEReference(product.eClass().getName(), "IsDefinedBy");
	if (isDefinedByReference != null) {
		List isDefinedByList = (List) product.eGet(isDefinedByReference);
		for (Object isDefinedBy : isDefinedByList) {
			if (isDefinedBy instanceof IdEObject) {
				IdEObject ifcRelDefinesByProperties = (IdEObject) isDefinedBy;
				if (packageMetaData.getEClass("IfcRelDefinesByProperties").isSuperTypeOf(ifcRelDefinesByProperties.eClass())) {
					EReference relatingPropertyDefinitionEReference = packageMetaData.getEReference(ifcRelDefinesByProperties.eClass().getName(), "RelatingPropertyDefinition");
					Object relatingPropertyDefinition = ifcRelDefinesByProperties.eGet(relatingPropertyDefinitionEReference);
					if (relatingPropertyDefinition instanceof IdEObject) {
						IdEObject ifcPropertySet = (IdEObject) relatingPropertyDefinition;
						PropertySet propertySet = generatePropertySet(packageMetaData, ifcPropertySet, collection);
						if (propertySet != null) {
							result.add(propertySet);
						}
					}
				}
			}
			
		}
	}
	return result;
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:33,代码来源:PropertyGenerator.java

示例13: isInstanceOf

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private Boolean isInstanceOf(IdEObject originObject, String type) {
	PackageMetaData packageMetaData = model.getPackageMetaData();
	EClass eClass = packageMetaData.getEClass(type);
	return eClass.isSuperTypeOf(originObject.eClass());
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:6,代码来源:ColladaSerializer.java

示例14: collectBuildingStorey

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private void collectBuildingStorey(VirtualObject object, BuildingStorey buildingStorey) {
	EClass ifcObjectDefinitionEclass = packageMetaData.getEClass("IfcObjectDefinition");
	if (!ifcObjectDefinitionEclass.isSuperTypeOf(object.eClass())) {
		return;
	}
	Integer rid = concreteRevision.getRevisionId();
	EClass ifcProductEclass = packageMetaData.getEClass("IfcProduct");
	if (ifcProductEclass.isSuperTypeOf(object.eClass())) {
		Object containsElements = object.get("ContainsElements");
		
		if (containsElements != null) {
			List containsElementsList = (List) containsElements;
			for (Object containsElement : containsElementsList) {

				VirtualObject containsElementObject = oidContainer.get((Long) containsElement);
				Object relatedElements = containsElementObject.get("RelatedElements");
				if (relatedElements != null) {
					List relatedElementsList = (List) relatedElements;
					for (Object relatedElement : relatedElementsList) {
						VirtualObject relatedElementObject = oidContainer.get((Long) relatedElement);
						collectBuildingStorey(relatedElementObject, buildingStorey);
						buildingStorey.getOidContains().add(relatedElementObject.getOid());
					}
				}
			}
		}
	}

	Object isDecomposedByObject = object.get("IsDecomposedBy");

	if (isDecomposedByObject != null) {

		List isDecomposedByList = (List) isDecomposedByObject;

		for (Object isDecomposedByRef : isDecomposedByList) {
			VirtualObject isDecomposedBy = oidContainer.get((Long) isDecomposedByRef);

			EClass ifcRelAggregatesEclass = packageMetaData.getEClass("IfcRelAggregates");
			if (ifcRelAggregatesEclass.isSuperTypeOf(isDecomposedBy.eClass())) {
				Object relatedObjects = isDecomposedBy.get("RelatedObjects");
				List relatedObjectsList = (List) relatedObjects;
				for (Object relatedObject : relatedObjectsList) {
					VirtualObject relatedVirtualObject = oidContainer.get((Long) relatedObject);
					collectBuildingStorey(relatedVirtualObject, buildingStorey);
					buildingStorey.getOidContains().add(relatedVirtualObject.getOid());
				}
			}
		}

	}
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:53,代码来源:StreamBuildingStoreyGenerator.java

示例15: isInstanceOf

import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private Boolean isInstanceOf(IdEObject originObject, String type) {
	EClass eClass = packageMetaData.getEClass(type);
	return eClass.isSuperTypeOf(originObject.eClass());
}
 
开发者ID:shenan4321,项目名称:BIMplatform,代码行数:5,代码来源:BuildingStoreyGenerator.java


注:本文中的org.eclipse.emf.ecore.EClass.isSuperTypeOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。