gson
收录 13 个版本 · 最新 gson-parent-2.15.0(2026年10月24日)
20262
These are some of the more important changes
When the java.time API is available, Gson automatically can read and write instances of classes like Instant and Duration. The format it uses essentially freezes the JSON representation that ReflectiveTypeAdapterFactory…
20255
The main changes in this release are just newer dependencies.
gson.fromJson(jsonString, new TypeToken>() {})
The only difference between this release and 2.12.0 is that OSGi declarations in the Gson jar now specify that com.google.errorprone.annotations is an optional dependency, not a required one. If you do not use OSGi then…
The biggest change is that we no longer support Java 7. People who still need to run on Java 7 will need to use an earlier version of Gson.
20241
If you are using ProGuard or R8 (for example for Android projects) you might not need any special Gson configuration anymore if your classes have a no-args constructor and use @SerializedName for their fields.
20231
This is technically a minor release rather than a patch release because there is one small API change: a new JsonObject.isEmpty() method.
20223
Also many small improvements to javadoc.
The minimum supported Java version changes from 6 to 7.
未标日期1
Gson是一个由Google开发的Java库,用于将Java对象转换为JSON格式,反之亦然。它提供了一种简单而高效的方式来处理JSON数据,支持复杂的数据结构和自定义对象的序列化与反序列化。