Package com.thoughtworks.xstream.io.json
Class JsonHierarchicalStreamDriver
java.lang.Object
com.thoughtworks.xstream.io.AbstractDriver
com.thoughtworks.xstream.io.json.JsonHierarchicalStreamDriver
- All Implemented Interfaces:
HierarchicalStreamDriver
A driver for JSON that writes optimized JSON format, but is not able to deserialize the result.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a JsonHierarchicalStreamDriver.JsonHierarchicalStreamDriver
(NameCoder nameCoder) Construct a JsonHierarchicalStreamDriver with name coding. -
Method Summary
Modifier and TypeMethodDescriptioncreateReader
(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 in) 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 a HierarchicalStreamWriter that writes JSON.Methods inherited from class com.thoughtworks.xstream.io.AbstractDriver
getNameCoder
-
Constructor Details
-
JsonHierarchicalStreamDriver
public JsonHierarchicalStreamDriver()Construct a JsonHierarchicalStreamDriver. -
JsonHierarchicalStreamDriver
Construct a JsonHierarchicalStreamDriver with name coding.- Parameters:
nameCoder
- the coder to encode and decode the JSON labels.- Since:
- 1.4.2
-
-
Method Details
-
createReader
Description copied from interface:HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the IO reader.- Parameters:
in
- 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
-
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
-
createWriter
Create a HierarchicalStreamWriter that writes JSON.- 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
-