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