complexType.setParticle(sequence);
element.setSchemaTypeName(complexType.getQName());
// corba:exception
Exception exception = new Exception();
exception.setQName(new QName(typeMap.getTargetNamespace(), exceptionName));
exception.setType(complexType.getQName());
exception.setRepositoryID(scopedName.toIDLRepositoryID());
// exception members
AST memberTypeNode = identifierNode.getNextSibling();
while (memberTypeNode != null) {
AST memberNode = memberTypeNode.getNextSibling();
TypesVisitor visitor = new TypesVisitor(exceptionScope,
schemas,
schema,
typeMap,
null);
visitor.visit(memberTypeNode);
XmlSchemaType stype = visitor.getSchemaType();
CorbaTypeImpl ctype = visitor.getCorbaType();
// needed for anonymous arrays in exceptions
if (ArrayVisitor.accept(memberNode)) {
Scope anonScope = new Scope(exceptionScope,
TypesUtils.getCorbaTypeNameNode(memberTypeNode));
ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
schemas,
schema,
typeMap,
stype,
ctype,
null);
arrayVisitor.visit(memberNode);
stype = arrayVisitor.getSchemaType();
ctype = arrayVisitor.getCorbaType();
}
// xmlschema:member
XmlSchemaElement member = new XmlSchemaElement();
String memberName = memberNode.toString();
member.setName(memberName);
member.setSchemaType(stype);
member.setSchemaTypeName(stype.getQName());
sequence.getItems().add(member);
// corba:member
MemberType memberType = new MemberType();
memberType.setName(memberName);
memberType.setIdltype(ctype.getQName());
exception.getMember().add(memberType);
memberTypeNode = memberNode.getNextSibling();
}