Java 的 JSON 操作類庫,Genson 0.94 發布
Genson 是一個輕量級的 Java 庫用來處理 JSON 數據,提供了完全的數據綁定和 Java 泛型支持。
Genson 0.94 支持友好格式打印,spring mvc 集成和一些新的默認轉換器,可序列化包含毫秒的日期時間,增強對流處理的異常和錯誤。
示例代碼:
Genson genson = new Genson(); String json = genson.serialize(777.777); // the output will be 777.777 genson.serialize(true); // output is true (without quotes) genson.deserialize("777", int.class); // deserializes it into 777 genson.deserialize("777.777", Object.class); // will return 777.777 (a double) genson.deserialize("null", Object.class); // will return null;
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!