Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What are the dependencies of the gson api?


Asked by John Garza on Dec 04, 2021 FAQ



Gson dependency --> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.2.4</version> </dependency> </dependencies> Gson is very powerful API and it supports Java Generics. Gson API also supports out of the box JSON to Java Object conversion if the object field names are same as in json.
Besides,
Clean JSON − Gson creates a clean and compact JSON result which is easy to read. No Dependency − Gson library does not require any other library apart from JDK. Open Source − Gson library is open source; it is freely available.
Also Know, Gson API also supports out of the box JSON to Java Object conversion if the object field names are same as in json. If we want to use different name for java bean and json, then we can use @SerializedName java annotation and map the variables in JSON and Java Class.
Furthermore,
Easy to use − Gson API provides a high-level facade to simplify commonly used use-cases. No need to create mapping − Gson API provides default mapping for most of the objects to be serialized. Performance − Gson is quite fast and is of low memory footprint. It is suitable for large object graphs or systems.
Indeed,
You can see how easy it is to use Gson and that’s why Gson is a very popular java API for JSON parsing. The above Gson example of JSON parsing is known as Object model because whole JSON is converted to object at once.