((SDOXSDHelper)aHelperContext.getXSDHelper()).addGlobalProperty(propertyQName, property, isElement);
((SDOProperty)property).setUri(propertyUri);
XMLDescriptor aDescriptor;
if (property.getType().isDataType()) {
// RICK: Types from DataObjects: isDataType() == true so:
// - find the SDOWrapperType from TypeHelper's WrappersHashMap
// - add the descriptor to XMLContext's DescriptorsByQName map
// See also: SDOTypesGenerator:addRootElementToDescriptor
SDOTypeHelper typeHelper = (SDOTypeHelper) aHelperContext.getTypeHelper();
SDOWrapperType wrapperType = (SDOWrapperType) typeHelper.getWrappersHashMap().get(((SDOProperty)property).getType().getQName());
if (wrapperType != null) {
QName descriptorQname = new QName(propertyUri, propertyName);
((SDOXMLHelper) aHelperContext.getXMLHelper()).getXmlContext().addDescriptorByQName(descriptorQname, wrapperType.getXmlDescriptor(((SDOProperty)property).getXsdType()));
}
return;
} else {
aDescriptor = ((SDOType)property.getType()).getXmlDescriptor();
}
// synchronized threads that access the NonSynchronizedVector tables in XMLDescriptor
if (aDescriptor != null) {
synchronized (aDescriptor) {
String rootName = propertyName;
String prefix = aDescriptor.getNonNullNamespaceResolver().resolveNamespaceURI(propertyUri);
if ((prefix == null) || prefix.equals(SDOConstants.EMPTY_STRING)) {
prefix = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(propertyUri);
aDescriptor.getNonNullNamespaceResolver().put(prefix, propertyUri);
}
if ((prefix != null) && !prefix.equals(SDOConstants.EMPTY_STRING)) {
rootName = prefix + ":" + rootName;
}
aDescriptor.setDefaultRootElement(rootName);
QName elementType = new QName(propertyUri, rootName);
aDescriptor.setDefaultRootElementType(elementType);
((SDOXMLHelper)aHelperContext.getXMLHelper()).getXmlContext().storeXMLDescriptorByQName(aDescriptor);
}
}
}