public ExtensibilityElement unmarshall(Class parentType, QName elementType,
Element el, Definition def,
ExtensionRegistry extReg)
throws WSDLException {
TypeMappingType mappingType = new TypeMappingType();
// Store the target namespace for the types
NamedNodeMap mappingAttributes = el.getAttributes();
for (int i = 0; i < mappingAttributes.getLength(); ++i) {
if (mappingAttributes.item(i).getNodeName().equals("targetNamespace")) {
mappingType.setTargetNamespace(mappingAttributes.item(i).getNodeValue());
}
}
// Get the types that are stored in this typemapping
NodeList typeChildNodes = el.getChildNodes();
for (int i = 0; i < typeChildNodes.getLength(); ++i) {
Node currentNode = typeChildNodes.item(i);
if (currentNode.getNodeName().equals("corba:const")) {
Const constType = getConstDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(constType);
} else if (currentNode.getNodeName().equals("corba:enum")) {
Enum enumType = getEnumDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(enumType);
} else if (currentNode.getNodeName().equals("corba:struct")) {
Struct structType = getStructDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(structType);
} else if (currentNode.getNodeName().equals("corba:exception")) {
Exception exceptType = getExceptionDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(exceptType);
} else if (currentNode.getNodeName().equals("corba:fixed")) {
Fixed fixedType = getFixedDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(fixedType);
} else if (currentNode.getNodeName().equals("corba:union")) {
Union unionType = getUnionDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(unionType);
} else if (currentNode.getNodeName().equals("corba:alias")) {
Alias aliasType = getAliasDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(aliasType);
} else if (currentNode.getNodeName().equals("corba:array")) {
Array arrayType = getArrayDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(arrayType);
} else if (currentNode.getNodeName().equals("corba:sequence")) {
Sequence sequenceType = getSequenceDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(sequenceType);
} else if (currentNode.getNodeName().equals("corba:anonstring")) {
Anonstring anonstringType = getAnonStringDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(anonstringType);
} else if (currentNode.getNodeName().equals("corba:anonwstring")) {
Anonstring anonstringType = getAnonWStringDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(anonstringType);
} else if (currentNode.getNodeName().equals("corba:anonfixed")) {
Anonfixed anonfixedType = getAnonFixedDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(anonfixedType);
} else if (currentNode.getNodeName().equals("corba:anonsequence")) {
Anonsequence anonsequenceType = getAnonSequenceDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(anonsequenceType);
} else if (currentNode.getNodeName().equals("corba:anonarray")) {
Anonarray anonarrayType = getAnonArrayDefinition(currentNode, def);
mappingType.getStructOrExceptionOrUnion().add(anonarrayType);
} else {
// TODO: How do we want to handle this?
}
}
return mappingType;