public class JacksonHandle extends com.marklogic.client.impl.JacksonBaseHandle<com.fasterxml.jackson.databind.JsonNode> implements ContentHandle<com.fasterxml.jackson.databind.JsonNode>, OutputStreamSender, BufferableHandle, JSONReadHandle, JSONWriteHandle, TextReadHandle, TextWriteHandle, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, SPARQLResultsReadHandle
An adapter for using the Jackson Open Source library for JSON; represents JSON content as a Jackson JsonNode for reading or writing. Enables reading and writing JSON documents, JSON structured search, and other JSON input and output.
UNKNOWN_LENGTH| Constructor and Description |
|---|
JacksonHandle()
Zero-argument constructor.
|
JacksonHandle(com.fasterxml.jackson.databind.JsonNode content)
Provides a handle on JSON content as a Jackson tree.
|
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
get()
Returns the root node of the JSON tree.
|
static ContentHandleFactory |
newFactory()
Creates a factory to create a JacksonHandle instance for a JSON node.
|
void |
set(com.fasterxml.jackson.databind.JsonNode content)
Assigns a JSON tree as the content.
|
JacksonHandle |
with(com.fasterxml.jackson.databind.JsonNode content)
Assigns a JSON tree as the content and returns the handle.
|
JacksonHandle |
withFormat(Format format)
Specifies the format of the content and returns the handle as a fluent convenience.
|
void |
write(OutputStream out)
Implements a callback to write content to the provided output stream for sending to the database server.
|
fromBuffer, getMapper, setMapper, toBuffer, toStringgetByteLength, getFormat, getMimetype, getServerTimestamp, setByteLength, setFormat, setMimetype, setServerTimestampgetPointInTimeQueryTimestamp, setPointInTimeQueryTimestamp, setResponseServerTimestampequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfromBuffer, toBufferpublic JacksonHandle()
Zero-argument constructor.
public JacksonHandle(com.fasterxml.jackson.databind.JsonNode content)
Provides a handle on JSON content as a Jackson tree.
content - the JSON root node of the tree.public static ContentHandleFactory newFactory()
Creates a factory to create a JacksonHandle instance for a JSON node.
public JacksonHandle withFormat(Format format)
Specifies the format of the content and returns the handle as a fluent convenience.
format - the format of the contentpublic com.fasterxml.jackson.databind.JsonNode get()
Returns the root node of the JSON tree.
get in interface ContentHandle<com.fasterxml.jackson.databind.JsonNode>public void set(com.fasterxml.jackson.databind.JsonNode content)
Assigns a JSON tree as the content.
set in interface ContentHandle<com.fasterxml.jackson.databind.JsonNode>set in class com.marklogic.client.impl.JacksonBaseHandle<com.fasterxml.jackson.databind.JsonNode>content - the JSON root node.public JacksonHandle with(com.fasterxml.jackson.databind.JsonNode content)
Assigns a JSON tree as the content and returns the handle.
content - the JSON root node.public void write(OutputStream out) throws IOException
OutputStreamSenderImplements a callback to write content to the provided output stream for sending to the database server.
write in interface OutputStreamSenderwrite in class com.marklogic.client.impl.JacksonBaseHandle<com.fasterxml.jackson.databind.JsonNode>out - the output stream receiving the contentIOException - if io problems ariseCopyright © 2013-2017 MarkLogic Corporation.