@Test public void testSomethingComplex() { final String complexXML = "<school xmlns:sli=\"urn:sli\">\n" + " <id>8cc0a1ac-ccb5-dffc-1d74-32964722179b</id>\n" + " <schoolCategories sli:member=\"true\">Middle School</schoolCategories>\n" + " <gradesOffered sli:member=\"true\">Sixth grade</gradesOffered>\n" + " <gradesOffered sli:member=\"true\">Eighth grade</gradesOffered>\n" + " <gradesOffered sli:member=\"true\">Seventh grade</gradesOffered>\n" + " <organizationCategories sli:member=\"true\">School</organizationCategories>\n" + " <address sli:member=\"true\">\n" + " <addressType>Physical</addressType>\n" + " <streetNumberName>456 Blah Street</streetNumberName>\n" + " <city>Las Vegas</city>\n" + " <stateAbbreviation>NV</stateAbbreviation>\n" + " <postalCode>66666</postalCode>\n" + " <nameOfCounty>Vegas County</nameOfCounty>\n" + " </address>\n" + " <address sli:member=\"true\">\n" + " <addressType>Physical</addressType>\n" + " <streetNumberName>123 Blah Street</streetNumberName>\n" + " <city>Durham</city>\n" + " <stateAbbreviation>NC</stateAbbreviation>\n" + " <postalCode>66666</postalCode>\n" + " <nameOfCounty>Durham</nameOfCounty>\n" + " </address>\n" + " <parentEducationAgencyReference>bd086bae-ee82-4cf2-baf9-221a9407ea07</parentEducationAgencyReference>\n" + " <stateOrganizationId>152901004</stateOrganizationId>\n" + " <entityType>school</entityType>\n" + " <telephone sli:member=\"true\">\n" + " <institutionTelephoneNumberType>Main</institutionTelephoneNumberType>\n" + " <telephoneNumber>(333) 344-7777</telephoneNumber>\n" + " </telephone>\n" + " <nameOfInstitution>Purple Middle School</nameOfInstitution>\n" + "</school>\n"; EntityBody body = null; try { body = deserialize(complexXML); } catch (XMLStreamException e) { fail(e.getMessage()); } assertNotNull(body); Object address = body.get("address"); assertTrue(address instanceof List); assertEquals(2, ((List) address).size()); Object telephone = body.get("telephone"); assertTrue(telephone instanceof List); assertEquals(1, ((List) telephone).size()); @SuppressWarnings("unchecked") Map<String, Object> telephoneHash = (Map<String, Object>) ((List) telephone).get(0); assertEquals("(333) 344-7777", telephoneHash.get("telephoneNumber").toString()); Object id = body.get("id"); assertTrue(id instanceof String); assertEquals("8cc0a1ac-ccb5-dffc-1d74-32964722179b", id.toString()); }
public EntityBody deserialize(final InputStream body) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader reader = factory.createXMLStreamReader(body); try { return readDocument(reader); } finally { reader.close(); } }
StAXMsgBodyReader { public EntityBody deserialize(final InputStream body) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader reader = factory.createXMLStreamReader(body); try { return readDocument(reader); } finally { reader.close(); } } }
StAXMsgBodyReader { public EntityBody deserialize(final InputStream body) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader reader = factory.createXMLStreamReader(body); try { return readDocument(reader); } finally { reader.close(); } }  }
StAXMsgBodyReader { public EntityBody deserialize(final InputStream body) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader reader = factory.createXMLStreamReader(body); try { return readDocument(reader); } finally { reader.close(); } }  EntityBody deserialize(final InputStream body); }
StAXMsgBodyReader { public EntityBody deserialize(final InputStream body) throws XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader reader = factory.createXMLStreamReader(body); try { return readDocument(reader); } finally { reader.close(); } }  EntityBody deserialize(final InputStream body);  }