protected IOSpecification parseIOSpecification(Element ioSpecificationElement) {
if (ioSpecificationElement == null) {
return null;
}
IOSpecification ioSpecification = new IOSpecification();
for (Element dataInputElement : ioSpecificationElement.elements("dataInput")) {
String id = dataInputElement.attribute("id");
String itemSubjectRef = this.resolveName(dataInputElement.attribute("itemSubjectRef"));
ItemDefinition itemDefinition = this.itemDefinitions.get(itemSubjectRef);
Data dataInput = new Data(this.targetNamespace + ":" + id, id, itemDefinition);
ioSpecification.addInput(dataInput);
}
for (Element dataOutputElement : ioSpecificationElement.elements("dataOutput")) {
String id = dataOutputElement.attribute("id");
String itemSubjectRef = this.resolveName(dataOutputElement.attribute("itemSubjectRef"));
ItemDefinition itemDefinition = this.itemDefinitions.get(itemSubjectRef);
Data dataOutput = new Data(this.targetNamespace + ":" + id, id, itemDefinition);
ioSpecification.addOutput(dataOutput);
}
for (Element inputSetElement : ioSpecificationElement.elements("inputSet")) {
for (Element dataInputRef : inputSetElement.elements("dataInputRefs")) {
DataRef dataRef = new DataRef(dataInputRef.getText());
ioSpecification.addInputRef(dataRef);
}
}
for (Element outputSetElement : ioSpecificationElement.elements("outputSet")) {
for (Element dataInputRef : outputSetElement.elements("dataOutputRefs")) {
DataRef dataRef = new DataRef(dataInputRef.getText());
ioSpecification.addOutputRef(dataRef);
}
}
return ioSpecification;
}