com.sun.xml.ws.util.xml
Class XMLStreamReaderToXMLStreamWriter

java.lang.Object
  extended by com.sun.xml.ws.util.xml.XMLStreamReaderToXMLStreamWriter
Direct Known Subclasses:
WSDLPatcher

public class XMLStreamReaderToXMLStreamWriter
extends Object

Reads a sub-tree from XMLStreamReader and writes to XMLStreamWriter as-is.

This class can be sub-classed to implement a simple transformation logic.


Field Summary
protected  javax.xml.stream.XMLStreamReader in
           
protected  javax.xml.stream.XMLStreamWriter out
           
 
Constructor Summary
XMLStreamReaderToXMLStreamWriter()
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected javax.xml.stream.XMLStreamReader in

out

protected javax.xml.stream.XMLStreamWriter out
Constructor Detail

XMLStreamReaderToXMLStreamWriter

public XMLStreamReaderToXMLStreamWriter()
Method Detail

bridge

public void bridge(javax.xml.stream.XMLStreamReader in,
                   javax.xml.stream.XMLStreamWriter out)
            throws javax.xml.stream.XMLStreamException
Reads one subtree and writes it out.

The XMLStreamWriter never receives a start/end document event. Those need to be written separately by the caller.

Throws:
javax.xml.stream.XMLStreamException

handlePI

protected void handlePI()
                 throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleCharacters

protected void handleCharacters()
                         throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleEndElement

protected void handleEndElement()
                         throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleStartElement

protected void handleStartElement()
                           throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleAttribute

protected void handleAttribute(int i)
                        throws javax.xml.stream.XMLStreamException
Writes out the i-th attribute of the current element.

Used from handleStartElement().

Throws:
javax.xml.stream.XMLStreamException

handleDTD

protected void handleDTD()
                  throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleComment

protected void handleComment()
                      throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleEntityReference

protected void handleEntityReference()
                              throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleSpace

protected void handleSpace()
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

handleCDATA

protected void handleCDATA()
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException