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 | Field and Description |
---|---|
protected javax.xml.stream.XMLStreamReader |
in |
(package private) boolean |
optimizeBase64Data |
protected javax.xml.stream.XMLStreamWriter |
out |
Constructor and Description |
---|
XMLStreamReaderToXMLStreamWriter() |
Modifier and Type | Method and Description |
---|---|
void |
bridge(javax.xml.stream.XMLStreamReader in,
javax.xml.stream.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 javax.xml.stream.XMLStreamReader in
protected javax.xml.stream.XMLStreamWriter out
boolean optimizeBase64Data
public void bridge(javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamException
The XMLStreamWriter
never receives a start/end document event.
Those need to be written separately by the caller.
protected void handlePI() throws javax.xml.stream.XMLStreamException
protected void handleCharacters() throws javax.xml.stream.XMLStreamException
protected void handleEndElement() throws javax.xml.stream.XMLStreamException
protected void handleStartElement() throws javax.xml.stream.XMLStreamException
protected void handleAttribute(int i) throws javax.xml.stream.XMLStreamException
i
-th attribute of the current element.
Used from handleStartElement()
.
protected void handleDTD() throws javax.xml.stream.XMLStreamException
protected void handleComment() throws javax.xml.stream.XMLStreamException
protected void handleEntityReference() throws javax.xml.stream.XMLStreamException
protected void handleSpace() throws javax.xml.stream.XMLStreamException
protected void handleCDATA() throws javax.xml.stream.XMLStreamException
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.