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);
}
}