Package org.jvnet.staxex.util
Class XMLStreamReaderToXMLStreamWriter
- java.lang.Object
-
- org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter
-
- Direct Known Subclasses:
WSDLPatcher
public class XMLStreamReaderToXMLStreamWriter extends Object
Reads a sub-tree fromXMLStreamReaderand writes toXMLStreamWriteras-is.This class can be sub-classed to implement a simple transformation logic.
- Author:
- Kohsuke Kawaguchi, Ryan Shoemaker
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLStreamReaderToXMLStreamWriter.Breakpoint
-
Field Summary
Fields Modifier and Type Field Description protected XMLStreamReaderinprotected XMLStreamWriterout
-
Constructor Summary
Constructors Constructor Description XMLStreamReaderToXMLStreamWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbridge(XMLStreamReader in, XMLStreamWriter out)Reads one subtree and writes it out.voidbridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint)protected voidhandleAttribute(int i)Writes out thei-th attribute of the current element.protected voidhandleCDATA()protected voidhandleCharacters()protected voidhandleComment()protected voidhandleDTD()protected voidhandleEndElement()protected voidhandleEntityReference()protected voidhandlePI()protected voidhandleSpace()protected voidhandleStartElement()
-
-
-
Field Detail
-
in
protected XMLStreamReader in
-
out
protected XMLStreamWriter out
-
-
Method Detail
-
bridge
public void bridge(XMLStreamReader in, XMLStreamWriter out) throws XMLStreamException
Reads one subtree and writes it out.The
XMLStreamWriternever receives a start/end document event. Those need to be written separately by the caller.- Throws:
XMLStreamException
-
bridge
public void bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws XMLStreamException
- Throws:
XMLStreamException
-
handlePI
protected void handlePI() throws XMLStreamException- Throws:
XMLStreamException
-
handleCharacters
protected void handleCharacters() throws XMLStreamException- Throws:
XMLStreamException
-
handleEndElement
protected void handleEndElement() throws XMLStreamException- Throws:
XMLStreamException
-
handleStartElement
protected void handleStartElement() throws XMLStreamException- Throws:
XMLStreamException
-
handleAttribute
protected void handleAttribute(int i) throws XMLStreamExceptionWrites out thei-th attribute of the current element.Used from
handleStartElement().- Throws:
XMLStreamException
-
handleDTD
protected void handleDTD() throws XMLStreamException- Throws:
XMLStreamException
-
handleComment
protected void handleComment() throws XMLStreamException- Throws:
XMLStreamException
-
handleEntityReference
protected void handleEntityReference() throws XMLStreamException- Throws:
XMLStreamException
-
handleSpace
protected void handleSpace() throws XMLStreamException- Throws:
XMLStreamException
-
handleCDATA
protected void handleCDATA() throws XMLStreamException- Throws:
XMLStreamException
-
-