@Test public void testAttributes() throws Exception { String input = "{\"alice\":{\"@charlie\":\"david\",\"$\":\"bob\"}}"; XMLStreamReader reader = new JsonXMLInputFactory().createXMLStreamReader(new StringReader(input)); verify(reader, XMLStreamConstants.START_DOCUMENT, null, null); reader.next(); verify(reader, XMLStreamConstants.START_ELEMENT, "alice", null); Assert.assertEquals(1, reader.getAttributeCount()); Assert.assertEquals("david", reader.getAttributeValue(null, "charlie")); Assert.assertEquals("david", reader.getAttributeValue(XMLConstants.NULL_NS_URI, "charlie")); reader.next(); verify(reader, XMLStreamConstants.CHARACTERS, null, "bob"); reader.next(); verify(reader, XMLStreamConstants.END_ELEMENT, "alice", null); reader.next(); verify(reader, XMLStreamConstants.END_DOCUMENT, null, null); reader.close(); }
@Override public void close() throws XMLStreamException { super.close(); try { source.close(); } catch (IOException e) { throw new XMLStreamException(e); } }
JsonXMLStreamReader extends AbstractXMLStreamReader<JsonXMLStreamReader.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { source.close(); } catch (IOException e) { throw new XMLStreamException(e); } } }
JsonXMLStreamReader extends AbstractXMLStreamReader<JsonXMLStreamReader.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { source.close(); } catch (IOException e) { throw new XMLStreamException(e); } } JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings, String textProperty, String attributePrefix); }
JsonXMLStreamReader extends AbstractXMLStreamReader<JsonXMLStreamReader.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { source.close(); } catch (IOException e) { throw new XMLStreamException(e); } } JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings, String textProperty, String attributePrefix); boolean hasNumber(); Number getNumber(); boolean hasBoolean(); Boolean getBoolean(); @Override void close(); }
JsonXMLStreamReader extends AbstractXMLStreamReader<JsonXMLStreamReader.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { source.close(); } catch (IOException e) { throw new XMLStreamException(e); } } JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings);  JsonXMLStreamReader(JsonStreamSource source, boolean multiplePI, char namespaceSeparator, Map<String, String> namespaceMappings, String textProperty, String attributePrefix); boolean hasNumber(); Number getNumber(); boolean hasBoolean(); Boolean getBoolean(); @Override void close();  }