private SDOProperty buildPropertyFromDataObject(DataObject dataObject, Type containingType, List types) {
String nameValue = dataObject.getString("name");
Object typeObjectValue = dataObject.get("type");
SDOProperty newProperty = new SDOProperty(aHelperContext);
newProperty.setName(nameValue);
Type typeValue = (Type)getValueFromObject(typeObjectValue, types);
newProperty.setType(typeValue);
if (typeValue != null) {
if (typeValue == SDOConstants.SDO_BYTES) {
newProperty.setXsdType(XMLConstants.BASE_64_BINARY_QNAME);
} else if (typeValue.isDataType()) {
if (isBaseTypeBytes(typeValue)) {
newProperty.setXsdType(XMLConstants.BASE_64_BINARY_QNAME);
}
}
}
if (dataObject.isSet("containment")) {
newProperty.setContainment(dataObject.getBoolean("containment"));
} else {
if (typeValue != null) {
newProperty.setContainment(!typeValue.isDataType());
}
}
newProperty.setReadOnly(dataObject.getBoolean("readOnly"));
newProperty.setMany(dataObject.getBoolean("many"));
newProperty.setNullable(dataObject.getBoolean("nullable"));
List aliasNames = dataObject.getList("aliasName");
for (int i = 0; i < aliasNames.size(); i++) {
Object aliasName = aliasNames.get(i);
newProperty.getAliasNames().add(aliasName);
}
Object opposite = dataObject.get("opposite");
if (opposite != null) {
if (opposite instanceof SDOProperty) {
newProperty.setOpposite((SDOProperty)opposite);
((SDOProperty)opposite).setOpposite(newProperty);
} else if(opposite instanceof DataObject) {
SDOProperty prop = (SDOProperty)typeValue.getProperty(((DataObject)opposite).getString("name"));
if(prop != null) {
newProperty.setOpposite(prop);
prop.setOpposite(newProperty);
}
}
}
// set the default only if the default on the dataObject is set
if (dataObject.isSet("default")) {
newProperty.setDefault(dataObject.get("default"));
}
List openProps = ((SDODataObject)dataObject)._getOpenContentProperties();
for (int i = 0; i < openProps.size(); i++) {
SDOProperty nextProp = (SDOProperty)openProps.get(i);
Object value = getValueFromObject(dataObject.get(nextProp), types);
newProperty.setInstanceProperty(nextProp, value);
}
List openPropsAttrs = ((SDODataObject)dataObject)._getOpenContentPropertiesAttributes();
for (int i = 0; i < openPropsAttrs.size(); i++) {
SDOProperty nextProp = (SDOProperty)openPropsAttrs.get(i);
Object value = getValueFromObject(dataObject.get(nextProp), types);
newProperty.setInstanceProperty(nextProp, value);
}
//verify that this property has a type set bug 5768381