throw SDOException.typeReferencedButNotDefined(nextSDOType.getURI(), nextSDOType.getName());
}
Iterator<Property> propertiesIter = nextSDOType.getProperties().iterator();
while (propertiesIter.hasNext()) {
SDOProperty prop = (SDOProperty) propertiesIter.next();
if (prop.getType().isDataType() && prop.isContainment()) {
// If isDataType is true, then isContainment has to be false.
// This property was likely created as a stub, and isContainment never got reset
// when the property was fully defined.
// This problem was uncovered in bug 6809767
prop.setContainment(false);
}
}
}
Iterator<Property> propertiesIter = getGeneratedGlobalElements().values().iterator();
while (propertiesIter.hasNext()) {
SDOProperty nextSDOProperty = (SDOProperty) propertiesIter.next();
if (!nextSDOProperty.isFinalized()) {
//Only throw this error if we're not processing an import.
throw SDOException.referencedPropertyNotFound(nextSDOProperty.getUri(), nextSDOProperty.getName());
}
}
propertiesIter = getGeneratedGlobalAttributes().values().iterator();
while (propertiesIter.hasNext()) {
SDOProperty nextSDOProperty = (SDOProperty) propertiesIter.next();
if (!nextSDOProperty.isFinalized()) {
//Only throw this error if we're not processing an import.
throw SDOException.referencedPropertyNotFound(nextSDOProperty.getUri(), nextSDOProperty.getName());
}
}
iter = getGeneratedTypes().values().iterator();
//If we get here all types were finalized correctly
while (iter.hasNext()) {
SDOType nextSDOType = (SDOType) iter.next();
((SDOTypeHelper) aHelperContext.getTypeHelper()).addType(nextSDOType);
}
Iterator anonymousIterator = getAnonymousTypes().iterator();
while (anonymousIterator.hasNext()) {
SDOType nextSDOType = (SDOType) anonymousIterator.next();
((SDOTypeHelper) aHelperContext.getTypeHelper()).getAnonymousTypes().add(nextSDOType);
}
// add any base types to the list
for (int i=0; i<descriptorsToAdd.size(); i++) {
SDOType nextSDOType = (SDOType) descriptorsToAdd.get(i);
if (!nextSDOType.isDataType() && nextSDOType.getBaseTypes().size() == 0 && nextSDOType.getSubTypes().size() > 0) {
nextSDOType.setupInheritance(null);
} else if (!nextSDOType.isDataType() && nextSDOType.getBaseTypes().size() > 0 && !getGeneratedTypes().values().contains(nextSDOType.getBaseTypes().get(0))) {
SDOType baseType = (SDOType) nextSDOType.getBaseTypes().get(0);
while (baseType != null) {
descriptorsToAdd.add(baseType);
if (baseType.getBaseTypes().size() == 0) {
// baseType should now be root of inheritance
baseType.setupInheritance(null);
baseType = null;
} else {
baseType = (SDOType) baseType.getBaseTypes().get(0);
}
}
}
}
((SDOXMLHelper) aHelperContext.getXMLHelper()).addDescriptors(descriptorsToAdd);
//go through generatedGlobalProperties and add to xsdhelper
Iterator<QName> qNameIter = getGeneratedGlobalElements().keySet().iterator();
while (qNameIter.hasNext()) {
QName nextQName = (QName) qNameIter.next();
SDOProperty nextSDOProperty = (SDOProperty) getGeneratedGlobalElements().get(nextQName);
((SDOXSDHelper) aHelperContext.getXSDHelper()).addGlobalProperty(nextQName, nextSDOProperty, true);
}
qNameIter = getGeneratedGlobalAttributes().keySet().iterator();
while (qNameIter.hasNext()) {
QName nextQName = (QName) qNameIter.next();
SDOProperty nextSDOProperty = (SDOProperty) getGeneratedGlobalAttributes().get(nextQName);
((SDOXSDHelper) aHelperContext.getXSDHelper()).addGlobalProperty(nextQName, nextSDOProperty, false);
}
Iterator<java.util.List<GlobalRef>> globalRefsIter = getGlobalRefs().values().iterator();
while (globalRefsIter.hasNext()) {