Skip to main content

jaxb customization of type used in xs:list defaults to string

1 reply [Last post]
Joined: 2010-05-15
Points: 0


I have some troubles getting a java type replacement working during unmarshaling using external customizations.

Take the following schema:

Now let's assume I would want to map the simpleType "float" to java.lang.Float instead of the default mapping java.lang.Double caused by its . I have no access to the original schema, so I couldn't just change the restriction to xs:float and have to an external customization as follows:

After running xjc, SomeNumbersType.getOneNumber() now returns a Float instead of a Double as desired. However, SomeNumbersType.getArray() returns a List instead of the expected List. It seems like the javaType binding did not work for , even worse it caused the array type to fall back to java.lang.String.

I have spent hours reading the spec and other documentation but still couldn't figure how to correctly replace this mapping to the excepted List.

Is this a bug, or have I misunderstood the binding process? I am using JAXB 2.1.10 bundled in JDK 6.

Thanks for any help on this!

best regards,

Heinrich Fink

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-08-06
Points: 0

I'm also experiencing similar issues. I use JDK 1.7 update 7 and JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2.

Any resolution to this?