Search code examples
javaconvertersxstream

How to choose the xstream converter


I have a entity like this:

public class MyEntity {

  public Map map1;

  public Map map2;
}

Using XStreams, I want to use the default map converter for map1 and my own map converter for map2. How can I do this?


Solution

  • Add an annotation in the field @XStreamConverter(MyOwnConverter.class) as shown here.