In this blog post, we'll explore a topic which might be very interesting for some of you: low level parsing with Gson. In the past 25+ blog posts, we've reiterated that the best and bug-free way is to use as much automatic mapping as possible.
Nevertheless, in some cases, you need to do some mapping by yourself. We've used a few of these methods in the posts on custom (de)serializers. Now, we'll give a much broader introduction. No worries, Gson provides a few methods to make low level parsing easier and stable. If you're on board, we'll dive right in.
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
- 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