本文整理匯總了Java中org.eclipse.emf.ecore.EStructuralFeature.isUnsettable方法的典型用法代碼示例。如果您正苦於以下問題:Java EStructuralFeature.isUnsettable方法的具體用法?Java EStructuralFeature.isUnsettable怎麽用?Java EStructuralFeature.isUnsettable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.emf.ecore.EStructuralFeature
的用法示例。
在下文中一共展示了EStructuralFeature.isUnsettable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: writeObject
import org.eclipse.emf.ecore.EStructuralFeature; //導入方法依賴的package包/類
private void writeObject(VirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
Object ref = object.eGet(feature);
if (ref == null || (feature.isUnsettable() && !object.eIsSet(feature))) {
EClassifier type = feature.getEType();
if (type instanceof EClass) {
EStructuralFeature structuralFeature = ((EClass) type).getEStructuralFeature(WRAPPED_VALUE);
if (structuralFeature != null) {
String name = structuralFeature.getEType().getName();
if (name.equals(IFC_BOOLEAN) || name.equals(IFC_LOGICAL)
|| structuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) {
print(BOOLEAN_UNDEFINED);
} else {
print(DOLLAR);
}
} else {
print(DOLLAR);
}
} else {
if (type == EcorePackage.eINSTANCE.getEBoolean()) {
print(BOOLEAN_UNDEFINED);
} else if (feature.isMany()) {
print("()");
} else {
print(DOLLAR);
}
}
} else {
if (ref instanceof WrappedVirtualObject) {
writeEmbedded((WrappedVirtualObject) ref);
} else if (feature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
EStructuralFeature asStringFeature = object.eClass().getEStructuralFeature(feature.getName() + "AsString");
String asString = (String) object.eGet(asStringFeature);
writeDoubleValue((Double) ref, asString, feature);
} else {
IfcParserWriterUtils.writePrimitive(ref, printWriter);
}
}
}
示例2: writeObject
import org.eclipse.emf.ecore.EStructuralFeature; //導入方法依賴的package包/類
private void writeObject(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
Object ref = object.eGet(feature);
if (ref == null || (feature.isUnsettable() && !object.eIsSet(feature))) {
EClassifier type = feature.getEType();
if (type instanceof EClass) {
EStructuralFeature structuralFeature = ((EClass) type).getEStructuralFeature(WRAPPED_VALUE);
if (structuralFeature != null) {
String name = structuralFeature.getEType().getName();
if (name.equals(IFC_BOOLEAN) || name.equals(IFC_LOGICAL) || structuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) {
print(BOOLEAN_UNDEFINED);
} else {
print(DOLLAR);
}
} else {
print(DOLLAR);
}
} else {
if (type == EcorePackage.eINSTANCE.getEBoolean()) {
print(BOOLEAN_UNDEFINED);
} else if (feature.isMany()) {
print("()");
} else {
print(DOLLAR);
}
}
} else {
if (ref instanceof EObject) {
writeEmbedded((EObject) ref);
} else if (feature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
writeDoubleValue((Double)ref, object, feature);
} else {
IfcParserWriterUtils.writePrimitive(ref, outputStream);
}
}
}