Package com.thoughtworks.xstream.io.xml
Class Dom4JDriver
java.lang.Object
com.thoughtworks.xstream.io.AbstractDriver
com.thoughtworks.xstream.io.xml.AbstractXmlDriver
com.thoughtworks.xstream.io.xml.Dom4JDriver
- All Implemented Interfaces:
HierarchicalStreamDriver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.dom4j.DocumentFactory
private org.dom4j.io.OutputFormat
-
Constructor Summary
ConstructorsConstructorDescriptionDom4JDriver
(NameCoder nameCoder) Dom4JDriver
(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat) Dom4JDriver
(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat, NameCoder nameCoder) Dom4JDriver
(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat, XmlFriendlyReplacer replacer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.dom4j.io.SAXReader
Create and initialize the SAX reader.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 text) 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.createWriter
(OutputStream out) Create the HierarchicalStreamWriter with the formatted writer.createWriter
(Writer out) Create the HierarchicalStreamWriter with the formatted writer.org.dom4j.DocumentFactory
org.dom4j.io.OutputFormat
void
setDocumentFactory
(org.dom4j.DocumentFactory documentFactory) void
setOutputFormat
(org.dom4j.io.OutputFormat outputFormat) Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlDriver
xmlFriendlyReplacer
Methods inherited from class com.thoughtworks.xstream.io.AbstractDriver
getNameCoder
-
Field Details
-
documentFactory
private org.dom4j.DocumentFactory documentFactory -
outputFormat
private org.dom4j.io.OutputFormat outputFormat
-
-
Constructor Details
-
Dom4JDriver
public Dom4JDriver() -
Dom4JDriver
- Since:
- 1.4
-
Dom4JDriver
public Dom4JDriver(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat) -
Dom4JDriver
public Dom4JDriver(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat, NameCoder nameCoder) - Since:
- 1.4
-
Dom4JDriver
public Dom4JDriver(org.dom4j.DocumentFactory documentFactory, org.dom4j.io.OutputFormat outputFormat, XmlFriendlyReplacer replacer) Deprecated.As of 1.4, useDom4JDriver(DocumentFactory, OutputFormat, NameCoder)
instead.- Since:
- 1.2
-
-
Method Details
-
getDocumentFactory
public org.dom4j.DocumentFactory getDocumentFactory() -
setDocumentFactory
public void setDocumentFactory(org.dom4j.DocumentFactory documentFactory) -
getOutputFormat
public org.dom4j.io.OutputFormat getOutputFormat() -
setOutputFormat
public void setOutputFormat(org.dom4j.io.OutputFormat outputFormat) -
createReader
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the IO reader.- Parameters:
text
- 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
- Since:
- 1.4
-
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
- Since:
- 1.4
-
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
-
createReader
protected org.dom4j.io.SAXReader createReader() throws org.dom4j.DocumentExceptionCreate and initialize the SAX reader.- Returns:
- the SAX reader instance.
- Throws:
org.dom4j.DocumentException
- if DOCTYPE processing cannot be disabled- Since:
- 1.4.9
-
Dom4JDriver(DocumentFactory, OutputFormat, NameCoder)
instead.