package io.rong.util;

import java.io.Reader;
import java.lang.reflect.Type;

import com.google.gson.Gson;

public class GsonUtil {

	private static Gson gson = new Gson();
	
	

	public static String toJson(Object obj, Type type) {		
		return gson.toJson(obj, type);		
	}		
	
	public static Object fromJson(String str,Type type){
		return gson.fromJson(str, type);
	}
	
	public static Object fromJson(Reader reader,Type type){
		return gson.fromJson(reader, type);
	}
}  

@@ -99,16 +99,52 @@
 on.Gson;
+%0Aimport com.google.gson.GsonBuilder;
 %0A%0Apublic
@@ -202,15 +202,49 @@
 Gson
-();%0A%09%0A%09
+Builder().disableHtmlEscaping().create();
 %0A%0A%09p
@@ -294,18 +294,16 @@
  type) %7B
-%09%09
 %0A%09%09retur
@@ -331,17 +331,12 @@
 pe);
-%09%09
 %0A%09%7D
-%09%09%0A%09
+%0A
 %0A%09pu
@@ -374,16 +374,17 @@
 ing str,
+ 
 Type typ
@@ -377,32 +377,33 @@
  str, Type type)
+ 
 %7B%0A%09%09return gson.
@@ -426,17 +426,16 @@
 pe);%0A%09%7D%0A
-%09
 %0A%09public
@@ -472,16 +472,17 @@
  reader,
+ 
 Type typ
@@ -483,16 +483,17 @@
 pe type)
+ 
 %7B%0A%09%09retu
@@ -532,7 +532,5 @@
 %09%7D%0A%7D
-  
 %0A

修改 gson 将 == 转码bug