Answer by Ashish Shetkar for How to annotate a list using @XmlElement?
Above answer by - Blaise Doughan is completely correct Another simple way is , even if you don't write the - @XmlElementWrapper private List<String> keywords; @XmlElementWrapper...
View ArticleAnswer by bdoughan for How to annotate a list using @XmlElement?
You need to leverage @XmlElementWrapper and @XmlElement.Java ModelContentimport java.util.List;import javax.xml.bind.annotation.*;@XmlRootElementpublic class Content { private List<String>...
View ArticleAnswer by Adam Arold for How to annotate a list using @XmlElement?
Use this form:@XmlElementWrapper(name="keywords")@XmlElement(name="keyword")Please note that if keywordsis empty then you will get <keywords />.Sometimes you will need to add @XmlRootElement to...
View ArticleHow to annotate a list using @XmlElement?
I have the following annotation using javax.xml.bind.annotation.XmlElement:@XmlElement public List<String> getKeywords() { return keywords;}Which produces the following XML when I marshall some...
View Article