Package io.debezium.document
Interface DocumentReader
-
- All Known Implementing Classes:
JacksonReader
@ThreadSafe public interface DocumentReader
ReadsDocumentinstances from a variety of input forms.- Author:
- Randall Hauch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static DocumentReaderdefaultReader()Get the defaultDocumentReaderinstance.static DocumentReaderfloatNumbersAsTextReader()GetDocumentReaderinstance that returns fp numbers as text.default Documentread(byte[] rawBytes)Read a document from the supplied bytes.default Documentread(File jsonFile)Read a document from the supplied file.Documentread(InputStream jsonStream)Read a document from the supplied stream.Documentread(Reader jsonReader)Read a document from the suppliedReader.Documentread(String json)Read a document from the supplied JSON-formatted string.default Documentread(URL jsonUrl)Read a document from the content at the given URL.
-
-
-
Method Detail
-
defaultReader
static DocumentReader defaultReader()
Get the defaultDocumentReaderinstance.- Returns:
- the shared default reader instance; never null
-
floatNumbersAsTextReader
static DocumentReader floatNumbersAsTextReader()
GetDocumentReaderinstance that returns fp numbers as text.- Returns:
- the shared default reader instance; never null
-
read
Document read(InputStream jsonStream) throws IOException
Read a document from the supplied stream.- Parameters:
jsonStream- the input stream to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied stream
-
read
Document read(Reader jsonReader) throws IOException
Read a document from the suppliedReader.- Parameters:
jsonReader- the reader to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied reader
-
read
Document read(String json) throws IOException
Read a document from the supplied JSON-formatted string.- Parameters:
json- the JSON string representation to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied string
-
read
default Document read(URL jsonUrl) throws IOException
Read a document from the content at the given URL.- Parameters:
jsonUrl- the URL to the content that is to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied content
-
read
default Document read(File jsonFile) throws IOException
Read a document from the supplied file.- Parameters:
jsonFile- the file to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied file
-
read
default Document read(byte[] rawBytes) throws IOException
Read a document from the supplied bytes.- Parameters:
rawBytes- the UTF-8 bytes to be read; may not be null- Returns:
- the document instance; never null
- Throws:
IOException- if a document could not be read from the supplied bytes
-
-