public class DatabaseDocument extends Object implements MarkLogicDocument, InternalConstants
MarkLogicDocument
retrieved from a database via MarkLogic Server.Modifier and Type | Field and Description |
---|---|
protected byte[] |
content |
protected ContentType |
contentType |
protected InputStream |
is |
static
org.apache.commons.logging.Log |
LOG |
MAX_BUFFER_SIZE
Constructor and Description |
---|
DatabaseDocument() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getContentAsByteArray()
Return content as byte array.
|
InputStream |
getContentAsByteStream()
Return content as byte stream.
|
MarkLogicNode |
getContentAsMarkLogicNode()
Return content as MarkLogicNode.
|
String |
getContentAsString()
Return content as String.
|
org.apache.hadoop.io.Text |
getContentAsText()
Return content as Text.
|
long |
getContentSize()
Return byte length of the content.
|
ContentType |
getContentType()
Return content type of the document.
|
boolean |
isStreamable()
Whether the content can be streamed.
|
void |
readFields(DataInput in) |
void |
set(com.marklogic.xcc.ResultItem item) |
void |
setContent(byte[] content) |
void |
setContentType(ContentType type) |
void |
write(DataOutput out) |
public static final org.apache.commons.logging.Log LOG
protected byte[] content
protected InputStream is
protected ContentType contentType
public ContentType getContentType()
MarkLogicDocument
getContentType
in interface MarkLogicDocument
public org.apache.hadoop.io.Text getContentAsText()
MarkLogicDocument
getContentAsText
in interface MarkLogicDocument
public byte[] getContentAsByteArray()
MarkLogicDocument
getContentAsByteArray
in
interface MarkLogicDocument
public InputStream getContentAsByteStream()
MarkLogicDocument
getContentAsByteStream
in
interface MarkLogicDocument
public MarkLogicNode getContentAsMarkLogicNode()
MarkLogicDocument
getContentAsMarkLogicNode
in
interface MarkLogicDocument
public String getContentAsString() throws UnsupportedEncodingException
MarkLogicDocument
getContentAsString
in interface MarkLogicDocument
UnsupportedEncodingException
public void set(com.marklogic.xcc.ResultItem item)
public void setContent(byte[] content)
public void setContentType(ContentType type)
public void readFields(DataInput in) throws IOException
readFields
in interface MarkLogicDocument
readFields
in
interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface MarkLogicDocument
write
in
interface org.apache.hadoop.io.Writable
IOException
public long getContentSize()
MarkLogicDocument
getContentSize
in interface MarkLogicDocument
public boolean isStreamable()
MarkLogicDocument
isStreamable
in interface MarkLogicDocument
Copyright © 2020 MarkLogic
Corporation. All Rights Reserved.
Complete online documentation for MarkLogic Server,
XQuery and related components may be found at
developer.marklogic.com