Here is the use case:
@XmlRootElement
public class Book {
public String title;
public Book(String t) {
this.title = t;
}
}
@XmlRootElement
@XmlSeeAlso({Book.class})
public class Books extends ArrayList<Book> {
public Books() {
this.add(new Book("The Sign of the Four"));
}
}
Then, I'm doing:
JAXBContext ctx = JAXBContext.newInstance(Books.class);
Marshaller msh = ctx.createMarshaller();
msh.marshal(new Books(), System.out);
This is what I see:
<?xml version="1.0"?>
<books/>
Where are my books? :)