Quantcast
Channel: How to annotate a list using @XmlElement? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

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 Article



Answer 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 Article

Answer 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 Article

How 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
Browsing latest articles
Browse All 4 View Live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>