@Test public void testSimpleValueArray() throws Exception { StringWriter result = new StringWriter(); XMLStreamWriter writer = new JsonXMLOutputFactory().createXMLStreamWriter(result); writer.writeProcessingInstruction(JsonXMLStreamConstants.MULTIPLE_PI_TARGET); writer.writeCharacters("edgar"); writer.writeCharacters("david"); writer.close(); Assert.assertEquals("[\"edgar\",\"david\"]", result.toString()); }
@Override public void close() throws XMLStreamException { super.close(); try { if (documentArray) { target.endArray(); } target.close(); } catch (IOException e) { throw new XMLStreamException("Close failed", e); } }
JsonXMLStreamWriter extends AbstractXMLStreamWriter<JsonXMLStreamWriter.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { if (documentArray) { target.endArray(); } target.close(); } catch (IOException e) { throw new XMLStreamException("Close failed", e); } } }
JsonXMLStreamWriter extends AbstractXMLStreamWriter<JsonXMLStreamWriter.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { if (documentArray) { target.endArray(); } target.close(); } catch (IOException e) { throw new XMLStreamException("Close failed", e); } } JsonXMLStreamWriter(JsonStreamTarget target, boolean repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations, String textProperty, String attributePrefix); }
JsonXMLStreamWriter extends AbstractXMLStreamWriter<JsonXMLStreamWriter.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { if (documentArray) { target.endArray(); } target.close(); } catch (IOException e) { throw new XMLStreamException("Close failed", e); } } JsonXMLStreamWriter(JsonStreamTarget target, boolean repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations, String textProperty, String attributePrefix); @Override void writeStartDocument(String encoding, String version); @Override void writeEndDocument(); void writeStartArray(String fieldName); void writeEndArray(); @Override void close(); @Override void flush(); void writeNumber(Number value); void writeBoolean(Boolean value); }
JsonXMLStreamWriter extends AbstractXMLStreamWriter<JsonXMLStreamWriter.ScopeInfo> { @Override public void close() throws XMLStreamException { super.close(); try { if (documentArray) { target.endArray(); } target.close(); } catch (IOException e) { throw new XMLStreamException("Close failed", e); } } JsonXMLStreamWriter(JsonStreamTarget target, boolean repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations);  JsonXMLStreamWriter(JsonStreamTarget target, Map<String, String> repairNamespaces, boolean multiplePI, char namespaceSeparator, boolean namespaceDeclarations, String textProperty, String attributePrefix); @Override void writeStartDocument(String encoding, String version); @Override void writeEndDocument(); void writeStartArray(String fieldName); void writeEndArray(); @Override void close(); @Override void flush(); void writeNumber(Number value); void writeBoolean(Boolean value);  }