Top Description Inners Fields Constructors Methods
org.jvnet.staxex.util

public Class XMLStreamReaderToXMLStreamWriter

extends Object
Class Inheritance
Imports
java.io.IOException, jakarta.xml.bind.attachment.AttachmentMarshaller, javax.xml.stream.XMLStreamConstants, .XMLStreamException, .XMLStreamReader, .XMLStreamWriter, javax.xml.XMLConstants, org.jvnet.staxex.Base64Data, .XMLStreamReaderEx, .XMLStreamWriterEx

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

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

Authors
Kohsuke Kawaguchi, Ryan Shoemaker

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private char[]
private static final int
protected XMLStreamReader
pack-priv AttachmentMarshaller
pack-priv boolean
protected XMLStreamWriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
bridge(XMLStreamReader in, XMLStreamWriter out)

Reads one subtree and writes it out.

public void
private void
private static String
private int
private int
protected void
handleAttribute(int i)

Writes out the i-th attribute of the current element.

protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufback to summary
private char[] buf
BUF_SIZEback to summary
private static final int BUF_SIZE
inback to summary
protected XMLStreamReader in
mtomAttachmentMarshallerback to summary
pack-priv AttachmentMarshaller mtomAttachmentMarshaller
optimizeBase64Databack to summary
pack-priv boolean optimizeBase64Data
outback to summary
protected XMLStreamWriter out

Constructor Detail

XMLStreamReaderToXMLStreamWriterback to summary
public XMLStreamReaderToXMLStreamWriter()

Method Detail

bridgeback to summary
public void bridge(XMLStreamReader in, XMLStreamWriter out) throws 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.

bridgeback to summary
public void bridge(XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws XMLStreamException
bridgeback to summary
private void bridge(XMLStreamReader in, XMLStreamWriter out, XMLStreamReaderToXMLStreamWriter.Breakpoint breakPoint) throws XMLStreamException
fixNullback to summary
private static String fixNull(String s)
getEventTypeback to summary
private int getEventType() throws XMLStreamException
getNextEventback to summary
private int getNextEvent() throws XMLStreamException
handleAttributeback to summary
protected void handleAttribute(int i) throws XMLStreamException

Writes out the i-th attribute of the current element.

Used from handleStartElement().

handleCDATAback to summary
protected void handleCDATA() throws XMLStreamException
handleCharactersback to summary
protected void handleCharacters() throws XMLStreamException
handleCommentback to summary
protected void handleComment() throws XMLStreamException
handleDTDback to summary
protected void handleDTD() throws XMLStreamException
handleEndElementback to summary
protected void handleEndElement() throws XMLStreamException
handleEntityReferenceback to summary
protected void handleEntityReference() throws XMLStreamException
handlePIback to summary
protected void handlePI() throws XMLStreamException
handleSpaceback to summary
protected void handleSpace() throws XMLStreamException
handleStartElementback to summary
protected void handleStartElement() throws XMLStreamException
org.jvnet.staxex.util back to summary

public Class XMLStreamReaderToXMLStreamWriter.Breakpoint

extends Object
Class Inheritance
  • java.lang.Object
  • org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter.Breakpoint

Field Summary

Modifier and TypeField and Description
protected XMLStreamReader
protected XMLStreamWriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public XMLStreamReader
public XMLStreamWriter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

readerback to summary
protected XMLStreamReader reader
writerback to summary
protected XMLStreamWriter writer

Constructor Detail

Breakpointback to summary
public Breakpoint(XMLStreamReader r, XMLStreamWriter w)

Method Detail

proceedAfterStartElementback to summary
public boolean proceedAfterStartElement()
proceedBeforeStartElementback to summary
public boolean proceedBeforeStartElement()
readerback to summary
public XMLStreamReader reader()
writerback to summary
public XMLStreamWriter writer()