Convert Java to JSON & JSON to Java Object | Parse JSON in Java | ObjectMapper in Jackson API

Sdílet
Vložit
  • čas přidán 25. 04. 2020
  • This tutorial explains, how to convert a JSON into Java object and Java object into JSON string.
    This process of converting a Java Object to JSON is known as Serialization & the reverse process is de-serialization.
    It needs below dependency in your dependency management:
    groupId : com.fasterxml.jackson.core
    artifactId : jackson-databind
    version : 2.9.8
    Please follow the tutorial for the implementation of the same and how to write a Java program for it.

Komentáře • 49

  • @atulchavan4330
    @atulchavan4330 Před 3 lety +2

    thanks a lot for this very well explained tutorial.

  • @anonymouslabz5124
    @anonymouslabz5124 Před 2 lety +2

    Very well explained... Thanks:)

  • @ganvads
    @ganvads Před 3 lety +2

    great Explanation with simple example - Thanks buddy

  • @namannagar422
    @namannagar422 Před rokem +1

    very well explained. thanks.

  • @Sushil2874
    @Sushil2874 Před 3 lety +1

    Thank you.!
    Very well explained.

  • @lordgreat6051
    @lordgreat6051 Před 2 lety +1

    Very well explained

  • @johnwesley4162
    @johnwesley4162 Před rokem

    Thanks for this wonderful presentation :-) It helped me a lot !

  • @mdnazeer6025
    @mdnazeer6025 Před 3 lety

    thank you very much sir.

  • @manashranjan1267
    @manashranjan1267 Před rokem +1

    Thanks very much today my dought got clear

  • @vrindagoyal
    @vrindagoyal Před 2 lety +1

    Awesome 👍

  • @hitenarya4987
    @hitenarya4987 Před 3 lety +1

    Really liked this video

  • @Indian-km4gk
    @Indian-km4gk Před rokem +1

    Nice tutorial

  • @shubhamsharma-mt4hs
    @shubhamsharma-mt4hs Před 3 lety +3

    How do we handle nested json ?

  • @WickedChild95
    @WickedChild95 Před 2 lety

    Good video!

  • @AnuragKumar-zm2lp
    @AnuragKumar-zm2lp Před rokem +1

    informative video

  • @Vithal_Nivargi
    @Vithal_Nivargi Před 2 lety +1

    nice Explainned

  • @theLastOneTaken
    @theLastOneTaken Před rokem +1

    Thanks😊😊

  • @amirmalla1533
    @amirmalla1533 Před rokem +1

    Thanks

  • @zr60
    @zr60 Před 2 lety

    what about multiple nested strings?

  • @geetusoni7045
    @geetusoni7045 Před 3 lety

    if have a json string in that case how do i convert it to list of class object help please

  • @rahulsolanki__
    @rahulsolanki__ Před 2 lety

    what if one of the field in employee class is Array ?
    How will you extract it from json using JsonNode ???

  • @jonsantos6056
    @jonsantos6056 Před rokem +1

    11:14 reverse JSON

  • @vishwjeetujgare7437
    @vishwjeetujgare7437 Před 2 lety

    can use this library with core java to store Hashmap data into MySQL databases and also retrieve it from the database can we do that...if yes how and if no why sir

  • @xojiakbarabiyorov4998

    if i hava an arraylist in Employee class ?

  • @MemescapeHQ
    @MemescapeHQ Před 2 lety

    it was good but what about the objects and arrays in the JSON

  • @AnuragKumar-zm2lp
    @AnuragKumar-zm2lp Před rokem +1

    learn by doing

  • @jayanthrangappaigtb9587

    i want same in Servlet -- how to handle JSON request and response in servlet with jackson +jersey in JBoss

  • @renejacques8288
    @renejacques8288 Před rokem

    How is your video compared to Jsoup?

  • @rajeevmishra3056
    @rajeevmishra3056 Před 2 lety

    If we are getting ResponseEntity response ….
    Now how we can convert this response as json object

    • @SwatechTalks
      @SwatechTalks  Před 2 lety +1

      There can be multiple ways.. one is using the google gson library. You can use below reference:
      import com.google.gson.Gson;
      ResponseEntity.ok(gson.toJson(""));

  • @abhishekmishra2195
    @abhishekmishra2195 Před rokem

    What happens if we give int instead of string in json string and then try to deserialize it?

    • @SwatechTalks
      @SwatechTalks  Před rokem

      what so ever datatype you pass, data should also be of the same type. if this is the case then it can deserialize else it would give type mismatch error

  • @mdnazeer6025
    @mdnazeer6025 Před 3 lety +2

    hello sir,
    please show, how to produce json with nested object.
    {
    "empName" : "john",
    "address" : {
    "City" : "LA",
    " Country" :"US"
    }
    }

  • @MrRahulKumarKandula
    @MrRahulKumarKandula Před 2 lety

    Thanks for making me understand ObjectMapper. But why would you use the ObjectMapper class to write to a text file. You could have used any other writer class. Having said that thanks though.

    • @SwatechTalks
      @SwatechTalks  Před 2 lety +1

      Thats just a example.. intention was to showcase object mapper use and not how to write data in file. Once you have your serialised version of json data you can do anything it .. here in this tutorial i wrote that in file. Thats it.. Thanks

    • @MrRahulKumarKandula
      @MrRahulKumarKandula Před 2 lety +1

      @@SwatechTalks Got it. Thanks again.

  • @TechTalksbyRanga
    @TechTalksbyRanga Před 10 měsíci

    Hey, I need to get json data from postman and need to insert that json to jasper report "Fields". How do I do that?

    • @SwatechTalks
      @SwatechTalks  Před 10 měsíci

      are you calling any rest endpoint through postman?

    • @TechTalksbyRanga
      @TechTalksbyRanga Před 10 měsíci

      Yes. Do I need to assign that postman json to variables?@@SwatechTalks

    • @SwatechTalks
      @SwatechTalks  Před 10 měsíci

      not really.. see if you can call the endpoint through jasper and use the response

    • @TechTalksbyRanga
      @TechTalksbyRanga Před 10 měsíci

      Do you have a video about this? Can I use any data adapter in jasper studio to create the jrxml file? I am stuck here since 3 days.@@SwatechTalks

    • @SwatechTalks
      @SwatechTalks  Před 10 měsíci

      I dont have knowledge on jasper my friend.. but it should be possible to create a pipeline where you configure your jasper report to fetch data from rest endpoint and then put it in fields.. see if you have some sort of ETL in jasper

  • @hamzaalicetin1717
    @hamzaalicetin1717 Před rokem +1

    Sblm