@ThreadSafe final class JacksonReader extends Object implements DocumentReader, ArrayReader
DocumentReader and ArrayReader that uses the Jackson library to read JSON.| Modifier and Type | Field and Description |
|---|---|
static JacksonReader |
DEFAULT_INSTANCE |
private static com.fasterxml.jackson.core.JsonFactory |
factory |
static JacksonReader |
FLOAT_NUMBERS_AS_TEXT_INSTANCE |
private boolean |
handleFloatNumbersAsText |
| Modifier | Constructor and Description |
|---|---|
private |
JacksonReader(boolean handleFloatNumbersAsText) |
| Modifier and Type | Method and Description |
|---|---|
private Document |
parse(com.fasterxml.jackson.core.JsonParser parser) |
private Array |
parseArray(com.fasterxml.jackson.core.JsonParser parser,
boolean nested) |
private Document |
parseDocument(com.fasterxml.jackson.core.JsonParser parser,
boolean nested) |
Document |
read(byte[] rawBytes)
Read a document from the supplied bytes.
|
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.
|
Document |
read(URL jsonUrl)
Read a document from the content at the given URL.
|
Array |
readArray(File jsonFile)
Read an array from the supplied file.
|
Array |
readArray(InputStream jsonStream)
Read an array from the supplied stream.
|
Array |
readArray(Reader jsonReader)
Read an array from the supplied
Reader. |
Array |
readArray(String jsonArray)
Read an array from the supplied JSON-formatted string.
|
Array |
readArray(URL jsonUrl)
Read an array from the content at the given URL.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdefaultReader, floatNumbersAsTextReaderdefaultReader, readArraypublic static final JacksonReader DEFAULT_INSTANCE
public static final JacksonReader FLOAT_NUMBERS_AS_TEXT_INSTANCE
private static final com.fasterxml.jackson.core.JsonFactory factory
private final boolean handleFloatNumbersAsText
public Document read(InputStream jsonStream) throws IOException
DocumentReaderread in interface DocumentReaderjsonStream - the input stream to be read; may not be nullIOException - if a document could not be read from the supplied streampublic Document read(Reader jsonReader) throws IOException
DocumentReaderReader.read in interface DocumentReaderjsonReader - the reader to be read; may not be nullIOException - if a document could not be read from the supplied readerpublic Document read(String json) throws IOException
DocumentReaderread in interface DocumentReaderjson - the JSON string representation to be read; may not be nullIOException - if a document could not be read from the supplied stringpublic Document read(File jsonFile) throws IOException
DocumentReaderread in interface DocumentReaderjsonFile - the file to be read; may not be nullIOException - if a document could not be read from the supplied filepublic Document read(URL jsonUrl) throws IOException
DocumentReaderread in interface DocumentReaderjsonUrl - the URL to the content that is to be read; may not be nullIOException - if a document could not be read from the supplied contentpublic Document read(byte[] rawBytes) throws IOException
DocumentReaderread in interface DocumentReaderrawBytes - the UTF-8 bytes to be read; may not be nullIOException - if a document could not be read from the supplied bytespublic Array readArray(InputStream jsonStream) throws IOException
ArrayReaderreadArray in interface ArrayReaderjsonStream - the input stream to be read; may not be nullIOException - if an array could not be read from the supplied streampublic Array readArray(Reader jsonReader) throws IOException
ArrayReaderReader.readArray in interface ArrayReaderjsonReader - the reader to be read; may not be nullIOException - if an array could not be read from the supplied readerpublic Array readArray(URL jsonUrl) throws IOException
ArrayReaderreadArray in interface ArrayReaderjsonUrl - the URL to the content that is to be read; may not be nullIOException - if an array could not be read from the supplied contentpublic Array readArray(File jsonFile) throws IOException
ArrayReaderreadArray in interface ArrayReaderjsonFile - the file to be read; may not be nullIOException - if an array could not be read from the supplied filepublic Array readArray(String jsonArray) throws IOException
ArrayReaderreadArray in interface ArrayReaderjsonArray - the JSON string representation to be read; may not be nullIOException - if an array could not be read from the supplied stringprivate Document parse(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionprivate Document parseDocument(com.fasterxml.jackson.core.JsonParser parser, boolean nested) throws IOException
IOExceptionprivate Array parseArray(com.fasterxml.jackson.core.JsonParser parser, boolean nested) throws IOException
IOExceptionCopyright © 2020 JBoss by Red Hat. All rights reserved.