[jboss-dev-forums] [Design of JBossXB] - Re: @XmlElementWrapper/@XmlElements
jason.greene@jboss.com
do-not-reply at jboss.com
Fri Oct 12 10:22:15 EDT 2007
"scott.stark at jboss.org" wrote : So how would an application.xml module element have to be handled? It should be something like this, but the schema for the wrapping module element has an unbounded max:
|
You need to introduce another type in JAXB to get both nesting levels to be unbounded. Like this (public fields used for simplicity):
| XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "Foo")
| public class Foo {
| @XmlElement(required = true)
| public List<Foo.Bar> bar;
|
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "")
| public static class Bar {
| @XmlElements({
| @XmlElement(name="A", type=Integer.class),
| @XmlElement(name="B", type=Float.class)
| })
| public List items;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094615#4094615
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094615
More information about the jboss-dev-forums
mailing list