ContentDescriptor, AbstractReadHandle, AbstractWriteHandle, BufferableContentHandle<org.jdom2.Document,java.io.InputStream>, BufferableHandle, ContentHandle<org.jdom2.Document>, DocumentMetadataReadHandle, DocumentMetadataWriteHandle, DocumentPatchHandle, QueryOptionsListReadHandle, QueryOptionsReadHandle, QueryOptionsWriteHandle, ResendableContentHandle<org.jdom2.Document,java.io.InputStream>, RuleListReadHandle, RuleReadHandle, RuleWriteHandle, SearchReadHandle, SPARQLResultsReadHandle, StructureReadHandle, StructureWriteHandle, TriplesReadHandle, TriplesWriteHandle, TuplesReadHandle, ValuesListReadHandle, ValuesReadHandle, XMLReadHandle, XMLWriteHandle, OutputStreamSenderpublic class JDOMHandle extends BaseHandle<java.io.InputStream,OutputStreamSender> implements ResendableContentHandle<org.jdom2.Document,java.io.InputStream>, OutputStreamSender, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle
UNKNOWN_LENGTH| Constructor | Description |
|---|---|
JDOMHandle() |
Zero-argument constructor.
|
JDOMHandle(org.jdom2.Document content) |
Provides a handle on XML content as a JDOM document structure.
|
| Modifier and Type | Method | Description |
|---|---|---|
org.jdom2.Document |
bytesToContent(byte[] buffer) |
Converts a byte serialization to the content representation.
|
byte[] |
contentToBytes(org.jdom2.Document content) |
Converts the content representation to bytes.
|
void |
fromBuffer(byte[] buffer) |
Sets the content of the handle by copying from a byte array buffer
encoded in UTF-8.
|
org.jdom2.Document |
get() |
Returns the XML document structure.
|
org.jdom2.input.SAXBuilder |
getBuilder() |
Returns the JDOM structure builder for XML content.
|
java.lang.Class<org.jdom2.Document> |
getContentClass() |
Returns the class of the handled content, which may be a base
class of the actual class of a content object.
|
org.jdom2.output.XMLOutputter |
getOutputter() |
Returns the JDOM serializer for XML content.
|
protected org.jdom2.input.SAXBuilder |
makeBuilder() |
|
protected org.jdom2.output.XMLOutputter |
makeOutputter() |
|
static ContentHandleFactory |
newFactory() |
Creates a factory to create a JDOMHandle instance for a JDOM document.
|
JDOMHandle |
newHandle() |
Constructs a new handle for the same content representation,
initializing the new handle with the same format and mime type.
|
JDOMHandle[] |
newHandleArray(int length) |
Constructs an uninitialized array with the specified length with items
of the same content representation.
|
protected java.lang.Class<java.io.InputStream> |
receiveAs() |
|
protected void |
receiveContent(java.io.InputStream content) |
|
protected OutputStreamSender |
sendContent() |
|
void |
set(org.jdom2.Document content) |
Assigns an XML document structure as the content.
|
void |
setBuilder(org.jdom2.input.SAXBuilder builder) |
Specifies a JDOM structure builder for XML content.
|
void |
setFormat(Format format) |
Restricts the format to XML.
|
void |
setOutputter(org.jdom2.output.XMLOutputter outputter) |
Specifies a JDOM serializer for XML content.
|
byte[] |
toBuffer() |
Copies the content of the handle to a byte array buffer
encoded in UTF-8.
|
org.jdom2.Document |
toContent(java.io.InputStream serialization) |
Converts the serialization to the content representation.
|
java.lang.String |
toString() |
Returns the XML document as a string.
|
JDOMHandle |
with(org.jdom2.Document content) |
Assigns an XML document structure as the content and returns the handle.
|
void |
write(java.io.OutputStream out) |
Implements a callback to write content to the provided output stream
for sending to the database server.
|
getByteLength, getFormat, getMimetype, getServerTimestamp, setByteLength, setMimetype, setServerTimestampresendableHandleFornewArraygetPointInTimeQueryTimestamp, isResendable, setPointInTimeQueryTimestamp, setResendable, setResponseServerTimestampclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnewHandle, resendableHandleForpublic JDOMHandle()
public JDOMHandle(org.jdom2.Document content)
content - the XML document.public static ContentHandleFactory newFactory()
public JDOMHandle newHandle()
ContentHandlenewHandle in interface BufferableContentHandle<org.jdom2.Document,java.io.InputStream>newHandle in interface ContentHandle<org.jdom2.Document>newHandle in interface ResendableContentHandle<org.jdom2.Document,java.io.InputStream>public JDOMHandle[] newHandleArray(int length)
BufferableContentHandlenewHandleArray in interface BufferableContentHandle<org.jdom2.Document,java.io.InputStream>newHandleArray in interface ResendableContentHandle<org.jdom2.Document,java.io.InputStream>length - the number of positions in the arraypublic org.jdom2.input.SAXBuilder getBuilder()
public void setBuilder(org.jdom2.input.SAXBuilder builder)
builder - the JDOM builder.protected org.jdom2.input.SAXBuilder makeBuilder()
public org.jdom2.output.XMLOutputter getOutputter()
public void setOutputter(org.jdom2.output.XMLOutputter outputter)
outputter - the JDOM serializer.protected org.jdom2.output.XMLOutputter makeOutputter()
public org.jdom2.Document get()
get in interface ContentHandle<org.jdom2.Document>public void set(org.jdom2.Document content)
set in interface ContentHandle<org.jdom2.Document>content - the XML document.public JDOMHandle with(org.jdom2.Document content)
content - the XML document.public java.lang.Class<org.jdom2.Document> getContentClass()
ContentHandlegetContentClass in interface ContentHandle<org.jdom2.Document>public void setFormat(Format format)
setFormat in interface ContentDescriptorsetFormat in class BaseHandle<java.io.InputStream,OutputStreamSender>format - the format of the contentpublic void fromBuffer(byte[] buffer)
BufferableHandlefromBuffer in interface BufferableHandlebuffer - the byte arraypublic byte[] toBuffer()
BufferableHandletoBuffer in interface BufferableHandlepublic org.jdom2.Document bytesToContent(byte[] buffer)
BufferableContentHandlebytesToContent in interface BufferableContentHandle<org.jdom2.Document,java.io.InputStream>buffer - the byte serializationpublic byte[] contentToBytes(org.jdom2.Document content)
BufferableContentHandlecontentToBytes in interface BufferableContentHandle<org.jdom2.Document,java.io.InputStream>content - the contentpublic java.lang.String toString()
toString in class java.lang.Objectpublic org.jdom2.Document toContent(java.io.InputStream serialization)
BufferableContentHandletoContent in interface BufferableContentHandle<org.jdom2.Document,java.io.InputStream>serialization - a serialization of the contentprotected java.lang.Class<java.io.InputStream> receiveAs()
receiveAs in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>protected void receiveContent(java.io.InputStream content)
receiveContent in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>protected OutputStreamSender sendContent()
sendContent in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>public void write(java.io.OutputStream out)
throws java.io.IOException
OutputStreamSenderwrite in interface OutputStreamSenderout - the output stream receiving the contentjava.io.IOException - if io problems ariseCopyright © 2013-2021 MarkLogic Corporation.