I have old Pojos inside jar. Example;
public class human implements Serializable {
}
public class Man extend human {
}
public class Woman extend human {
}
I have json like {"type":"man",...}
I want to deserialize proper class using type But I cannot use these annotations because Base class generated automatically from xsd.
@JsonTypeInfo(// use = JsonTypeInfo.Id.NAME, // include = JsonTypeInfo.As.EXISTING_PROPERTY, // property = "queryType", // visible = true) @JsonSubTypes({ // @Type(value = ScenarioByCountryQuery.class, name = "scenarioByCountry"), // @Type(value = ScenarioByMeasureQuery.class, name = "scenarioByMeasure") })
I don want to desearlize like if type = '' etc. I want to deserialize dynamically using this type value.