class XMLOutputSplitterActivity extends
		AbstractAsynchronousActivity<JsonNode> implements
		OutputPortTypeDescriptorActivity {

	public TypeDescriptor getTypeDescriptorForOutputPort(String portName) {
		TypeDescriptor result = null;
		if (typeDescriptor instanceof ComplexTypeDescriptor) {
			for (TypeDescriptor desc : ((ComplexTypeDescriptor) typeDescriptor)
					.getElements()) {
				if (desc.getName().equals(portName)) {
					result = desc;
					break;
				}
			}
		}
		else if (typeDescriptor instanceof ArrayTypeDescriptor) {
			TypeDescriptor desc = ((ArrayTypeDescriptor)typeDescriptor).getElementType();

			if (typeDescriptor.getName().equals(portName)) {
				result = desc;
			}
		}
		return result;
	}

}