org.jclouds.json.internal
Class GsonWrapper

java.lang.Object
  extended by org.jclouds.json.internal.GsonWrapper
All Implemented Interfaces:
Json

@Singleton
public class GsonWrapper
extends Object
implements Json

Author:
Adrian Cole

Constructor Summary
GsonWrapper(com.google.gson.Gson gson)
           
 
Method Summary
<T> T
fromJson(String json, Class<T> classOfT)
          Deserialize the object from json.
<T> T
fromJson(String json, Type type)
          Deserialize the generic object from json.
 String toJson(Object src)
          Serialize the object into json.
 String toJson(Object src, Type type)
          Serialize the generic object into json.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GsonWrapper

@Inject
public GsonWrapper(com.google.gson.Gson gson)
Method Detail

fromJson

public <T> T fromJson(String json,
                      Type type)
Description copied from interface: Json
Deserialize the generic object from json. If the object is not a generic type, use #fromJson(Object, Class)

Specified by:
fromJson in interface Json

fromJson

public <T> T fromJson(String json,
                      Class<T> classOfT)
Description copied from interface: Json
Deserialize the object from json. If the object is a generic type, use #fromJson(Object, Type)

Specified by:
fromJson in interface Json

toJson

public String toJson(Object src)
Description copied from interface: Json
Serialize the object into json. If the object is a generic type, use Json.toJson(Object, Type)

Specified by:
toJson in interface Json

toJson

public String toJson(Object src,
                     Type type)
Description copied from interface: Json
Serialize the generic object into json. If the object is not a generic, use Json.toJson(Object, Type)

Specified by:
toJson in interface Json


Copyright © 2009-2011 jclouds. All Rights Reserved.