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


Java EClass.getEAllStructuralFeatures方法代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.EClass.getEAllStructuralFeatures方法的典型用法代碼示例。如果您正苦於以下問題:Java EClass.getEAllStructuralFeatures方法的具體用法?Java EClass.getEAllStructuralFeatures怎麽用?Java EClass.getEAllStructuralFeatures使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.ecore.EClass的用法示例。


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

示例1: getAllFeatures

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private static List<EStructuralFeature> getAllFeatures(EClass clazz) {
	List<EStructuralFeature> features = new ArrayList<>(clazz.getEAllStructuralFeatures());
	Collections.sort(features, new Comparator<EStructuralFeature>() {
		@Override
		public int compare(EStructuralFeature o1, EStructuralFeature o2) {
			return o1.getName().compareTo(o2.getName());
		}
	});
	return features;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:11,代碼來源:OrderedEmfFormatter.java

示例2: calculateUnsettedLength

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private int calculateUnsettedLength(EClass eClass) {
	int fieldCounter = 0;
	for (EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
		if (this.useForDatabaseStorage(eClass, feature)) {
			fieldCounter++;
		}
	}
	int unsettedLength = (int) Math.ceil(fieldCounter / 8.0);
	unsettedLengths.put(eClass, unsettedLength);
	return unsettedLength;
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:12,代碼來源:PackageMetaData.java

示例3: buildUseForSerializationSet

import org.eclipse.emf.ecore.EClass; //導入方法依賴的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

示例4: buildUseForDatabaseStorage

import org.eclipse.emf.ecore.EClass; //導入方法依賴的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

示例5: write

import org.eclipse.emf.ecore.EClass; //導入方法依賴的package包/類
private void write(IdEObject object) throws SerializerException, IOException {
	EClass eClass = object.eClass();
	if (eClass.getEAnnotation("hidden") != null) {
		return;
	}
	print(DASH);
	int convertedKey = getExpressId(object);
	if (convertedKey == -1) {
		throw new SerializerException("Going to serialize an object with id -1 (" + object.eClass().getName() + ")");
	}
	print(String.valueOf(convertedKey));
	print("= ");
	String upperCase = getPackageMetaData().getUpperCase(eClass);
	if (upperCase == null) {
		throw new SerializerException("Type not found: " + eClass.getName());
	}
	print(upperCase);
	print(OPEN_PAREN);
	boolean isFirst = true;
	EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
	for (EStructuralFeature feature : eClass.getEAllStructuralFeatures()) {
		if (feature.getEAnnotation("hidden") == null && (entityBN != null && (!entityBN.isDerived(feature.getName()) || entityBN.isDerivedOverride(feature.getName())))) {
			EClassifier type = feature.getEType();
			if (type instanceof EEnum) {
				if (!isFirst) {
					print(COMMA);
				}
				writeEnum(object, feature);
				isFirst = false;
			} else if (type instanceof EClass) {
				EReference eReference = (EReference)feature;
				if (!getPackageMetaData().isInverse(eReference)) {
					if (!isFirst) {
						print(COMMA);
					}
					writeEClass(object, feature);
					isFirst = false;
				}
			} else if (type instanceof EDataType) {
				if (!isFirst) {
					print(COMMA);
				}
				writeEDataType(object, entityBN, feature);
				isFirst = false;
			}
		}
	}
	println(PAREN_CLOSE_SEMICOLON);
}
 
開發者ID:shenan4321,項目名稱:BIMplatform,代碼行數:50,代碼來源:IfcStepSerializer.java


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