Mapping json data to two different entities in java using jackson -


I am using Jackson libraries in Java.

I have to follow the JSON structure. "Time": "Asia / Calcutta", "Timestamp": "29 /", "By:", "By": "Manual", "Flo": 524, 09/14 15: 50: 00 "}

I have two entities, Data Entity and time lapse

  class data entry {string divive; String bye; Int flow; } Class TimeInternet {String Time Zone; String timetamp; }  

How can Jason String map up to different institutions i.e. DataInteity and TimeTyT? I'm using ObjectMaper class.

You have to annotate your classes with @JesenEngorProperties (undiscovered = true).

After that:

  ObjectMapper Mapper = New ObjectMap (); DataType DataInty = Mapper Read value (json, dontty. Class); TimeAntit TimeInti = Mapper Reed Value (Jason, Time Entity Class);  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -