cn.tom.kit.json.JsonUtil Maven / Gradle / Ivy
package cn.tom.kit.json;
import cn.tom.mvc.core.CocookException;
public class JsonUtil {
static Jsonable json = null;
static {
try {
json = new FastJson();
} catch (Exception e) {
throw new CocookException(e);
}
}
public static String serialize(Object obj) {
return json.serialize(obj);
};
public static byte[] serializeToBytes(Object obj) {
return json.serializeToBytes(obj);
};
public static Object deserialize(String _json) {
return json.deserialize(_json);
};
public static T deserialize(String _json, Class clazz){
return json.deserialize(_json, clazz);
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy