test_class.file: taverna-wsdl-generic/src/test/java/org/apache/taverna/wsdl/xmlsplitter/XMLInputSplitterTest.java
test_class.identifier: XMLInputSplitterTest
test_class.superclass: extends WSDLTestHelper
test_case.body: @Test
  	public void testOptional() throws Exception {
  		WSDLParser parser = new WSDLParser(wsdlResourcePath("VSOi.wsdl"));
  		TypeDescriptor descriptor = parser.getOperationInputParameters("Query").get(0);
  		XMLInputSplitter splitter = new XMLInputSplitter(descriptor,new String[]{"version","block"},new String[]{"text/plain","text/plain"},new String[]{"output"});
  		Map<String,Object> inputMap = new HashMap<String, Object>();
  		// connect none of the inputs
  		Map<String,String> outputMap = splitter.execute(inputMap);
  		assertNotNull("there should be an output named 'output'",outputMap.containsKey("output"));
  		String xml = outputMap.get("output");
  		// empty string as <block> as it is not nillable
  		assertTrue(xml.contains("<block xmlns=\"\"></block>"));
  		// minOccurs=0 - so it should not be there
  		assertTrue(! xml.contains("<version>"));
  	}
test_case.class_method_signature: XMLInputSplitterTest.testOptional()
test_case.full_signature: @Test public void testOptional()
test_case.identifier: testOptional
test_case.invocations: wsdlResourcePath get getOperationInputParameters execute assertNotNull containsKey get assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOptional()
focal_class.declarator: typeDescriptor
focal_class.modifier: private
focal_class.original_string: private TypeDescriptor typeDescriptor;
focal_class.type: TypeDescriptor
focal_class.var_name: typeDescriptor
focal_class.declarator: outputNames
focal_class.modifier: private
focal_class.original_string: private String[] outputNames;
focal_class.type: String[]
focal_class.var_name: outputNames
focal_class.declarator: inputNames
focal_class.modifier: private
focal_class.original_string: private String[] inputNames;
focal_class.type: String[]
focal_class.var_name: inputNames
focal_class.declarator: inputTypes
focal_class.modifier: private
focal_class.original_string: private String[] inputTypes;
focal_class.type: String[]
focal_class.var_name: inputTypes
focal_class.file: taverna-wsdl-generic/src/main/java/org/apache/taverna/wsdl/xmlsplitter/XMLInputSplitter.java
focal_class.identifier: XMLInputSplitter
focal_class.class_method_signature: XMLInputSplitter.XMLInputSplitter(TypeDescriptor typeDescriptor, String inputNames[],
  			String inputTypes[], String[] outputNames)
focal_class.full_signature: public  XMLInputSplitter(TypeDescriptor typeDescriptor, String inputNames[],
  			String inputTypes[], String[] outputNames)
focal_class.identifier: XMLInputSplitter
focal_class.modifiers: public
focal_class.parameters: (TypeDescriptor typeDescriptor, String inputNames[],
  			String inputTypes[], String[] outputNames)
focal_class.signature:  XMLInputSplitter(TypeDescriptor typeDescriptor, String inputNames[],
  			String inputTypes[], String[] outputNames)
focal_class.class_method_signature: XMLInputSplitter.execute(Map<String, Object> inputMap)
focal_class.full_signature: public Map<String, String> execute(Map<String, Object> inputMap)
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: (Map<String, Object> inputMap)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> execute(Map<String, Object> inputMap)
focal_class.class_method_signature: XMLInputSplitter.executeForComplexType(Map<String, Object> inputMap,
  			Map<String, String> result, Element outputElement)
focal_class.full_signature: private void executeForComplexType(Map<String, Object> inputMap,
  			Map<String, String> result, Element outputElement)
focal_class.identifier: executeForComplexType
focal_class.modifiers: private
focal_class.parameters: (Map<String, Object> inputMap,
  			Map<String, String> result, Element outputElement)
focal_class.return: void
focal_class.signature: void executeForComplexType(Map<String, Object> inputMap,
  			Map<String, String> result, Element outputElement)
