public class DOMNodeHandle<T extends Node> extends BaseHandle<InputStream,OutputStreamSender> implements OutputStreamSender, BufferableHandle, ContentHandle<T>, XMLReadHandle, XMLWriteHandle
UNKNOWN_LENGTH| Constructor and Description |
|---|
DOMNodeHandle() |
DOMNodeHandle(T content)
Initializes the handle with a DOM Node for the content.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fromBuffer(byte[] buffer)
Sets the content of the handle by copying from a byte array buffer
encoded in UTF-8.
|
T |
get()
Returns the DOM Node for the content.
|
DocumentBuilderFactory |
getFactory()
Returns the factory for building DOM documents.
|
static ContentHandleFactory |
newFactory()
Creates a factory to create a DOMHandle instance for a DOM document.
|
void |
set(T content)
Assigns a DOM Node document as the content.
|
void |
setFactory(DocumentBuilderFactory factory)
Specifies the factory for building DOM documents.
|
byte[] |
toBuffer()
Copies the content of the handle to a byte array buffer
encoded in UTF-8.
|
String |
toString()
Returns the DOM Node as a string.
|
void |
write(OutputStream out)
Implements a callback to write content to the provided output stream
for sending to the database server.
|
getByteLength, getFormat, getMimetype, setByteLength, setFormat, setMimetypepublic DOMNodeHandle()
public DOMNodeHandle(T content)
content - a DOM Nodepublic static ContentHandleFactory newFactory()
public T get()
get in interface ContentHandle<T extends Node>public void set(T content)
set in interface ContentHandle<T extends Node>content - a DOM Nodepublic void fromBuffer(byte[] buffer)
BufferableHandlefromBuffer in interface BufferableHandlebuffer - the byte arraypublic byte[] toBuffer()
BufferableHandletoBuffer in interface BufferableHandlepublic String toString()
public DocumentBuilderFactory getFactory() throws ParserConfigurationException
ParserConfigurationExceptionpublic void setFactory(DocumentBuilderFactory factory)
factory - the document factorypublic void write(OutputStream out) throws IOException
OutputStreamSenderwrite in interface OutputStreamSenderout - the output stream receiving the contentIOExceptionCopyright © 2013-2015 MarkLogic Corporation.