de.netseeker.ejoe.adapter.json
Class XStreamJsonAdapter

java.lang.Object
  extended by de.netseeker.ejoe.adapter.BaseAdapter
      extended by de.netseeker.ejoe.adapter.XStreamAdapter
          extended by de.netseeker.ejoe.adapter.json.XStreamJsonAdapter
All Implemented Interfaces:
SerializeAdapter, java.io.Serializable

public class XStreamJsonAdapter
extends XStreamAdapter

Write-only SerializeAdapter supporting JSON. Uses XSteam for writing out Objects to JSON but can't deserialize JSON requests to Objects. It does just return the JSON strings on read operations.

Since:
0.3.9.1
Author:
netseeker
See Also:
XStream, Serialized Form

Field Summary
 
Fields inherited from class de.netseeker.ejoe.adapter.XStreamAdapter
_xstream
 
Constructor Summary
XStreamJsonAdapter()
          Creates a new instance of this adapter.
 
Method Summary
 java.lang.String getContentType()
           
 java.lang.Object read(java.io.InputStream in)
          Deserializes an object out of an given InputStream
 
Methods inherited from class de.netseeker.ejoe.adapter.XStreamAdapter
handleClassLoaderChange, write
 
Methods inherited from class de.netseeker.ejoe.adapter.BaseAdapter
isSelfBuffered, requiresCustomEOFHandling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStreamJsonAdapter

public XStreamJsonAdapter()
Creates a new instance of this adapter. The instance will use XStreams JsonHierarchicalStreamDriver for serializing abitary objects to JSON.

Method Detail

read

public java.lang.Object read(java.io.InputStream in)
                      throws java.lang.Exception
Description copied from interface: SerializeAdapter
Deserializes an object out of an given InputStream

Specified by:
read in interface SerializeAdapter
Overrides:
read in class XStreamAdapter
Parameters:
in - the input stream to use for deserialization
Returns:
a deserialized object instance
Throws:
java.lang.Exception

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface SerializeAdapter
Overrides:
getContentType in class XStreamAdapter
Returns:
A recognized mime type
See Also:
mime type list of IANA


Copyright © 2005-2007 netseeker. All Rights Reserved.