com.google.gson
Class ObjectMapTypeAdapter
java.lang.Object
com.google.gson.ObjectMapTypeAdapter
- All Implemented Interfaces:
- com.google.gson.JsonDeserializer<Map<?,?>>, com.google.gson.JsonSerializer<Map<?,?>>
public final class ObjectMapTypeAdapter
- extends Object
Default serialization and deserialization of a map type. This implementation really only works
well with simple primitive types as the map key. If the key is not a simple primitive then the
object is toString
ed and that value is used as its key.
Patched depending on this
- Author:
- Joel Leitch
ObjectMapTypeAdapter
public ObjectMapTypeAdapter()
serialize
public com.google.gson.JsonElement serialize(Map src,
Type typeOfSrc,
com.google.gson.JsonSerializationContext context)
deserialize
public Map deserialize(com.google.gson.JsonElement json,
Type typeOfT,
com.google.gson.JsonDeserializationContext context)
throws com.google.gson.JsonParseException
- Throws:
com.google.gson.JsonParseException
toString
public String toString()
- Overrides:
toString
in class Object
serialize
protected static final com.google.gson.JsonElement serialize(com.google.gson.JsonSerializationContext arg0,
Object arg1,
Type arg2)
constructMapType
protected static final Map<Object,Object> constructMapType(Type arg0,
com.google.gson.JsonDeserializationContext arg1)
Copyright © 2009-2011 jclouds. All Rights Reserved.