Package com.thoughtworks.xstream.io
Class AbstractDriver
- java.lang.Object
-
- com.thoughtworks.xstream.io.AbstractDriver
-
- All Implemented Interfaces:
HierarchicalStreamDriver
- Direct Known Subclasses:
AbstractXmlDriver
,BinaryStreamDriver
,JsonHierarchicalStreamDriver
public abstract class AbstractDriver extends java.lang.Object implements HierarchicalStreamDriver
Abstract base class for all HierarchicalStreamDriver implementations. Implementations ofHierarchicalStreamDriver
should rather be derived from this class then implementing the interface directly.- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor Description AbstractDriver()
Creates an AbstractDriver with a NameCoder that does nothing.AbstractDriver(NameCoder nameCoder)
Creates an AbstractDriver with a providedNameCoder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HierarchicalStreamReader
createReader(java.io.File in)
Create the HierarchicalStreamReader with the stream parser reading from a File.HierarchicalStreamReader
createReader(java.net.URL in)
Create the HierarchicalStreamReader with the stream parser reading from a URL.protected NameCoder
getNameCoder()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.thoughtworks.xstream.io.HierarchicalStreamDriver
createReader, createReader, createWriter, createWriter
-
-
-
-
Field Detail
-
replacer
private NameCoder replacer
-
-
Method Detail
-
getNameCoder
protected NameCoder getNameCoder()
-
createReader
public HierarchicalStreamReader createReader(java.net.URL in)
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
- Parameters:
in
- theURL
defining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
createReader
public HierarchicalStreamReader createReader(java.io.File in)
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
- Parameters:
in
- theURL
defining the location with the data to parse- Returns:
- the HierarchicalStreamReader
-
-