Package org.jvnet.staxex.util
Class XMLStreamReaderToXMLStreamWriter
- java.lang.Object
-
- org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter
-
public class XMLStreamReaderToXMLStreamWriter extends java.lang.ObjectReads a sub-tree fromXMLStreamReaderand writes toXMLStreamWriteras-is.This class can be sub-classed to implement a simple transformation logic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLStreamReaderToXMLStreamWriter.Breakpoint
-
Field Summary
Fields Modifier and Type Field Description private char[]bufprivate static intBUF_SIZEprotected javax.xml.stream.XMLStreamReaderin(package private) jakarta.xml.bind.attachment.AttachmentMarshallermtomAttachmentMarshaller(package private) booleanoptimizeBase64Dataprotected javax.xml.stream.XMLStreamWriterout
-
Constructor Summary
Constructors Constructor Description XMLStreamReaderToXMLStreamWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbridge(javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out)Reads one subtree and writes it out.private voidbridge(javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out, XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint)voidbridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint)private static java.lang.StringfixNull(java.lang.String s)private intgetEventType()private intgetNextEvent()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
-
BUF_SIZE
private static final int BUF_SIZE
- See Also:
- Constant Field Values
-
in
protected javax.xml.stream.XMLStreamReader in
-
out
protected javax.xml.stream.XMLStreamWriter out
-
buf
private char[] buf
-
optimizeBase64Data
boolean optimizeBase64Data
-
mtomAttachmentMarshaller
jakarta.xml.bind.attachment.AttachmentMarshaller mtomAttachmentMarshaller
-
-
Method Detail
-
bridge
public void bridge(javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamExceptionReads one subtree and writes it out.The
XMLStreamWriternever receives a start/end document event. Those need to be written separately by the caller.- Throws:
javax.xml.stream.XMLStreamException
-
bridge
public void bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
bridge
private void bridge(javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out, XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws javax.xml.stream.XMLStreamException- 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.XMLStreamExceptionWrites out thei-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
-
fixNull
private static java.lang.String fixNull(java.lang.String s)
-
getEventType
private int getEventType() throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
getNextEvent
private int getNextEvent() throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
-