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...

ความคิดเห็น • 8

  • @airman5461
    @airman5461 4 หลายเดือนก่อน

    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

  • @PurpleWarlock
    @PurpleWarlock 5 หลายเดือนก่อน

    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.

    • @discospiff
      @discospiff  5 หลายเดือนก่อน +1

      What was your favorite video?

    • @PurpleWarlock
      @PurpleWarlock 5 หลายเดือนก่อน

      ​@@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.

    • @PurpleWarlock
      @PurpleWarlock 5 หลายเดือนก่อน

      I mean, I'm mystified by the process.

  • @jaasist
    @jaasist ปีที่แล้ว

    How to parse JSON if an element is coming as jsonobject sometime and jsonarray sometime

  • @hubstrangers3450
    @hubstrangers3450 ปีที่แล้ว

    Thanks....

    • @discospiff
      @discospiff  ปีที่แล้ว

      You're welcome! Thanks for watching.