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

public Class Dom4JDriver

extends AbstractXmlDriver
Class Inheritance
Imports
java.io.File, .FilterWriter, .InputStream, .OutputStream, .OutputStreamWriter, .Reader, .Writer, java.net.URL, java.nio.charset.Charset, org.dom4j.Document, .DocumentException, .DocumentFactory, org.dom4j.io.OutputFormat, .SAXReader, .XMLWriter, org.xml.sax.SAXException, 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 DocumentFactory
private OutputFormat

Constructor Summary

AccessConstructor and Description
public
public
public
Dom4JDriver(DocumentFactory documentFactory, OutputFormat outputFormat)

public
Dom4JDriver(DocumentFactory documentFactory, OutputFormat outputFormat, NameCoder nameCoder)

public

Method Summary

Modifier and TypeMethod and Description
public HierarchicalStreamReader
createReader(Reader
the Reader with the data to parse
text
)

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.
protected SAXReader

Returns:

the SAX reader instance.
createReader
()

Create and initialize the SAX reader.

public HierarchicalStreamWriter
createWriter(final 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(final OutputStream
the OutputStream to receive the formatted data
out
)

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

Create the HierarchicalStreamWriter with the formatted writer.
public DocumentFactory
public OutputFormat
public void
public void
Inherited from com.thoughtworks.xstream.io.xml.AbstractXmlDriver:
xmlFriendlyReplacer

Field Detail

documentFactoryback to summary
private DocumentFactory documentFactory
outputFormatback to summary
private OutputFormat outputFormat

Constructor Detail

Dom4JDriverback to summary
public Dom4JDriver()
Dom4JDriverback to summary
public Dom4JDriver(NameCoder nameCoder)
Since
1.4
Dom4JDriverback to summary
public Dom4JDriver(DocumentFactory documentFactory, OutputFormat outputFormat)
Dom4JDriverback to summary
public Dom4JDriver(DocumentFactory documentFactory, OutputFormat outputFormat, NameCoder nameCoder)
Since
1.4
Dom4JDriverback to summary
public Dom4JDriver(DocumentFactory documentFactory, OutputFormat outputFormat, XmlFriendlyReplacer replacer)
Since
1.2

Method Detail

createReaderback to summary
public HierarchicalStreamReader createReader(Reader text)

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
text: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

Since
1.4
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

Since
1.4
createReaderback to summary
protected SAXReader createReader() throws DocumentException

Create and initialize the SAX reader.

Returns:SAXReader

the SAX reader instance.

Exceptions
DocumentException:
if DOCTYPE processing cannot be disabled
Since
1.4.9
createWriterback to summary
public HierarchicalStreamWriter createWriter(final 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(final 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

getDocumentFactoryback to summary
public DocumentFactory getDocumentFactory()
getOutputFormatback to summary
public OutputFormat getOutputFormat()
setDocumentFactoryback to summary
public void setDocumentFactory(DocumentFactory documentFactory)
setOutputFormatback to summary
public void setOutputFormat(OutputFormat outputFormat)