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

public Class DomDriver

extends AbstractXmlDriver
Class Inheritance
Imports
java.io.File, .IOException, .InputStream, .OutputStream, .OutputStreamWriter, .Reader, .UnsupportedEncodingException, .Writer, java.lang.reflect.InvocationTargetException, .Method, java.net.URL, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .FactoryConfigurationError, .ParserConfigurationException, org.w3c.dom.Document, org.xml.sax.InputSource, .SAXException, com.thoughtworks.xstream.converters.reflection.ObjectAccessException, com.thoughtworks.xstream.core.JVM, com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter, .StreamException, com.thoughtworks.xstream.io.naming.NameCoder

Deprecated

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

Field Summary

Modifier and TypeField and Description
private DocumentBuilderFactory
private final String

Constructor Summary

AccessConstructor and Description
public
DomDriver()

Construct a DomDriver.

public
DomDriver(String encoding)

Construct a DomDriver with a specified encoding.

public
DomDriver(String encoding, NameCoder nameCoder)

public
DomDriver(String encoding, XmlFriendlyReplacer replacer)

Deprecated As of 1.4, use DomDriver(String, NameCoder) instead.

Method Summary

Modifier and TypeMethod and Description
protected DocumentBuilderFactory

Returns:

the new instance
createDocumentBuilderFactory
()

Create the DocumentBuilderFactory instance.

public HierarchicalStreamReader
createReader(Reader
the Reader with the data to parse
in
)

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.
private HierarchicalStreamReader
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.
Inherited from com.thoughtworks.xstream.io.xml.AbstractXmlDriver:
xmlFriendlyReplacer

Field Detail

documentBuilderFactoryback to summary
private DocumentBuilderFactory documentBuilderFactory
encodingback to summary
private final String encoding

Constructor Detail

DomDriverback to summary
public DomDriver()

Construct a DomDriver.

DomDriverback to summary
public DomDriver(String encoding)

Construct a DomDriver with a specified encoding. The created DomReader will ignore any encoding attribute of the XML header though.

DomDriverback to summary
public DomDriver(String encoding, NameCoder nameCoder)
Since
1.4
DomDriverback to summary
public DomDriver(String encoding, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use DomDriver(String, NameCoder) instead.

Since
1.2

Method Detail

createDocumentBuilderFactoryback to summary
protected DocumentBuilderFactory createDocumentBuilderFactory()

Create the DocumentBuilderFactory instance.

Returns:DocumentBuilderFactory

the new instance

Since
1.4.9
createReaderback to summary
public HierarchicalStreamReader createReader(Reader 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 IO reader.

Parameters
in: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

createReaderback to summary
private HierarchicalStreamReader createReader(InputSource source)
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