I have these classes:
@XStreamAlias("person")
public class PersonConfig {
private AnimalConfig animalConfig;
}
public interface AnimalConfig {}
@XStreamAlias("dog");
public class DogConfig extend AnimalConfig {}
@XStreamAlias("cat");
public class CatConfig extend AnimalConfig {}
And I would like to be able to deserialize this xml with the classes above:
<person>
<dog/>
<person>
As well as deserialize this xml too, with the same classes:
<person>
<cat/>
<person>
So that in both cases, the PersonConfig
's field animalConfig
is filled. In the first XML with a DogConfig
instance and in the second XML with a CatConfig
instance.
Is this possible by adding some annotation to make this work?