I have a class as below
class Manager {
String name = "";
ArrayList events = new ArrayList();
}
events can contain different class types depends on the situation. For example, it could contain events of type ClassA or ClassB or ClassC. But only one class type at a time. It does not contain ClassA AND ClassB but either ClassA OR ClassB at a time.
What I have is an instance of Class Manager. I don't know what class type is in events field. What I want back is an XML string of the content of events.
What design pattern can I use in this case?
Thanks











