private void addTypes(Node node) {
if (node == null) {
return;
}
// Get the kind of node (complexType, wsdl:part, etc.)
QName nodeKind = Utils.getNodeQName(node);
if (nodeKind != null) {
if (nodeKind.getLocalPart().equals("complexType") &&
Utils.isSchemaNS(nodeKind.getNamespaceURI())) {
// This is a definition of a complex type.
// Create a Type.
createTypeFromDef(node, false);
}
if (nodeKind.getLocalPart().equals("simpleType") &&
Utils.isSchemaNS(nodeKind.getNamespaceURI())) {
// This is a definition of a simple type, which could be an enum
// Create a Type.
createTypeFromDef(node, false);
}
else if (nodeKind.getLocalPart().equals("element") &&
Utils.isSchemaNS(nodeKind.getNamespaceURI())) {
// If the element has a type/ref attribute, create
// a Type representing the referenced type.
if (Utils.getAttribute(node, "type") != null ||
Utils.getAttribute(node, "ref") != null) {
createTypeFromRef(node);
}
// Create a type representing an element. (This may
// seem like overkill, but is necessary to support ref=
// and element=.
createTypeFromDef(node, true);
}
else if (nodeKind.getLocalPart().equals("part") &&
Utils.isWsdlNS(nodeKind.getNamespaceURI())) {
// This is a wsdl part. Create an Type representing the reference
createTypeFromRef(node);
}
}