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 | Description |
|---|---|---|
static class |
XMLStreamReaderToXMLStreamWriter.Breakpoint |
| Modifier and Type | Field | Description |
|---|---|---|
protected XMLStreamReader |
in |
|
protected XMLStreamWriter |
out |
| Constructor | Description |
|---|---|
XMLStreamReaderToXMLStreamWriter() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
bridge(XMLStreamReader in,
XMLStreamWriter out) |
Reads one subtree and writes it out.
|
void |
bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) |
|
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 © 2006-2018. All Rights Reserved.