use of nl.tue.buildingsmart.schema.BooleanType in project BIMserver by opensourceBIM.
the class Express2EMF method x.
private EAttribute x(DefinedType type, EClass testType) {
EAttribute wrapperAttrib = eFactory.createEAttribute();
wrapperAttrib.setName("wrappedValue");
if (type.getDomain() instanceof IntegerType) {
wrapperAttrib.setEType(ePackage.getELong());
} else if (type.getDomain() instanceof RealType) {
wrapperAttrib.setEType(ePackage.getEDouble());
} else if (type.getDomain() instanceof StringType) {
wrapperAttrib.setEType(ePackage.getEString());
} else if (type.getDomain() instanceof BooleanType) {
wrapperAttrib.setEType(schemaPack.getEClassifier("Tristate"));
} else if (type.getDomain() instanceof NumberType) {
wrapperAttrib.setEType(ePackage.getEDouble());
} else if (type.getDomain() instanceof BinaryType) {
wrapperAttrib.setEType(ePackage.getEByteArray());
} else if (type.getDomain() instanceof LogicalType) {
wrapperAttrib.setEType(schemaPack.getEClassifier("Tristate"));
}
wrapperAttrib.setUnsettable(true);
testType.getEStructuralFeatures().add(wrapperAttrib);
if (wrapperAttrib.getEType() == ePackage.getEDouble()) {
EAttribute doubleStringAttribute = eFactory.createEAttribute();
doubleStringAttribute.setEType(ePackage.getEString());
doubleStringAttribute.setName("wrappedValueAsString");
doubleStringAttribute.getEAnnotations().add(createAsStringAnnotation());
doubleStringAttribute.getEAnnotations().add(createHiddenAnnotation());
doubleStringAttribute.setUnsettable(true);
testType.getEStructuralFeatures().add(doubleStringAttribute);
}
return wrapperAttrib;
}
Aggregations