ContentDescriptor
,
AbstractReadHandle
,
AbstractWriteHandle
,
BufferableHandle
,
ContentHandle<javax.xml.stream.XMLStreamReader>
,
CtsQueryWriteHandle
,
DocumentMetadataReadHandle
,
DocumentMetadataWriteHandle
,
DocumentPatchHandle
,
QueryOptionsListReadHandle
,
QueryOptionsReadHandle
,
QueryOptionsWriteHandle
,
RuleListReadHandle
,
RuleReadHandle
,
RuleWriteHandle
,
SearchReadHandle
,
SPARQLResultsReadHandle
,
StructureReadHandle
,
StructureWriteHandle
,
TriplesReadHandle
,
TriplesWriteHandle
,
TuplesReadHandle
,
ValuesListReadHandle
,
ValuesReadHandle
,
XMLReadHandle
,
XMLWriteHandle
,
OutputStreamSender
,
java.io.Closeable
,
java.lang.AutoCloseable
public class XMLStreamReaderHandle extends BaseHandle<java.io.InputStream,OutputStreamSender> implements OutputStreamSender, BufferableHandle, ContentHandle<javax.xml.stream.XMLStreamReader>, XMLReadHandle, XMLWriteHandle, StructureReadHandle, StructureWriteHandle, CtsQueryWriteHandle, java.io.Closeable
UNKNOWN_LENGTH
Constructor | Description |
---|---|
XMLStreamReaderHandle() |
Zero-argument constructor.
|
XMLStreamReaderHandle(javax.xml.stream.XMLStreamReader content) |
Initializes the handle with a StAX stream reader
for the content.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Closes the XMLStreamReader and the InputStream,
if any, used to populate the XMLStreamReader.
|
void |
fromBuffer(byte[] buffer) |
Sets the content of the handle by copying from a
byte array buffer encoded in UTF-8.
|
javax.xml.stream.XMLStreamReader |
get() |
Returns an XML Stream Reader for reading a
resource from the database as a StAX pull stream.
|
java.lang.Class<javax.xml.stream.XMLStreamReader> |
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
streams.
|
javax.xml.stream.XMLResolver |
getResolver() |
Returns the resolver for resolving references
while parsing the event reader source.
|
protected
javax.xml.stream.XMLInputFactory |
makeXMLInputFactory() |
|
static ContentHandleFactory |
newFactory() |
Creates a factory to create an
XMLStreamReaderHandle instance for a StAX stream reader.
|
protected
java.lang.Class<java.io.InputStream> |
receiveAs() |
|
protected void |
receiveContent(java.io.InputStream content) |
|
protected OutputStreamSender |
sendContent() |
|
void |
set(javax.xml.stream.XMLStreamReader content) |
Assigns the stream reader for the content.
|
void |
setFactory(javax.xml.stream.XMLInputFactory factory) |
Specifies the factory for parsing StAX
streams.
|
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.
|
java.lang.String |
toString() |
Buffers the StAX stream and returns the buffer
as an XML string.
|
XMLStreamReaderHandle |
with(javax.xml.stream.XMLStreamReader content) |
Assigns an stream reader for the content and
returns the handle as a fluent convenience.
|
XMLStreamReaderHandle |
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,
setServerTimestamp
public XMLStreamReaderHandle()
public XMLStreamReaderHandle(javax.xml.stream.XMLStreamReader content)
content
- a StAX stream 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.XMLStreamReader get()
close()
to release the response.
get
in interface ContentHandle<javax.xml.stream.XMLStreamReader>
public void set(javax.xml.stream.XMLStreamReader content)
set
in interface ContentHandle<javax.xml.stream.XMLStreamReader>
content
- a StAX stream readerpublic XMLStreamReaderHandle with(javax.xml.stream.XMLStreamReader content)
content
- a StAX stream readerpublic java.lang.Class<javax.xml.stream.XMLStreamReader> getContentClass()
ContentHandle
getContentClass
in interface ContentHandle<javax.xml.stream.XMLStreamReader>
public void setFormat(Format format)
setFormat
in interface ContentDescriptor
setFormat
in class BaseHandle<java.io.InputStream,OutputStreamSender>
format
- the format of the contentpublic XMLStreamReaderHandle withMimetype(java.lang.String mimetype)
mimetype
- the mime type of the contentpublic void fromBuffer(byte[] buffer)
BufferableHandle
fromBuffer
in interface BufferableHandle
buffer
- the byte arraypublic byte[] toBuffer()
BufferableHandle
toBuffer
in interface BufferableHandle
public void close()
close
in
interface java.lang.AutoCloseable
close
in
interface java.io.Closeable
public java.lang.String toString()
toString
in
class java.lang.Object
public 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
OutputStreamSender
write
in interface OutputStreamSender
out
- the output stream receiving the contentjava.io.IOException
- if io problems ariseCopyright © 2013-2019 MarkLogic Corporation.