Make a collection generic in javax.xml.bind
问题 In a REST server that I've written, I have several collection classes that wrap single items to be returned from my services: @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "person_collection") public final class PersonCollection { @XmlElement(name = "person") protected final List<Person> collection = new ArrayList<Person>(); public List<Person> getCollection() { return collection; } } I would like to refactor these to use generics so the the boilerplate code can be implemented