test_class.file: taverna-wsdl-generic/src/test/java/org/apache/taverna/wsdl/xmlsplitter/XMLOutputSplitterTest.java
test_class.identifier: XMLOutputSplitterTest
test_class.superclass: extends WSDLTestHelper
test_case.body: @Test
      public void testWrappedArrayDefinedWithRestriction() throws Exception {
          WSDLParser parser = new WSDLParser(WSDLTestHelper.wsdlResourcePath("jws-online.wsdl"));
  		TypeDescriptor descriptor = parser.getOperationOutputParameters("getSteadyStateTable").get(0);
          XMLOutputSplitter splitter = new XMLOutputSplitter(descriptor, new String [] {"model","fluxNames","fluxVals"}, new String [] {"text/plain","l('text/plain')","l('text/plain')"}, new String[] {"input"});
          String inputXML=getResourceAsString("jws-splitter-input.xml");
  
          Map<String,String> inputMap = new HashMap<String,String>();
          inputMap.put("input", inputXML);
          Map<String,Object> outputMap = splitter.execute(inputMap);
  
          assertNotNull(outputMap.get("model"));
          assertNotNull(outputMap.get("fluxNames"));
          assertNotNull(outputMap.get("fluxVals"));
  
          assertEquals("teusink",outputMap.get("model"));
          List<String> array = ( List<String> )outputMap.get("fluxNames");
          assertEquals(17,array.size());
          assert(array.contains("v[G3PDH]"));
  
          array = ( List<String> )outputMap.get("fluxVals");
          assertEquals(17,array.size());
          assert(array.contains("88.15049285974906"));
      }
test_case.class_method_signature: XMLOutputSplitterTest.testWrappedArrayDefinedWithRestriction()
test_case.full_signature: @Test public void testWrappedArrayDefinedWithRestriction()
test_case.identifier: testWrappedArrayDefinedWithRestriction
test_case.invocations: wsdlResourcePath get getOperationOutputParameters getResourceAsString put execute assertNotNull get assertNotNull get assertNotNull get assertEquals get get assertEquals size contains get assertEquals size contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWrappedArrayDefinedWithRestriction()
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: outputTypes
focal_class.modifier: private
focal_class.original_string: private String[] outputTypes;
focal_class.type: String[]
focal_class.var_name: outputTypes
focal_class.file: taverna-wsdl-generic/src/main/java/org/apache/taverna/wsdl/xmlsplitter/XMLOutputSplitter.java
focal_class.identifier: XMLOutputSplitter
focal_class.class_method_signature: XMLOutputSplitter.XMLOutputSplitter(TypeDescriptor typeDescriptor,
  			String[] outputNames, String[] outputTypes,String[] inputNames)
focal_class.full_signature: public  XMLOutputSplitter(TypeDescriptor typeDescriptor,
  			String[] outputNames, String[] outputTypes,String[] inputNames)
focal_class.identifier: XMLOutputSplitter
focal_class.modifiers: public
focal_class.parameters: (TypeDescriptor typeDescriptor,
  			String[] outputNames, String[] outputTypes,String[] inputNames)
focal_class.signature:  XMLOutputSplitter(TypeDescriptor typeDescriptor,
  			String[] outputNames, String[] outputTypes,String[] inputNames)
focal_class.class_method_signature: XMLOutputSplitter.execute(Map<String, String> inputMap)
focal_class.full_signature: @SuppressWarnings("unchecked") public Map<String, Object> execute(Map<String, String> inputMap)
focal_class.identifier: execute
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Map<String, String> inputMap)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> execute(Map<String, String> inputMap)
focal_class.class_method_signature: XMLOutputSplitter.executeForArrayType(Map<String, Object> result,
  			List<Element> children)
focal_class.full_signature: private void executeForArrayType(Map<String, Object> result,
  			List<Element> children)
focal_class.identifier: executeForArrayType
focal_class.modifiers: private
focal_class.parameters: (Map<String, Object> result,
  			List<Element> children)
focal_class.return: void
focal_class.signature: void executeForArrayType(Map<String, Object> result,
  			List<Element> children)
