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