Top Description Fields Constructors Methods
com.thoughtworks.xstream.io.xml

public Class StaxDriver

extends AbstractXmlDriver
Class Inheritance
Known Direct Subclasses
com.thoughtworks.xstream.io.xml.WstxDriver, com.thoughtworks.xstream.io.xml.StandardStaxDriver, com.thoughtworks.xstream.io.xml.BEAStaxDriver, com.thoughtworks.xstream.io.xml.SjsxpDriver
Imports
java.io.File, .FileInputStream, .FileNotFoundException, .IOException, .InputStream, .OutputStream, .Reader, .Writer, java.net.URL, javax.xml.stream.XMLInputFactory, .XMLOutputFactory, .XMLStreamException, .XMLStreamReader, .XMLStreamWriter, javax.xml.transform.Source, javax.xml.transform.stream.StreamSource, com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter, .ReaderWrapper, .StreamException, com.thoughtworks.xstream.io.naming.NameCoder

Deprecated

as a consequence of AbstractXmlDriver being deprecated. See corresponding docs for further information.

A driver using the StAX API to create XML reader and writer.
Authors
James Strachan, Jörg Schaible
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private XMLInputFactory
private XMLOutputFactory
private QNameMap

Constructor Summary

AccessConstructor and Description
public
public
StaxDriver(QNameMap qnameMap)

public
StaxDriver(QNameMap qnameMap, NameCoder nameCoder)

public
StaxDriver(NameCoder nameCoder)

public
StaxDriver(QNameMap qnameMap, XmlFriendlyReplacer replacer)

Deprecated As of 1.4, use StaxDriver#StaxDriver(QNameMap, NameCoder) instead.
public
StaxDriver(XmlFriendlyReplacer replacer)

Deprecated As of 1.4, use StaxDriver#StaxDriver(NameCoder) instead.

Method Summary

Modifier and TypeMethod and Description
protected XMLInputFactory
protected XMLOutputFactory
protected XMLStreamReader
protected XMLStreamReader
protected XMLStreamReader
public HierarchicalStreamReader
createReader(Reader
the Reader with the data to parse
xml
)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from the IO reader.
public HierarchicalStreamReader
createReader(InputStream
the InputStream with the data to parse
in
)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from the input stream.
public HierarchicalStreamReader
createReader(URL
the URL defining the location with the data to parse
in
)

Overrides com.thoughtworks.xstream.io.AbstractDriver.createReader.

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from a URL.
public HierarchicalStreamReader
createReader(File
the URL defining the location with the data to parse
in
)

Overrides com.thoughtworks.xstream.io.AbstractDriver.createReader.

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from a File.
public AbstractPullReader
createStaxReader(XMLStreamReader in)

Deprecated as a consequence of AbstractPullReader being deprecated.
public StaxWriter
createStaxWriter(XMLStreamWriter out, boolean writeStartEndDocument)

Deprecated as a consequence of StaxWriter being deprecated.
public StaxWriter
createStaxWriter(XMLStreamWriter out)

Deprecated as a consequence of StaxWriter being deprecated.
public HierarchicalStreamWriter
createWriter(Writer
the Writer to receive the formatted data
out
)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Create the HierarchicalStreamWriter with the formatted writer.
public HierarchicalStreamWriter
createWriter(OutputStream
the OutputStream to receive the formatted data
out
)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Create the HierarchicalStreamWriter with the formatted writer.
public XMLInputFactory
public XMLOutputFactory
public QNameMap
public boolean
public void
public void
setRepairingNamespace(boolean repairing)

Inherited from com.thoughtworks.xstream.io.xml.AbstractXmlDriver:
xmlFriendlyReplacer

Field Detail

inputFactoryback to summary
private XMLInputFactory inputFactory
outputFactoryback to summary
private XMLOutputFactory outputFactory
qnameMapback to summary
private QNameMap qnameMap

Constructor Detail

