Package com.thoughtworks.xstream.io.xml
Class DomDriver
- java.lang.Object
-
- com.thoughtworks.xstream.io.AbstractDriver
-
- com.thoughtworks.xstream.io.xml.AbstractXmlDriver
-
- com.thoughtworks.xstream.io.xml.DomDriver
-
- All Implemented Interfaces:
HierarchicalStreamDriver
public class DomDriver extends AbstractXmlDriver
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.parsers.DocumentBuilderFactorydocumentBuilderFactoryprivate java.lang.Stringencoding
-
Constructor Summary
Constructors Constructor Description DomDriver()Construct a DomDriver.DomDriver(java.lang.String encoding)Construct a DomDriver with a specified encoding.DomDriver(java.lang.String encoding, NameCoder nameCoder)DomDriver(java.lang.String encoding, XmlFriendlyReplacer replacer)Deprecated.As of 1.4, useDomDriver(String, NameCoder)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.parsers.DocumentBuilderFactorycreateDocumentBuilderFactory()Create the DocumentBuilderFactory instance.HierarchicalStreamReadercreateReader(java.io.File in)Create the HierarchicalStreamReader with the stream parser reading from a File.HierarchicalStreamReadercreateReader(java.io.InputStream in)Create the HierarchicalStreamReader with the stream parser reading from the input stream.HierarchicalStreamReadercreateReader(java.io.Reader in)Create the HierarchicalStreamReader with the stream parser reading from the IO reader.HierarchicalStreamReadercreateReader(java.net.URL in)Create the HierarchicalStreamReader with the stream parser reading from a URL.private HierarchicalStreamReadercreateReader(org.xml.sax.InputSource source)HierarchicalStreamWritercreateWriter(java.io.OutputStream out)Create the HierarchicalStreamWriter with the formatted writer.HierarchicalStreamWritercreateWriter(java.io.Writer out)Create the HierarchicalStreamWriter with the formatted writer.-
Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlDriver
xmlFriendlyReplacer
-
Methods inherited from class com.thoughtworks.xstream.io.AbstractDriver
getNameCoder
-
-
-
-
Constructor Detail
-
DomDriver
public DomDriver()
Construct a DomDriver.
-
DomDriver
public DomDriver(java.lang.String encoding)
Construct a DomDriver with a specified encoding. The created DomReader will ignore any encoding attribute of the XML header though.
-
DomDriver
public DomDriver(java.lang.String encoding, NameCoder nameCoder)- Since:
- 1.4
-
DomDriver
public DomDriver(java.lang.String encoding, XmlFriendlyReplacer replacer)Deprecated.As of 1.4, useDomDriver(String, NameCoder)instead.- Since:
- 1.2
-
-
Method Detail
-
createReader
public HierarchicalStreamReader createReader(java.io.Reader in)
Description copied from interface:HierarchicalStreamDriverCreate the HierarchicalStreamReader with the stream parser reading from the IO reader.- Parameters:
in- theReaderwith the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
public HierarchicalStreamReader createReader(java.io.InputStream in)
Description copied from interface:HierarchicalStreamDriverCreate the HierarchicalStreamReader with the stream parser reading from the input stream.- Parameters:
in- theInputStreamwith the data to parse
-
createReader
public HierarchicalStreamReader createReader(java.net.URL in)
Description copied from class:AbstractDriverCreate 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:
createReaderin interfaceHierarchicalStreamDriver- Overrides:
createReaderin classAbstractDriver- Parameters:
in- theURLdefining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
public HierarchicalStreamReader createReader(java.io.File in)
Description copied from class:AbstractDriverCreate 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:
createReaderin interfaceHierarchicalStreamDriver- Overrides:
createReaderin classAbstractDriver- Parameters:
in- theURLdefining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
private HierarchicalStreamReader createReader(org.xml.sax.InputSource source)
-
createWriter
public HierarchicalStreamWriter createWriter(java.io.Writer out)
Description copied from interface:HierarchicalStreamDriverCreate the HierarchicalStreamWriter with the formatted writer.- Parameters:
out- theWriterto receive the formatted data- Returns:
- the HierarchicalStreamWriter
-
createWriter
public HierarchicalStreamWriter createWriter(java.io.OutputStream out)
Description copied from interface:HierarchicalStreamDriverCreate the HierarchicalStreamWriter with the formatted writer.- Parameters:
out- theOutputStreamto receive the formatted data- Returns:
- the HierarchicalStreamWriter
-
createDocumentBuilderFactory
protected javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory()
Create the DocumentBuilderFactory instance.- Returns:
- the new instance
- Since:
- 1.4.9
-
-