*/
protected void processDescriptor(XMLDescriptor desc, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<XMLDescriptor> descriptors) {
// determine if a simple type (or complex type with simple content) or complex type is required
boolean simple = isSimple(desc);
XMLSchemaReference schemaRef = desc.getSchemaReference();
if (schemaRef != null) {
if (schemaRef.getType() == org.eclipse.persistence.platform.xml.XMLSchemaReference.COMPLEX_TYPE) {
workingSchema.addTopLevelComplexTypes(buildComplexType(false, desc, schemaForNamespace, workingSchema, properties, descriptors));
} else if (schemaRef.getType() == org.eclipse.persistence.platform.xml.XMLSchemaReference.SIMPLE_TYPE) {
workingSchema.addTopLevelSimpleTypes(buildSimpleType(desc, workingSchema, true));
} else if (schemaRef.getType() == org.eclipse.persistence.platform.xml.XMLSchemaReference.ELEMENT) {
workingSchema.addTopLevelElement(buildElement(desc, schemaForNamespace, workingSchema, properties, descriptors, simple));
}
for (DatabaseTable table : desc.getTables()) {
String localName = getDefaultRootElementAsQName(desc, table.getName()).getLocalPart();
// don't overwrite existing top level elements
if (workingSchema.getTopLevelElements().get(localName) != null) {
continue;
}
Element topLevelElement = new Element();
topLevelElement.setName(localName);
QName qname = schemaRef.getSchemaContextAsQName(workingSchema.getNamespaceResolver());
String elementType = qname.getLocalPart();
String elementTypeUri = qname.getNamespaceURI();
String elementTypePrefix = workingSchema.getNamespaceResolver().resolveNamespaceURI(elementTypeUri);
if (elementTypePrefix != null) {
elementType = elementTypePrefix + XMLConstants.COLON + elementType;