users@jaxb.java.net

javaType generates JAXBElement wrapper

From: Petteri Stenius <Petteri.Stenius_at_ubisecure.com>
Date: Mon, 6 Nov 2006 19:14:22 +0200

Hi,

I think the following behavior is strange.

My schema fragment looks like this:

<complexType name="Document">
  <sequence>
    <element ref="my:Property" maxOccurs="unbounded"/>
  </sequence>
</complexType>

<element name="Property" type="anyURI"/>

As expected the schema generates an accessor method as follows:

List<String> getProperty();

However, because I'd like to substitute java.net.URI for anyURI I added the following to globalBindings:

<jaxb:javaType name="java.net.URI" xmlType="anyURI"/>

The surpise is that after this the accessor method looks like this:

List<JAXBElement<URI>> getProperty();

Why did the JAXBElement wrapper appear here?


Regards,
Petteri Stenius