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.
XMLStreamException
public void bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws XMLStreamException
XMLStreamException
protected void handlePI() throws XMLStreamException
XMLStreamException
protected void handleCharacters() throws XMLStreamException
XMLStreamException
protected void handleEndElement() throws XMLStreamException
XMLStreamException
protected void handleStartElement() throws XMLStreamException
XMLStreamException
protected void handleAttribute(int i) throws XMLStreamException
i
-th attribute of the current element.
Used from handleStartElement()
.
XMLStreamException
protected void handleDTD() throws XMLStreamException
XMLStreamException
protected void handleComment() throws XMLStreamException
XMLStreamException
protected void handleEntityReference() throws XMLStreamException
XMLStreamException
protected void handleSpace() throws XMLStreamException
XMLStreamException
protected void handleCDATA() throws XMLStreamException
XMLStreamException
Copyright © 2006-2018. All Rights Reserved.