Am trying to marshall a class that contains a List of Interface type. JAXB complains that he cannot handle interfaces.
class Myclass{
private List<MyInterface> list = new ArrayList<MyInterface>();
....
}
interface MyInterface{
get();
}
How can i annotate this so that jaxb can marshall an instance of MyClass class?
You can use the
@XmlElementannotation to provide the JAXB implementation with the concrete class that you want to use for that interface.For More Information