In this blog post, we'll combine the knowledge of two previous blog posts in one practical use case. You've learned how we can write custom deserializer and how you can annotate model classes with @JsonAdapter. In the next few sections, we'll use those to build a custom deserializer, which correctly sets a computed property field.
Of course, this will not be the only post in our Gson series. If you're interested in the other topics, check out our series outline:
Gson Series Overview
- Mapping of Enums
- Mapping of Circular References
- Generics
- Custom Serialization for Simplification (Part 1)
- Changing the Default Serialization with Custom Serialization (Part 2)
- Custom Deserialization Basics
- Custom Instance Creator
- Customizing (De)Serialization via @JsonAdapter
- Custom Deserialization for Calculated Fields
- On-The-Fly-Parsing With Streams
- ProGuard Configuration