focal_class.class_method_signature: XMLOutputSplitter.executeForComplexType(Map<String, Object> result,
  			List<String> outputNameList, List<Element> children, List<Attribute> list)
focal_class.full_signature: @SuppressWarnings({ "unchecked" }) private void executeForComplexType(Map<String, Object> result,
  			List<String> outputNameList, List<Element> children, List<Attribute> list)
focal_class.identifier: executeForComplexType
focal_class.modifiers: @SuppressWarnings({ "unchecked" }) private
focal_class.parameters: (Map<String, Object> result,
  			List<String> outputNameList, List<Element> children, List<Attribute> list)
focal_class.return: void
focal_class.signature: void executeForComplexType(Map<String, Object> result,
  			List<String> outputNameList, List<Element> children, List<Attribute> list)
focal_class.class_method_signature: XMLOutputSplitter.extractDataListFromChildList(List<Element> children,
  			boolean isXMLContent)
focal_class.full_signature: private List<String> extractDataListFromChildList(List<Element> children,
  			boolean isXMLContent)
focal_class.identifier: extractDataListFromChildList
focal_class.modifiers: private
focal_class.parameters: (List<Element> children,
  			boolean isXMLContent)
focal_class.return: List<String>
focal_class.signature: List<String> extractDataListFromChildList(List<Element> children,
  			boolean isXMLContent)
focal_class.class_method_signature: XMLOutputSplitter.extractBaseTypeArrayFromChildren(List<Element> children)
focal_class.full_signature: private List<String> extractBaseTypeArrayFromChildren(List<Element> children)
focal_class.identifier: extractBaseTypeArrayFromChildren
focal_class.modifiers: private
focal_class.parameters: (List<Element> children)
focal_class.return: List<String>
focal_class.signature: List<String> extractBaseTypeArrayFromChildren(List<Element> children)
focal_method.body: @SuppressWarnings("unchecked")
  	public Map<String, Object> execute(Map<String, String> inputMap)
  			throws XMLSplitterExecutionException {
  
  		Map<String, Object> result = new HashMap<String, Object>();
  		List<String> outputNameList = Arrays.asList(outputNames);
  
  		String xml = inputMap.get(inputNames[0]);
  		try {
  			Document doc = new SAXBuilder().build(new StringReader(xml));
  			List<Element> children = doc.getRootElement().getChildren();
  			if (typeDescriptor instanceof ArrayTypeDescriptor) {
  				if (outputNames.length > 1)
  					throw new XMLSplitterExecutionException(
  							"Unexpected, multiple output names for ArrayType");
  				executeForArrayType(result, children);
  			} else {
  				executeForComplexType(result, outputNameList, children, doc.getRootElement().getAttributes());
  			}
  
  			// populate missing outputs with empty strings for basic types,
  			// empty elements for complex/array types.
  			for (int i = 0; i < outputNames.length; i++) {
  				if (result.get(outputNames[i]) == null) {
  					if (outputTypes[i].equals("'text/xml'")) {
  						result
  								.put(outputNames[i], "<" + outputNames[i]
  										+ " />");
  					} else if (outputTypes[i].startsWith("l('")) {
  						result.put(outputNames[i], new ArrayList<Object>());
  					} else {
  						result.put(outputNames[i], "");
  					}
  
  				}
  			}
  		} catch (JDOMException e) {
  			throw new XMLSplitterExecutionException("Unable to parse XML: " + xml, e);
  		} catch (IOException e) {
  			throw new XMLSplitterExecutionException("IOException parsing XML: " + xml,
  					e);
  		}
  
  		return result;
  	}
focal_method.class_method_signature: XMLOutputSplitter.execute(Map<String, String> inputMap)
focal_method.full_signature: @SuppressWarnings("unchecked") public Map<String, Object> execute(Map<String, String> inputMap)
focal_method.identifier: execute
focal_method.invocations: asList get build getChildren getRootElement executeForArrayType executeForComplexType getAttributes getRootElement get equals put startsWith put put
focal_method.modifiers: @SuppressWarnings("unchecked") public
focal_method.parameters: (Map<String, String> inputMap)
focal_method.return: Map<String, Object>
focal_method.signature: Map<String, Object> execute(Map<String, String> inputMap)