StaxDriverback to summary
public StaxDriver()
StaxDriverback to summary
public StaxDriver(QNameMap qnameMap)
StaxDriverback to summary
public StaxDriver(QNameMap qnameMap, NameCoder nameCoder)
Since
1.4
StaxDriverback to summary
public StaxDriver(NameCoder nameCoder)
Since
1.4
StaxDriverback to summary
public StaxDriver(QNameMap qnameMap, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use StaxDriver#StaxDriver(QNameMap, NameCoder) instead.

Since
1.2
StaxDriverback to summary
public StaxDriver(XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use StaxDriver#StaxDriver(NameCoder) instead.

Since
1.2

Method Detail

createInputFactoryback to summary
protected XMLInputFactory createInputFactory()
Since
1.4
createOutputFactoryback to summary
protected XMLOutputFactory createOutputFactory()
Since
1.4
createParserback to summary
protected XMLStreamReader createParser(Reader xml) throws XMLStreamException
createParserback to summary
protected XMLStreamReader createParser(InputStream xml) throws XMLStreamException
createParserback to summary
protected XMLStreamReader createParser(Source source) throws XMLStreamException
createReaderback to summary
public HierarchicalStreamReader createReader(Reader xml)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from the IO reader.

Parameters
xml:Reader

the Reader with the data to parse

Returns:HierarchicalStreamReader

the HierarchicalStreamReader

createReaderback to summary
public HierarchicalStreamReader createReader(InputStream in)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from the input stream.

Parameters
in:InputStream

the InputStream with the data to parse

createReaderback to summary
public HierarchicalStreamReader createReader(URL in)

Overrides com.thoughtworks.xstream.io.AbstractDriver.createReader.

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Doc from com.thoughtworks.xstream.io.AbstractDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from a URL. Depending on the parser implementation, some might take the URL as SystemId to resolve additional references.

Parameters
in:URL

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

the URL defining the location with the data to parse

Returns:HierarchicalStreamReader

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

the HierarchicalStreamReader

createReaderback to summary
public HierarchicalStreamReader createReader(File in)

Overrides com.thoughtworks.xstream.io.AbstractDriver.createReader.

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

Doc from com.thoughtworks.xstream.io.AbstractDriver.createReader.

Create the HierarchicalStreamReader with the stream parser reading from a File. Depending on the parser implementation, some might take the file path as SystemId to resolve additional references.

Parameters
in:File

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

the URL defining the location with the data to parse

Returns:HierarchicalStreamReader

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createReader.

the HierarchicalStreamReader

createStaxReaderback to summary
public AbstractPullReader createStaxReader(XMLStreamReader in)

Deprecated

as a consequence of AbstractPullReader being deprecated. See corresponding docs for further information.

createStaxWriterback to summary
public StaxWriter createStaxWriter(XMLStreamWriter out, boolean writeStartEndDocument) throws XMLStreamException

Deprecated

as a consequence of StaxWriter being deprecated. See corresponding docs for further information.

createStaxWriterback to summary
public StaxWriter createStaxWriter(XMLStreamWriter out) throws XMLStreamException

Deprecated

as a consequence of StaxWriter being deprecated. See corresponding docs for further information.

createWriterback to summary
public HierarchicalStreamWriter createWriter(Writer out)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Create the HierarchicalStreamWriter with the formatted writer.

Parameters
out:Writer

the Writer to receive the formatted data

Returns:HierarchicalStreamWriter

the HierarchicalStreamWriter

createWriterback to summary
public HierarchicalStreamWriter createWriter(OutputStream out)

Implements com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamDriver.createWriter.

Create the HierarchicalStreamWriter with the formatted writer.

Parameters
out:OutputStream

the OutputStream to receive the formatted data

Returns:HierarchicalStreamWriter

the HierarchicalStreamWriter

getInputFactoryback to summary
public XMLInputFactory getInputFactory()
getOutputFactoryback to summary
public XMLOutputFactory getOutputFactory()
getQnameMapback to summary
public QNameMap getQnameMap()
isRepairingNamespaceback to summary
public boolean isRepairingNamespace()
setQnameMapback to summary
public void setQnameMap(QNameMap qnameMap)
setRepairingNamespaceback to summary
public void setRepairingNamespace(boolean repairing)
Since
1.2