I have two similar classes, that simply have a string name. I wanted to add an XML adapter to the Lists so that I could get a CSV string from each of them.
I tried to declare my adapter like so:
public class ListXmlAdapter extends XmlAdapter<String, ArrayList<Object>> {
But when I try to use this I get illegal annotation exceptions saying ListXmlAdapter is not applicable for whatever type I try to pass in at the annotation - such as Test below
@XmlElement
@XmlJavaTypeAdapter(ListXmlAdapter.class)
List<Test> tests = new ArrayList<Test>()
How would I create this adapter that I want to use for a few different ArrayLists of different object types I have?