private CorbaTypeImpl processStruct(XmlSchemaComplexType complex, QName defaultName)
throws Exception {
QName name;
Struct corbaStruct = null;
QName schematypeName = checkPrefix(complex.getQName());
if (schematypeName == null) {
schematypeName = checkPrefix(defaultName);
name = checkPrefix(createQNameCorbaNamespace(defaultName.getLocalPart()));
} else {
name = checkPrefix(createQNameCorbaNamespace(schematypeName.getLocalPart()));
}
corbaStruct = new Struct();
corbaStruct.setName(name.getLocalPart());
corbaStruct.setQName(name);
String repoId = REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION;
corbaStruct.setRepositoryID(repoId);
corbaStruct.setType(schematypeName);
if (complex.getContentModel() instanceof XmlSchemaSimpleContent) {
corbaStruct = processSimpleContentStruct((XmlSchemaSimpleContent)complex.getContentModel(),
defaultName, corbaStruct, schematypeName);
} else if (complex.getContentModel() instanceof XmlSchemaComplexContent) {
corbaStruct = processComplexContentStruct((XmlSchemaComplexContent)complex.getContentModel(),
defaultName, corbaStruct, schematypeName);
}
// Process attributes at ComplexType level
if (complex.getAttributes().getIterator() != null) {
Iterator iterator = complex.getAttributes().getIterator();
List attlist2 = processAttributesAsMembers(iterator);
MemberType member = new MemberType();
for (int i = 0; i < attlist2.size(); i++) {
member = (MemberType)attlist2.get(i);
corbaStruct.getMember().add(member);
}
}
if (complex.getParticle() != null) {
List members = processContainerAsMembers(complex.getParticle(), defaultName, schematypeName);
for (Iterator it = members.iterator(); it.hasNext();) {
MemberType memberType = (MemberType)it.next();
corbaStruct.getMember().add(memberType);
}
}
return corbaStruct;
}