Add SubType information at runtime using Jackson for polymorphism
问题 I am using Jackson to unmarshal polymorphic types from JSON. I am using the @JsonTypeInfo , @JsonSubTypes , and @JsonTypeName annotations similar to Example 4 in this post. My question is, say now I need someone else to extend my code and add a 3rd class: public class Duck extends Animal outside of the original code base. How can I (or the others) add the SubType information without modifying the source code (annotation) of the public abstract Animal class ? UPDATE: I am forced to use