The docs state the the @XmlElementWrapper annotation can be used for 'unwrapped' or 'wrapped' collections.
http://docs.oracle.com/javaee/5/api/javax/xml/bind/annotation/XmlElementWrapper.html
How do you configure it to produce an unwrapped collection?
If you include @XmlElementWrapper
it will add a grouping element:
@XmlElementWrapper
@XmlElement(name="foo")
public List<Foo> getFoos() {
return foos;
}
<root>
<foos>
<foo/>
<foo/>
</foos>
</foo>
and if you omit it, then it won't.
@XmlElement(name="foo")
public List<Foo> getFoos() {
return foos;
}
<root>
<foo/>
<foo/>
</foo>
For More Information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With