public class XMLStreamReaderToContentHandler extends Object implements StAXReaderToContentHandler
XMLStreamReader to SAX events on a
ContentHandler, bridging between the two parser
technologies.| Constructor and Description |
|---|
XMLStreamReaderToContentHandler(XMLStreamReader staxCore,
XMLFilterImplEx filter)
Construct a new StAX to SAX adapter that will convert a StAX event stream
into a SAX event stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bridge()
Perform the conversion from StAX events to SAX events.
|
public XMLStreamReaderToContentHandler(XMLStreamReader staxCore, XMLFilterImplEx filter)
staxCore - StAX event sourcefilter - SAX event sinkpublic void bridge()
throws XMLStreamException
StAXReaderToContentHandlerThe StAX parser must be pointing at the start element or the start document. The method reads the parser until it hits the corresponding end element, and turns the complete sub-tree into the equivalent of the SAX events.
The receiver of the SAX event will see this sub-tree as if it were a whole document.
When this method returns successfully, the parser is at the next token of the end element.
bridge in interface StAXReaderToContentHandlerXMLStreamException - if any errors are encountered while parsing XML from the
XMLStreamReader or firing events on the ContentHandler.Copyright © 2021. All rights reserved.