java - Jackson type resolving for heterogeneous data -


i have data :

[    {    "type":"animal"    "numlegs":4   }, {    "type":"car"    "country":"usa"   } ] 

i want parsed following classes :

public class animal {     int numlegs; }  public class car {     string country; } 

what best way tell jackson class type based on value of property in jsonobject?

i have went through lot of examples talks using jsontypeinfo , jsonsubtypes annotation doesn't fit here there no abstract class common both objects.

any appreciated.


Comments