java - Jackson Polymorphic Deserialization in Maps -
In the former cases, I have been hosted by the use of Jackson (Jackson 1.9, Kodehaus) format Bhulorfik Dharawahikkrn To sort the list of Where I have tried some things, along with the rapper implementation of the map ( I have everything annotated Well, that included, there is a lot to do The easiest thing is. Let's say you're POJOs When I run the following test harness: Based on some docs, it seems that I may need to implement custom desililizers.
{"className": " Index "," id ": 0," fields ": {" classname ":" fieldmap "," df12 ": {" className ":" customing type "," value ":" ra Lf "}}}
fieldmap
). Whenever I try to deserialize it, then I 'ID' custom Metatip type 'Maibsetaip "can not be solved type id subtypes
< / p> JsonTypeInfo
and JsonSubType
@JsonTypeInfo (using included = JsonTypeInfo.Id.NAME, or = JsonTypeInfo.As.PROPERTY, property = "className") @ Jesnignorproprtij (Andekhaagyat = true) Public Sector Index Records {Private Ent ID; @JsonTypeInfo (use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "classname") Private map & lt; String, index value & gt; Farm; } @JsonTypeInfo (use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className") @ Jesninjorproprtijh (Andekhaagyat = true) @ Jesntaipanam ( "Anukrmnikawu") public class Index {private String value; }
index index indexRecord = new index record (); Index value iv = new index value (); Iv.setValue ("Ralph"); . IndexRecord.getFields () put ("foo" iv); ObjectMaper ohm = new objectMap (); String data = om.writeValueAsString (indexRecord); System.out.println ("data is" + data); Index results = om.readValue (Data, IndexRecord.class);
Comments
Post a Comment