Stephan Koops <Stephan.Koops <at> web.de> writes:
>
> Hello,
>
> can anybody tell me how to serialize a Collection of JAXB serializable
> Objects? I found nothing at Google.
>
> thank you
> Stephan
>
>
With wrapper class that has a field containing your collection.
But actually its not a question for restlet user mailing list :)
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@XmlRootElement
public class Cards implements Serializable {
private List<Integer> cards = new ArrayList<Integer>();
@XmlElement(name = "card")
public List<Integer> getCards() {
return cards;
}
public void setCards(List<Integer> cards) {
this.cards = cards;
}
}