|
|
@ -23,7 +23,6 @@ public class GsonProvider extends AbstractJsonProvider { |
|
|
|
private static final JsonParser parser = new JsonParser(); |
|
|
|
private static final JsonParser parser = new JsonParser(); |
|
|
|
private static final Gson gson = new Gson(); |
|
|
|
private static final Gson gson = new Gson(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Object unwrap(Object o){ |
|
|
|
public Object unwrap(Object o){ |
|
|
|
if(o == null){ |
|
|
|
if(o == null){ |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -90,7 +89,7 @@ public class GsonProvider extends AbstractJsonProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String toJson(Object obj) { |
|
|
|
public String toJson(Object obj) { |
|
|
|
return ((JsonElement)obj).toString(); |
|
|
|
return obj.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -113,6 +112,7 @@ public class GsonProvider extends AbstractJsonProvider { |
|
|
|
return toJsonArray(obj).get(idx); |
|
|
|
return toJsonArray(obj).get(idx); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object getMapValue(Object obj, String key) { |
|
|
|
public Object getMapValue(Object obj, String key) { |
|
|
|
Object o = toJsonObject(obj).get(key); |
|
|
|
Object o = toJsonObject(obj).get(key); |
|
|
@ -140,7 +140,6 @@ public class GsonProvider extends AbstractJsonProvider { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
array.set(index, toJsonElement(value)); |
|
|
|
array.set(index, toJsonElement(value)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|