org.jclouds.json.internal
Class GsonWrapper

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by org.jclouds.json.internal.GsonWrapper
All Implemented Interfaces:
Json

@Singleton
public class GsonWrapper
extends com.google.common.collect.ForwardingObject
implements Json

Author:
Adrian Cole

Constructor Summary
GsonWrapper(com.google.gson.Gson gson)
           
 
Method Summary
 com.google.gson.Gson delegate()
           
<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 com.google.common.collect.ForwardingObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

delegate

public com.google.gson.Gson delegate()
Specified by:
delegate in class com.google.common.collect.ForwardingObject


Copyright © 2009-2012 jclouds. All Rights Reserved.