@ThreadSafe public interface DocumentReader
Document instances from a variety of input forms.| Modifier and Type | Method and Description |
|---|---|
static DocumentReader |
defaultReader()
Get the default
DocumentReader instance. |
default Document |
read(byte[] rawBytes)
Read a document from the supplied bytes.
|
default Document |
read(File jsonFile)
Read a document from the supplied file.
|
Document |
read(InputStream jsonStream)
Read a document from the supplied stream.
|
Document |
read(Reader jsonReader)
Read a document from the supplied
Reader. |
Document |
read(String json)
Read a document from the supplied JSON-formatted string.
|
default Document |
read(URL jsonUrl)
Read a document from the content at the given URL.
|
static DocumentReader defaultReader()
DocumentReader instance.Document read(InputStream jsonStream) throws IOException
jsonStream - the input stream to be read; may not be nullIOException - if a document could not be read from the supplied streamDocument read(Reader jsonReader) throws IOException
Reader.jsonReader - the reader to be read; may not be nullIOException - if a document could not be read from the supplied readerDocument read(String json) throws IOException
json - the JSON string representation to be read; may not be nullIOException - if a document could not be read from the supplied stringdefault Document read(URL jsonUrl) throws IOException
jsonUrl - the URL to the content that is to be read; may not be nullIOException - if a document could not be read from the supplied contentdefault Document read(File jsonFile) throws IOException
jsonFile - the file to be read; may not be nullIOException - if a document could not be read from the supplied filedefault Document read(byte[] rawBytes) throws IOException
rawBytes - the UTF-8 bytes to be read; may not be nullIOException - if a document could not be read from the supplied bytesCopyright © 2016 JBoss by Red Hat. All rights reserved.