Package com.thoughtworks.xstream.io.xml
Class StaxDriver
java.lang.Object
com.thoughtworks.xstream.io.AbstractDriver
com.thoughtworks.xstream.io.xml.AbstractXmlDriver
com.thoughtworks.xstream.io.xml.StaxDriver
- All Implemented Interfaces:
HierarchicalStreamDriver
- Direct Known Subclasses:
SjsxpDriver
,StandardStaxDriver
A driver using the StAX API to create XML reader and writer.
- Version:
- $Revision$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XMLInputFactory
private XMLOutputFactory
private QNameMap
-
Constructor Summary
ConstructorsConstructorDescriptionStaxDriver
(NameCoder nameCoder) StaxDriver
(QNameMap qnameMap) StaxDriver
(QNameMap qnameMap, NameCoder nameCoder) StaxDriver
(QNameMap qnameMap, XmlFriendlyReplacer replacer) Deprecated.StaxDriver
(XmlFriendlyReplacer replacer) Deprecated.As of 1.4, useStaxDriver(NameCoder)
instead. -
Method Summary
Modifier and TypeMethodDescriptionprotected XMLInputFactory
protected XMLOutputFactory
protected XMLStreamReader
createParser
(InputStream xml) protected XMLStreamReader
createParser
(Reader xml) protected XMLStreamReader
createParser
(Source source) createReader
(File in) Create the HierarchicalStreamReader with the stream parser reading from a File.Create the HierarchicalStreamReader with the stream parser reading from the input stream.createReader
(Reader xml) Create the HierarchicalStreamReader with the stream parser reading from the IO reader.createReader
(URL in) Create the HierarchicalStreamReader with the stream parser reading from a URL.createStaxWriter
(XMLStreamWriter out, boolean writeStartEndDocument) createWriter
(OutputStream out) Create the HierarchicalStreamWriter with the formatted writer.createWriter
(Writer out) Create the HierarchicalStreamWriter with the formatted writer.boolean
void
setQnameMap
(QNameMap qnameMap) void
setRepairingNamespace
(boolean repairing) Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlDriver
xmlFriendlyReplacer
Methods inherited from class com.thoughtworks.xstream.io.AbstractDriver
getNameCoder
-
Field Details
-
qnameMap
-
inputFactory
-
outputFactory
-
-
Constructor Details
-
StaxDriver
public StaxDriver() -
StaxDriver
-
StaxDriver
- Since:
- 1.4
-
StaxDriver
- Since:
- 1.4
-
StaxDriver
Deprecated.As of 1.4, useStaxDriver(QNameMap, NameCoder)
instead.- Since:
- 1.2
-
StaxDriver
Deprecated.As of 1.4, useStaxDriver(NameCoder)
instead.- Since:
- 1.2
-
-
Method Details
-
createReader
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the IO reader.- Parameters:
xml
- theReader
with the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the input stream.- Parameters:
in
- theInputStream
with the data to parse
-
createReader
Description copied from class:AbstractDriver
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.- Specified by:
createReader
in interfaceHierarchicalStreamDriver
- Overrides:
createReader
in classAbstractDriver
- Parameters:
in
- theURL
defining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
Description copied from class:AbstractDriver
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.- Specified by:
createReader
in interfaceHierarchicalStreamDriver
- Overrides:
createReader
in classAbstractDriver
- Parameters:
in
- theURL
defining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
createWriter
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamWriter with the formatted writer.- Parameters:
out
- theWriter
to receive the formatted data- Returns:
- the HierarchicalStreamWriter
-
createWriter
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamWriter with the formatted writer.- Parameters:
out
- theOutputStream
to receive the formatted data- Returns:
- the HierarchicalStreamWriter
-
createStaxReader
-
createStaxWriter
public StaxWriter createStaxWriter(XMLStreamWriter out, boolean writeStartEndDocument) throws XMLStreamException - Throws:
XMLStreamException
-
createStaxWriter
- Throws:
XMLStreamException
-
getQnameMap
-
setQnameMap
-
getInputFactory
-
getOutputFactory
-
isRepairingNamespace
public boolean isRepairingNamespace() -
setRepairingNamespace
public void setRepairingNamespace(boolean repairing) - Since:
- 1.2
-
createParser
- Throws:
XMLStreamException
-
createParser
- Throws:
XMLStreamException
-
createParser
- Throws:
XMLStreamException
-
createInputFactory
- Since:
- 1.4
-
createOutputFactory
- Since:
- 1.4
-
StaxDriver(QNameMap, NameCoder)
instead.