|
Size: 1136
Comment:
|
← Revision 8 as of 2026-02-21 18:11:41 ⇥
Size: 1094
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 19: | Line 19: |
| To use this annotation, you must create Gson by using new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(). The Gson instance created will exclude all fields in a class that are not marked with @Expose annotation. | To use this annotation, you must create Gson by using the code snippet below. The Gson instance created will exclude all fields in a class that are not marked with @Expose annotation. |
Gson
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.
Maven
@Expose annotation
To use this annotation, you must create Gson by using the code snippet below. The Gson instance created will exclude all fields in a class that are not marked with @Expose annotation.
1 GSON gson = new GsonBuilder.excludeFieldsWithoutExposeAnnotation().create()
@SerializedName annotation
Sets the field name in the serialized JSON.
