How to marshal/unmarshal Java objects with private fields using JAXB
问题 I know the basics of the JAXB API, but I am stuck with something I am trying to do, and I am not sure whether it is actually possible. Details are as follows: I have a class called Book with 2 public instance variables of type String: @XmlRootElement(name="book") public class Book { public String title; public String author; public Book() { } } I have a another class called Bookshop with 1 public instance variable of type ArrayList: @XmlRootElement(name="bookshop") public class Bookshop {