Overview, I have an abstract class from which three concrete classes inherit.
public abstract class A {}
public class B extends A {}
public class C extends A {}
public class D extends A {
private List<A> children;
}
Main point is that concrete class D has a list that could contain objects of concrete class B, C or D.
My challenge is how to serialize D given that its children could be of three different types; itself or the two other concrete classes. I have a working custom serializer that works if all the children are of the same type. Not looking for a full blown solution, a high level approach or strategy will be fine. Thanks.