org.jboss.seam.social
Class JsonMapper

java.lang.Object
  extended by org.jboss.seam.social.JsonMapper
All Implemented Interfaces:
Serializable

@ApplicationScoped
public class JsonMapper
extends Object
implements Serializable

This Bean manage the Json Mapper to serialize and de-serialize Json data coming from and sent to services It uses an ObjectMapper Jackson.

Author:
Antoine Sabot-Durand
See Also:
Serialized Form

Constructor Summary
JsonMapper()
           
 
Method Summary
<T> T
readValue(RestResponse resp, Class<T> clazz)
          Parse the content of the provided RestResponse to de-serialize to an object of the given Class
 void registerModule(org.codehaus.jackson.map.Module module)
          Register a Jackson configuration Module to set special rules for de-serialization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonMapper

public JsonMapper()
Method Detail

readValue

public <T> T readValue(RestResponse resp,
                       Class<T> clazz)
Parse the content of the provided RestResponse to de-serialize to an object of the given Class

Parameters:
resp - the response to de-serialize
clazz - the target class of the object
Returns:
an object of the given Class with fields comming from the response

registerModule

public void registerModule(org.codehaus.jackson.map.Module module)
Register a Jackson configuration Module to set special rules for de-serialization

Parameters:
module - to register


Copyright © 2011 Seam Framework. All Rights Reserved.