class StaxResult
extends javax.xml.transform.sax.SAXResult
Result
tagging interface for StAX writers. Can be constructed with a
XMLEventConsumer
or a XMLStreamWriter
.
This class is necessary because there is no implementation of Source
for StaxReaders in JAXP 1.3.
There is a StAXResult
in JAXP 1.4 (JDK 1.6), but this class is kept around for back-ward compatibility
reasons.
Even though StaxResult
extends from SAXResult
, calling the methods of
SAXResult
is not supported. In general, the only supported operation on this class is
to use the ContentHandler
obtained via SAXResult.getHandler()
to parse an input source using an
XMLReader
. Calling setHandler(org.xml.sax.ContentHandler)
will result in
UnsupportedOperationException
s.
XMLEventWriter
,
XMLStreamWriter
,
Transformer
Modifier and Type | Field and Description |
---|---|
private javax.xml.stream.XMLEventWriter |
eventWriter |
private javax.xml.stream.XMLStreamWriter |
streamWriter |
Constructor and Description |
---|
StaxResult(javax.xml.stream.XMLEventWriter eventWriter)
Constructs a new instance of the
StaxResult with the specified XMLEventWriter . |
StaxResult(javax.xml.stream.XMLEventWriter eventWriter,
javax.xml.stream.XMLEventFactory eventFactory)
Constructs a new instance of the
StaxResult with the specified XMLEventWriter and
XMLEventFactory . |
StaxResult(javax.xml.stream.XMLStreamWriter streamWriter)
Constructs a new instance of the
StaxResult with the specified XMLStreamWriter . |
Modifier and Type | Method and Description |
---|---|
(package private) javax.xml.stream.XMLEventWriter |
getXMLEventWriter()
Returns the
XMLEventWriter used by this StaxResult . |
(package private) javax.xml.stream.XMLStreamWriter |
getXMLStreamWriter()
Returns the
XMLStreamWriter used by this StaxResult . |
void |
setHandler(org.xml.sax.ContentHandler handler)
Throws a
UnsupportedOperationException . |
private javax.xml.stream.XMLEventWriter eventWriter
private javax.xml.stream.XMLStreamWriter streamWriter
StaxResult(javax.xml.stream.XMLStreamWriter streamWriter)
StaxResult
with the specified XMLStreamWriter
.streamWriter
- the XMLStreamWriter
to write toStaxResult(javax.xml.stream.XMLEventWriter eventWriter)
StaxResult
with the specified XMLEventWriter
.eventWriter
- the XMLEventWriter
to write toStaxResult(javax.xml.stream.XMLEventWriter eventWriter, javax.xml.stream.XMLEventFactory eventFactory)
StaxResult
with the specified XMLEventWriter
and
XMLEventFactory
.eventWriter
- the XMLEventWriter
to write toeventFactory
- the XMLEventFactory
to use for creating eventsjavax.xml.stream.XMLEventWriter getXMLEventWriter()
XMLEventWriter
used by this StaxResult
. If this StaxResult
was
created with an XMLStreamWriter
, the result will be null
.StaxResult(javax.xml.stream.XMLEventWriter)
javax.xml.stream.XMLStreamWriter getXMLStreamWriter()
XMLStreamWriter
used by this StaxResult
. If this StaxResult
was
created with an XMLEventConsumer
, the result will be null
.StaxResult(javax.xml.stream.XMLStreamWriter)
public void setHandler(org.xml.sax.ContentHandler handler)
UnsupportedOperationException
.setHandler
in class javax.xml.transform.sax.SAXResult
java.lang.UnsupportedOperationException
- always