focal_class.class_method_signature: XMLInputSplitter.buildElementFromObject(String key, Object dataObject)
focal_class.full_signature: private Element buildElementFromObject(String key, Object dataObject)
focal_class.identifier: buildElementFromObject
focal_class.modifiers: private
focal_class.parameters: (String key, Object dataObject)
focal_class.return: Element
focal_class.signature: Element buildElementFromObject(String key, Object dataObject)
focal_class.class_method_signature: XMLInputSplitter.createDataElementForXMLInput(Object dataObject, String key)
focal_class.full_signature: private Element createDataElementForXMLInput(Object dataObject, String key)
focal_class.identifier: createDataElementForXMLInput
focal_class.modifiers: private
focal_class.parameters: (Object dataObject, String key)
focal_class.return: Element
focal_class.signature: Element createDataElementForXMLInput(Object dataObject, String key)
focal_class.class_method_signature: XMLInputSplitter.setDataElementNamespace(String key, Element dataElement)
focal_class.full_signature: private void setDataElementNamespace(String key, Element dataElement)
focal_class.identifier: setDataElementNamespace
focal_class.modifiers: private
focal_class.parameters: (String key, Element dataElement)
focal_class.return: void
focal_class.signature: void setDataElementNamespace(String key, Element dataElement)
focal_class.class_method_signature: XMLInputSplitter.updateElementNamespace(Element dataElement, String namespaceURI)
focal_class.full_signature: private void updateElementNamespace(Element dataElement, String namespaceURI)
focal_class.identifier: updateElementNamespace
focal_class.modifiers: private
focal_class.parameters: (Element dataElement, String namespaceURI)
focal_class.return: void
focal_class.signature: void updateElementNamespace(Element dataElement, String namespaceURI)
focal_class.class_method_signature: XMLInputSplitter.isXMLInput(String key)
focal_class.full_signature: private boolean isXMLInput(String key)
focal_class.identifier: isXMLInput
focal_class.modifiers: private
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isXMLInput(String key)
focal_method.body: public Map<String, String> execute(Map<String, Object> inputMap)
  			throws JDOMException, IOException {
  		Map<String, String> result = new HashMap<String, String>();
  		Element outputElement = (this.typeDescriptor.getName().length() > 0 ? new Element(
  				this.typeDescriptor.getName())
  				: new Element(this.typeDescriptor.getType()));
  
  		if (typeDescriptor instanceof ComplexTypeDescriptor) {
  			executeForComplexType(inputMap, result, outputElement);
  
  		} else {
  			for (String key : inputMap.keySet()) {
  				Object dataObject = inputMap.get(key);
  
  				if (dataObject instanceof List) {
  					Element dataElement = buildElementFromObject(key, "");
  					for (Object dataItem : ((List<?>) dataObject)) {
  						Element itemElement = buildElementFromObject(key,
  								dataItem);
  						dataElement.addContent(itemElement);
  					}
  
  					XMLOutputter outputter = new XMLOutputter();
  					String xmlText = outputter.outputString(dataElement);
  
  					result.put(outputNames[0], xmlText);
  				} else {
  					Element dataElement = buildElementFromObject(key,
  							dataObject);
  					outputElement.addContent(dataElement);
  					XMLOutputter outputter = new XMLOutputter();
  					String xmlText = outputter.outputString(outputElement);
  					result.put(outputNames[0], xmlText);
  				}
  
  			}
  		}
  
  		return result;
  
  	}
focal_method.class_method_signature: XMLInputSplitter.execute(Map<String, Object> inputMap)
focal_method.full_signature: public Map<String, String> execute(Map<String, Object> inputMap)
focal_method.identifier: execute
focal_method.invocations: length getName getName getType executeForComplexType keySet get buildElementFromObject buildElementFromObject addContent outputString put buildElementFromObject addContent outputString put
focal_method.modifiers: public
focal_method.parameters: (Map<String, Object> inputMap)
focal_method.return: Map<String, String>
focal_method.signature: Map<String, String> execute(Map<String, Object> inputMap)