Pourquoi mon ArrayList n'est pas associé à JAXB?

Voici les cas d'utilisation:

@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"));
  }
}

Alors, je suis en train de faire:

JAXBContext ctx = JAXBContext.newInstance(Books.class);
Marshaller msh = ctx.createMarshaller();
msh.marshal(new Books(), System.out);

C'est ce que je vois:

<?xml version="1.0"?>
<books/>

Où sont mes livres? 🙂

source d'informationauteur yegor256