protected List<MemberType> processAttributesAsMembers(Iterator attrs) throws Exception {
QName memName = null;
List <MemberType>members = new ArrayList<MemberType>();
while (attrs.hasNext()) {
XmlSchemaAttribute attribute = (XmlSchemaAttribute)attrs.next();
CorbaTypeImpl membertype = null;
if (attribute.getUse().getValue().equals("none")
|| attribute.getUse().getValue().equals(W3CConstants.USE_OPTIONAL)) {
CorbaTypeImpl attType = null;
if (attribute.getSchemaType() != null) {
attType = convertSchemaToCorbaType(attribute.getSchemaType(),
attribute.getQName(),
attribute.getSchemaType(), null, true);
if (attType != null) {
QName typeName = attType.getQName();
attType.setQName(null);
if (!isDuplicate(attType)) {
typeMappingType.getStructOrExceptionOrUnion().add(attType);
}
QName name = createQNameTargetNamespace(typeName.getLocalPart() + "_nil");
membertype = createNillableUnion(name, attribute.getQName(),
createQNameCorbaNamespace(typeName.getLocalPart()));
}
} else {
attType = processPrimitiveType(attribute.getSchemaTypeName());
//REVISIT, bravi, attType is null for the wsaddr type
//{http://www.w3.org/2005/08/addressing}RelationshipTypeOpenEnum
if (attType != null) {
QName name = createQNameTargetNamespace(attType.getQName().getLocalPart() + "_nil");
membertype = createNillableUnion(name, attribute.getQName(),
attType.getQName());
}
}
if (membertype != null) {
memName = createQNameCorbaNamespace(membertype.getQName().getLocalPart());
membertype.setQName(null);
if (!isDuplicate(membertype)) {
typeMappingType.getStructOrExceptionOrUnion().add(membertype);
}
}
} else {
if (attribute.getSchemaType() != null) {
membertype = convertSchemaToCorbaType(attribute.getSchemaType(), attribute.getQName(),
attribute.getSchemaType(), null, false);
} else {
membertype = processPrimitiveType(attribute.getSchemaTypeName());
}
}
if (membertype != null) {
MemberType member;
String memberName = attribute.getQName().getLocalPart();
member = new MemberType();
member.setName(memberName);
if (memName != null) {
member.setIdltype(memName);
} else {
member.setIdltype(membertype.getQName());
}
members.add(member);
} else {
String msg = "Unsupported Attribute Found in CORBA Binding Generation:"
+ attribute.getQName();
LOG.log(Level.WARNING, msg.toString());
}
}
return members;