![]() ![]() Older Gson versions may also support lower API levels, however this has not been verified. Unsafe is not available in all environments and its usage has some pitfalls, However, care should be taken when relying on this. When this module is present, Gson can use the Unsafe class to create instances of classes without no-args constructor. Jdk.unsupported, respectively class (optional) When this module is present, Gson provides default adapters for some SQL date and time classes. This only applies when running Java 9 or newer. ![]() These are the optional Java Platform Module System (JPMS) JDK modules which Gson depends on. Gson jar downloads are available from Maven Central.ĭespite supporting older Java versions, Gson also provides a JPMS module descriptor (module name ) for users of Java 9 or newer. Support arbitrarily complex objects (with deep inheritance hierarchies and extensive use of generic types).Allow custom representations for objects.Allow pre-existing unmodifiable objects to be converted to and from JSON.Provide simple toJson() and fromJson() methods to convert Java objects to JSON and vice-versa.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. ℹ️ Gson is currently in maintenance mode existing bugs will be fixed, but large new features will likely not be added. Gson considers both of these as very important design goals. Most also do not fully support the use of Java Generics. 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. There are a few open-source projects that can convert Java objects to JSON. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of. It can also be used to convert a JSON string to an equivalent Java object. Gson is a Java library that can be used to convert Java Objects into their JSON representation. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |