ContentDescriptor, AbstractReadHandle, AbstractWriteHandle, BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>, BufferableHandle, ContentHandle<javax.xml.stream.XMLEventReader>, CtsQueryWriteHandle, DocumentMetadataReadHandle, DocumentMetadataWriteHandle, DocumentPatchHandle, QueryOptionsListReadHandle, QueryOptionsReadHandle, QueryOptionsWriteHandle, RuleListReadHandle, RuleReadHandle, RuleWriteHandle, SearchReadHandle, SPARQLResultsReadHandle, StreamingContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>, StructureReadHandle, StructureWriteHandle, TriplesReadHandle, TriplesWriteHandle, TuplesReadHandle, ValuesListReadHandle, ValuesReadHandle, XMLReadHandle, XMLWriteHandle, OutputStreamSender, java.io.Closeable, java.lang.AutoCloseablepublic class XMLEventReaderHandle extends BaseHandle<java.io.InputStream,OutputStreamSender> implements OutputStreamSender, StreamingContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, CtsQueryWriteHandle, java.io.Closeable
UNKNOWN_LENGTH| Constructor | Description |
|---|---|
XMLEventReaderHandle() |
Zero-argument constructor.
|
XMLEventReaderHandle(javax.xml.stream.XMLEventReader content) |
Initializes the handle with a StAX event reader for the content.
|
| Modifier and Type | Method | Description |
|---|---|---|
javax.xml.stream.XMLEventReader |
bytesToContent(byte[] buffer) |
Converts a byte serialization to the content representation.
|
void |
close() |
Either call close() or get().close() when finished with this handle to close the underlying InputStream.
|
byte[] |
contentToBytes(javax.xml.stream.XMLEventReader 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.
|
javax.xml.stream.XMLEventReader |
get() |
Returns an XML Event Reader reading a resource from the database
as a series of StAX events.
|
java.lang.Class<javax.xml.stream.XMLEventReader> |
getContentClass() |
Returns the class of the handled content, which may be a base
class of the actual class of a content object.
|
javax.xml.stream.XMLInputFactory |
getFactory() |
Returns the factory for parsing StAX events.
|
javax.xml.stream.XMLResolver |
getResolver() |
Returns the resolver for resolving references while parsing
the event reader source.
|
protected javax.xml.stream.XMLInputFactory |
makeXMLInputFactory() |
|
javax.xml.stream.XMLEventReader[] |
newArray(int length) |
Constructs an array for the handled content representation
|
static ContentHandleFactory |
newFactory() |
Creates a factory to create an XMLEventReaderHandle instance for a StAX event reader.
|
XMLEventReaderHandle |
newHandle() |
Constructs a new handle for the same content representation,
initializing the new handle with the same format and mime type.
|
XMLEventReaderHandle[] |
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(javax.xml.stream.XMLEventReader content) |
Assigns the event reader for the content.
|
void |
setFactory(javax.xml.stream.XMLInputFactory factory) |
Specifies the factory for parsing StAX events.
|
void |
setFormat(Format format) |
Restricts the format to XML.
|
void |
setResolver(javax.xml.stream.XMLResolver resolver) |
Specifies the resolver for resolving references while parsing
the event reader source.
|
byte[] |
toBuffer() |
Copies the content of the handle to a byte array buffer
encoded in UTF-8.
|
javax.xml.stream.XMLEventReader |
toContent(java.io.InputStream serialization) |
Converts the serialization to the content representation.
|
java.lang.String |
toString() |
Buffers the StAX event source and returns the buffer
as an XML string.
|
XMLEventReaderHandle |
with(javax.xml.stream.XMLEventReader content) |
Assigns an event reader for the content and returns the handle
as a fluent convenience.
|
XMLEventReaderHandle |
withMimetype(java.lang.String mimetype) |
Specifies the mime type of the content and returns the handle
as a fluent convenience.
|
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, setServerTimestampnewHandle, resendableHandleForgetPointInTimeQueryTimestamp, isResendable, setPointInTimeQueryTimestamp, setResendable, setResponseServerTimestampclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitresendableHandleForpublic XMLEventReaderHandle()
public XMLEventReaderHandle(javax.xml.stream.XMLEventReader content)
content - a StAX event readerpublic static ContentHandleFactory newFactory()
public javax.xml.stream.XMLResolver getResolver()
public void setResolver(javax.xml.stream.XMLResolver resolver)
resolver - the reference resolverpublic javax.xml.stream.XMLEventReader get()
get in interface ContentHandle<javax.xml.stream.XMLEventReader>public void set(javax.xml.stream.XMLEventReader content)
set in interface ContentHandle<javax.xml.stream.XMLEventReader>content - a StAX event readerpublic XMLEventReaderHandle with(javax.xml.stream.XMLEventReader content)
content - a StAX event readerpublic java.lang.Class<javax.xml.stream.XMLEventReader> getContentClass()
ContentHandlegetContentClass in interface ContentHandle<javax.xml.stream.XMLEventReader>public XMLEventReaderHandle newHandle()
ContentHandlenewHandle in interface BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>newHandle in interface ContentHandle<javax.xml.stream.XMLEventReader>public XMLEventReaderHandle[] newHandleArray(int length)
BufferableContentHandlenewHandleArray in interface BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>length - the number of positions in the arraypublic javax.xml.stream.XMLEventReader[] newArray(int length)
ContentHandlenewArray in interface ContentHandle<javax.xml.stream.XMLEventReader>length - the size of the array (zero or more)public void setFormat(Format format)
setFormat in interface ContentDescriptorsetFormat in class BaseHandle<java.io.InputStream,OutputStreamSender>format - the format of the contentpublic XMLEventReaderHandle withMimetype(java.lang.String mimetype)
mimetype - the mime type of the contentpublic void fromBuffer(byte[] buffer)
BufferableHandlefromBuffer in interface BufferableHandlebuffer - the byte arraypublic byte[] toBuffer()
BufferableHandletoBuffer in interface BufferableHandlepublic javax.xml.stream.XMLEventReader toContent(java.io.InputStream serialization)
BufferableContentHandletoContent in interface BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>serialization - a serialization of the contentpublic javax.xml.stream.XMLEventReader bytesToContent(byte[] buffer)
BufferableContentHandlebytesToContent in interface BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>buffer - the byte serializationpublic byte[] contentToBytes(javax.xml.stream.XMLEventReader content)
BufferableContentHandlecontentToBytes in interface BufferableContentHandle<javax.xml.stream.XMLEventReader,java.io.InputStream>content - the contentpublic java.lang.String toString()
toString in class java.lang.Objectpublic javax.xml.stream.XMLInputFactory getFactory()
public void setFactory(javax.xml.stream.XMLInputFactory factory)
factory - the StAX factoryprotected javax.xml.stream.XMLInputFactory makeXMLInputFactory()
protected 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 arisepublic void close()
close in interface java.lang.AutoCloseableclose in interface java.io.CloseableCopyright © 2013-2021 MarkLogic Corporation.