com.thoughtworks.xstream.io.json
Class JettisonMappedXmlDriver

java.lang.Object
  extended by com.thoughtworks.xstream.io.AbstractDriver
      extended by com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver
All Implemented Interfaces:
HierarchicalStreamDriver

public class JettisonMappedXmlDriver
extends AbstractDriver

Simple XStream driver wrapping Jettison's Mapped reader and writer. Serializes object from and to JSON.

Author:
Dejan Bosanac

Constructor Summary
JettisonMappedXmlDriver()
          Construct a JettisonMappedXmlDriver.
JettisonMappedXmlDriver(org.codehaus.jettison.mapped.Configuration config)
          Construct a JettisonMappedXmlDriver with configuration.
JettisonMappedXmlDriver(org.codehaus.jettison.mapped.Configuration config, boolean useSerializeAsArray)
          Construct a JettisonMappedXmlDriver with configuration.
 
Method Summary
 HierarchicalStreamReader createReader(File in)
          Create the HierarchicalStreamReader with the stream parser reading from a File.
 HierarchicalStreamReader createReader(InputStream input)
          Create the HierarchicalStreamReader with the stream parser reading from the input stream.
 HierarchicalStreamReader createReader(Reader reader)
          Create the HierarchicalStreamReader with the stream parser reading from the IO reader.
 HierarchicalStreamReader createReader(URL in)
          Create the HierarchicalStreamReader with the stream parser reading from a URL.
 HierarchicalStreamWriter createWriter(OutputStream output)
          Create the HierarchicalStreamWriter with the formatted writer.
 HierarchicalStreamWriter createWriter(Writer writer)
          Create the HierarchicalStreamWriter with the formatted writer.
 
Methods inherited from class com.thoughtworks.xstream.io.AbstractDriver
getNameCoder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettisonMappedXmlDriver

public JettisonMappedXmlDriver()
Construct a JettisonMappedXmlDriver.


JettisonMappedXmlDriver

public JettisonMappedXmlDriver(org.codehaus.jettison.mapped.Configuration config)
Construct a JettisonMappedXmlDriver with configuration.

Parameters:
config - the Jettison configuration

JettisonMappedXmlDriver

public JettisonMappedXmlDriver(org.codehaus.jettison.mapped.Configuration config,
                               boolean useSerializeAsArray)
Construct a JettisonMappedXmlDriver with configuration. This constructor has been added by special request of Jettison users to support JSON generated by older Jettison versions. if the driver is setup to ignore the XStream hints for JSON arrays, there is neither support from XStream's side nor are there any tests to ensure this mode.

Parameters:
config - the Jettison configuration
useSerializeAsArray - flag to use XStream's hints for collections and arrays
Since:
1.4
Method Detail

createReader

public HierarchicalStreamReader createReader(Reader reader)
Description copied from interface: HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the IO reader.

Parameters:
reader - the Reader with the data to parse
Returns:
the HierarchicalStreamReader

createReader

public HierarchicalStreamReader createReader(InputStream input)
Description copied from interface: HierarchicalStreamDriver
Create the HierarchicalStreamReader with the stream parser reading from the input stream.

Parameters:
input - the InputStream with the data to parse

createReader

public HierarchicalStreamReader createReader(URL in)
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 interface HierarchicalStreamDriver
Overrides:
createReader in class AbstractDriver
Parameters:
in - the URL defining the location with the data to parse
Returns:
the HierarchicalStreamReader

createReader

public HierarchicalStreamReader createReader(File in)
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 interface HierarchicalStreamDriver
Overrides:
createReader in class AbstractDriver
Parameters:
in - the URL defining the location with the data to parse
Returns:
the HierarchicalStreamReader

createWriter

public HierarchicalStreamWriter createWriter(Writer writer)
Description copied from interface: HierarchicalStreamDriver
Create the HierarchicalStreamWriter with the formatted writer.

Parameters:
writer - the Writer to receive the formatted data
Returns:
the HierarchicalStreamWriter

createWriter

public HierarchicalStreamWriter createWriter(OutputStream output)
Description copied from interface: HierarchicalStreamDriver
Create the HierarchicalStreamWriter with the formatted writer.

Parameters:
output - the OutputStream to receive the formatted data
Returns:
the HierarchicalStreamWriter


Copyright © 2004-2014 XStream. All Rights Reserved.