Package io.debezium.document
Interface DocumentReader
-
- All Known Implementing Classes:
JacksonReader
@ThreadSafe public interface DocumentReader
ReadsDocument
instances 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 DocumentReader
defaultReader()
Get the defaultDocumentReader
instance.static DocumentReader
floatNumbersAsTextReader()
GetDocumentReader
instance that returns fp numbers as text.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 suppliedReader
.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.
-
-
-
Method Detail
-
defaultReader
static DocumentReader defaultReader()
Get the defaultDocumentReader
instance.- Returns:
- the shared default reader instance; never null
-
floatNumbersAsTextReader
static DocumentReader floatNumbersAsTextReader()
GetDocumentReader
instance 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
-
-