当前位置: 首页 > news >正文

Gson - 一个Java序列化/反序列化库

官网

GitHub - google/gson: A Java serialization/deserialization library to convert Java Objects into JSON and back

项目简介

一个Java序列化/反序列化库,用于将Java对象转换为JSON和返回JSON。

Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.

There are a few open-source projects that can convert Java objects to JSON. However, most of them require that you place Java annotations in your classes; something that you can not do if you do not have access to the source-code. Most also do not fully support the use of Java Generics. Gson considers both of these as very important design goals.

ℹ️ Gson is currently in maintenance mode; existing bugs will be fixed, but large new features will likely not be added. If you want to add a new feature, please first search for existing GitHub issues, or create a new one to discuss the feature and get feedback.

Goals

  • Provide simple toJson() and fromJson() methods to convert Java objects to JSON and vice-versa
  • Allow pre-existing unmodifiable objects to be converted to and from JSON
  • Extensive support of Java Generics
  • Allow custom representations for objects
  • Support arbitrarily complex objects (with deep inheritance hierarchies and extensive use of generic types)

Download

Gradle:

dependencies {implementation 'com.google.code.gson:gson:2.10.1'
}

Maven:

<dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>2.10.1</version>
</dependency>
http://www.lryc.cn/news/171051.html

相关文章:

  • 6-1 汉诺塔
  • Linux之initd管理系统(海思、ZYNQ、复旦微)添加密码登录验证
  • 怎么更改代理ip,代理ip如何切换使用?
  • 【C++从0到王者】第三十三站:AVL树
  • 手机机型响应式设置2
  • uni-app 之 解决u-button始终居中问题
  • Python日期处理库:掌握时间的艺术
  • JOSEF约瑟 智能电流继电器KWJL-20/L KWLD26 零序孔径45mm 柜内导轨式安装
  • NLP技术如何为搜索引擎赋能
  • 演唱会没买到票?VR直播为你弥补遗憾
  • myabtis的缓存级别
  • gin框架再探
  • 经典算法-----约瑟夫问题(C语言)
  • 代码随想录 动态规划Ⅴ
  • 驱动DAY9
  • 03贪心:摆动序列
  • javascript获取元素在浏览器中工作区域的左、右、上、下距离,或带滚动条的元素在页面中的大小
  • VSCode 安装使用教程 环境安装配置 保姆级教程
  • c盘中temp可以删除吗?appdata\local\temp可以删除吗?
  • Java手写聚类算法
  • 解密Java多线程中的锁机制:CAS与Synchronized的工作原理及优化策略
  • solid works草图绘制与设置零件特征的使用说明
  • vue3使用router.push()页面跳转后,该页面不刷新问题
  • 如何理解数字工厂管理系统的本质
  • 笔记1.3 数据交换
  • 实时车辆行人多目标检测与跟踪系统(含UI界面,Python代码)
  • 谷歌AI机器人Bard发布强大更新,支持插件功能并增强事实核查;全面整理高质量的人工智能、机器学习、大数据等技术资料
  • NI SCXI-1125 数字量控制模块
  • 链表oj题1(Leetcode)——移除链表元素,反转链表,链表的中间节点,
  • 【libuv】与uvgrtrp的_SSIZE_T_定义不同