Simple Example of JSON with GSON and JsonDeserializer
ฝัง
- เผยแพร่เมื่อ 30 ต.ค. 2024
- Create JSON from Java objects and store the JSON into a file. I use Gson, GsonBuilder, JsonSerializer,JsonDeserializer, TypeToken, PrintWriter, Stream, BufferedStream, and a set of Java DTOs that I want to use to create JSON. First I write the objects to a file, then I read the file and create objects from the JSON data.
Source code is freely available on GitHub at github.com/dis...
Good and explanatory video, the only issue I find, or Maybe I got wrong, is that when deserializing, for example, if I want to use that deserializer in a list of classes, lest say, [Bananas, Apples and Fruit] where Apples and Bananas Inherit from fruit, the usage of the jsonDeserializerContext.deserialize will create a Loop, since the list containing Fruit, and we are doing a call to deserialize a Fruit inside our Fruit Deserializer. But, afar from that, stills being an excellent tutorial
Thank you very much. Today I finally finished watching all the videos and following along coding.
Hope this helps me in my career. There is an OOP-shaped in my soul. :P
I think gonna give another try to your Jetpack Compose tutorial.
Now, onto that final git commit. Thank you.
What was your favorite video?
@@discospiff Hard question. Gonna go with the Swing section.
But the Interfaces section shines with the myriad of Data Structures available. Usually a coder only needs a few methods.
Hope you can touch on Oracle's certification process on future series.
Not to turn all that into a playlist. Rather a "this is what you need to master to take it to the next level" when it comes to Java.
I mean, I'm mystified by the process.
How to parse JSON if an element is coming as jsonobject sometime and jsonarray sometime
Thanks....
You're welcome! Thanks for watching.