I have a class that implements java.util Collection interface and I want to have a custom XML marshalling using jax-b.
When I try to use an XmlAdapter, it's ignored and jax-b uses the default behavior for collection.
If I remove implements Collection, jax-b uses my adapter.
Following code doesn't work:
@XmlJavaTypeAdapter(value = MyAdapter.class)
public class MyClassCollection implements Collection<MyClass> {
...
}
Following code works (but doesn't implement Collection):
@XmlJavaTypeAdapter(value = MyAdapter.class)
public class MyClassCollection {
...
}
Does someone have an idea on how to use MyAdapter.class with a class that implements Collection?
Thanks in advance!