users@jaxb.java.net

_at_XmlElementWrapper schema-to-java equivalent

From: rguerra <renato_at_cavalcanti.be>
Date: Thu, 23 Aug 2007 01:42:33 -0700 (PDT)

Hi,

I have a schema where I have some wrapper elements. The XML for the schema
is for instance:


<foo>
    <bars>
        <bar>some text</bar>
        <bar>some text</bar>
    </bars>
</foo>



When generating the java classes, JAXB generates Foo.java and Bars.java.
The Bars.java is just a container for a List<String>.

So,


public class Foo {
   public Bars getBars();
}


and


public class Bars {
    public List<String> getBar();
}



I would like to have a Foo class with a method a method List<String>
getBars(); without having an intermediate Bars class.

I know that there is possible by adding the @XmlElementWrapper annotation in
the java class, but in my case I'm generating the java from the schema, so I
need an equivalent on my binding.xjb file.

Does someone have an idea of how to do that starting from a schema? I have
tried different options without success.

Thanks a lot,

cavalcanti
-- 
View this message in context: http://www.nabble.com/%40XmlElementWrapper-schema-to-java-equivalent-tf4316168.html#a12289676
Sent from the java.net - jaxb users mailing list archive at Nabble.com.