@Test public void testArray3() throws Exception { StringWriter result = new StringWriter(); JsonXMLStreamWriter writer = createXmlStreamWriter(result); writer.writeStartDocument(); writer.writeStartElement("alice"); writer.writeStartArray("bob"); writer.writeStartElement("bob"); writer.writeCharacters("charlie"); writer.writeEndElement(); writer.writeEndArray(); writer.writeEndElement(); writer.writeEndDocument(); writer.close(); Assert.assertEquals("{\"alice\":{\"bob\":[\"charlie\"]}}", result.toString()); }
@Override public void close() throws IOException { while (!events.isEmpty()) { events.pollFirst().write(delegate); } delegate.close(); }
AutoArrayTarget implements JsonStreamTarget { @Override public void close() throws IOException { while (!events.isEmpty()) { events.pollFirst().write(delegate); } delegate.close(); } }
AutoArrayTarget implements JsonStreamTarget { @Override public void close() throws IOException { while (!events.isEmpty()) { events.pollFirst().write(delegate); } delegate.close(); } AutoArrayTarget(JsonStreamTarget delegate); }
AutoArrayTarget implements JsonStreamTarget { @Override public void close() throws IOException { while (!events.isEmpty()) { events.pollFirst().write(delegate); } delegate.close(); } AutoArrayTarget(JsonStreamTarget delegate); @Override void name(String name); @Override void value(Object value); @Override void startObject(); @Override void endObject(); @Override void startArray(); @Override void endArray(); @Override void close(); @Override void flush(); }
AutoArrayTarget implements JsonStreamTarget { @Override public void close() throws IOException { while (!events.isEmpty()) { events.pollFirst().write(delegate); } delegate.close(); } AutoArrayTarget(JsonStreamTarget delegate); @Override void name(String name); @Override void value(Object value); @Override void startObject(); @Override void endObject(); @Override void startArray(); @Override void endArray(); @Override void close(); @Override void flush();  }