@ThreadSafe public interface DocumentWriter
Document instances to a variety of output forms.| Modifier and Type | Method and Description |
|---|---|
static DocumentWriter |
defaultWriter()
Get the default DocumentWriter instance.
|
static DocumentWriter |
prettyWriter()
Get the default DocumentWriter instance that outputs nicely-formatted JSON arrays.
|
String |
write(Document document)
Write the supplied document to a string using UTF-8.
|
void |
write(Document document,
OutputStream jsonStream)
Write the supplied document to bytes using UTF-8.
|
void |
write(Document document,
Writer jsonWriter)
Write the supplied document to bytes using UTF-8.
|
default byte[] |
writeAsBytes(Document document)
Write the supplied array to bytes using UTF-8.
|
static DocumentWriter defaultWriter()
static DocumentWriter prettyWriter()
default byte[] writeAsBytes(Document document)
document - the document to be written; may not be nullvoid write(Document document, OutputStream jsonStream) throws IOException
document - the array to be written; may not be nulljsonStream - the stream to which the document is to be written; may not be nullIOException - if a document could not be written to the supplied streamvoid write(Document document, Writer jsonWriter) throws IOException
document - the array to be written; may not be nulljsonWriter - the writer to which the document is to be written; may not be nullIOException - if a document could not be written to the supplied streamString write(Document document) throws IOException
document - the document to be written; may not be nullIOException - if a document could not be written to the supplied streamCopyright © 2020 JBoss by Red Hat. All rights reserved.