public class XMLStreamReaderToXMLStreamWriter extends Object
XMLStreamReader and writes to XMLStreamWriter
as-is.
This class can be sub-classed to implement a simple transformation logic.
| Modifier and Type | Class and Description |
|---|---|
static class |
XMLStreamReaderToXMLStreamWriter.Breakpoint |
| Modifier and Type | Field and Description |
|---|---|
protected XMLStreamReader |
in |
protected XMLStreamWriter |
out |
| Constructor and Description |
|---|
XMLStreamReaderToXMLStreamWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) |
void |
bridge(XMLStreamReader in,
XMLStreamWriter out)
Reads one subtree and writes it out.
|
protected void |
handleAttribute(int i)
Writes out the
i-th attribute of the current element. |
protected void |
handleCDATA() |
protected void |
handleCharacters() |
protected void |
handleComment() |
protected void |
handleDTD() |
protected void |
handleEndElement() |
protected void |
handleEntityReference() |
protected void |
handlePI() |
protected void |
handleSpace() |
protected void |
handleStartElement() |
protected XMLStreamReader in
protected XMLStreamWriter out
public void bridge(XMLStreamReader in, XMLStreamWriter out) throws XMLStreamException
The XMLStreamWriter never receives a start/end document event.
Those need to be written separately by the caller.
XMLStreamExceptionpublic void bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws XMLStreamException
XMLStreamExceptionprotected void handlePI()
throws XMLStreamException
XMLStreamExceptionprotected void handleCharacters()
throws XMLStreamException
XMLStreamExceptionprotected void handleEndElement()
throws XMLStreamException
XMLStreamExceptionprotected void handleStartElement()
throws XMLStreamException
XMLStreamExceptionprotected void handleAttribute(int i)
throws XMLStreamException
i-th attribute of the current element.
Used from handleStartElement().
XMLStreamExceptionprotected void handleDTD()
throws XMLStreamException
XMLStreamExceptionprotected void handleComment()
throws XMLStreamException
XMLStreamExceptionprotected void handleEntityReference()
throws XMLStreamException
XMLStreamExceptionprotected void handleSpace()
throws XMLStreamException
XMLStreamExceptionprotected void handleCDATA()
throws XMLStreamException
XMLStreamExceptionCopyright © 2005–2017 Oracle Corporation. All rights reserved.