in taverna-wsdl-generic/src/main/java/org/apache/taverna/wsdl/parser/TypeDescriptors.java [459:517]
private void addAttributeTypeDescriptors(List<TypeDescriptor> attributes, XmlSchemaAttributeGroupMember attribute) {
AttributeTypeDescriptor typeDesc = new AttributeTypeDescriptor();
if (attribute instanceof XmlSchemaAttribute) {
XmlSchemaAttribute xmlSchemaAttribute = (XmlSchemaAttribute)attribute;
QName attrName;
if (xmlSchemaAttribute.isRef()) {
XmlSchemaRef<XmlSchemaAttribute> xmlSchemaRef = xmlSchemaAttribute.getRef();
attrName = xmlSchemaRef.getTargetQName();
if (attrName == null) {
XmlSchemaAttribute xmlSchemaRefAttribute = xmlSchemaRef.getTarget();
attrName = xmlSchemaRefAttribute.getWireName();
}
} else {
attrName = xmlSchemaAttribute.getWireName();
}
typeDesc.setName(attrName.getLocalPart());
typeDesc.setQname(attrName);
TypeDescriptor attrTypeDesc;
QName attrTypeName = xmlSchemaAttribute.getSchemaTypeName();
if (attrTypeName != null) {
attrTypeDesc = getTypeDescriptor(attrTypeName);
} else {
XmlSchemaSimpleType xmlSchemaSimpleType = xmlSchemaAttribute.getSchemaType();
if (xmlSchemaSimpleType == null) {
attrTypeDesc = new BaseTypeDescriptor();
attrTypeDesc.setType("anySimpleType");
} else {
attrTypeDesc = getTypeDescriptor(xmlSchemaSimpleType);
}
}
typeDesc.setType(attrTypeDesc.getType());
typeDesc.setOptional(XmlSchemaUse.OPTIONAL == xmlSchemaAttribute.getUse());
attributes.add(typeDesc);
}
else {
XmlSchemaAttributeGroup xmlSchemaAttributeGroup;
if (attribute instanceof XmlSchemaAttributeGroup) {
xmlSchemaAttributeGroup = (XmlSchemaAttributeGroup)attribute;
}
else {
XmlSchemaAttributeGroupRef xmlSchemaAttributeGroupRef = (XmlSchemaAttributeGroupRef)attribute;
XmlSchemaRef<XmlSchemaAttributeGroup> xmlSchemaRef = xmlSchemaAttributeGroupRef.getRef();
xmlSchemaAttributeGroup = xmlSchemaRef.getTarget();
}
List<XmlSchemaAttributeGroupMember> xmlSchemaAttributeGroupMembers = xmlSchemaAttributeGroup.getAttributes();
for (XmlSchemaAttributeGroupMember xmlSchemaAttributeGroupMember : xmlSchemaAttributeGroupMembers) {
addAttributeTypeDescriptors(attributes, xmlSchemaAttributeGroupMember);
}
}
}