users@jaxb.java.net

Re: primitive types (int, double etc.) instead of class types

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Wed, 3 Dec 2008 18:22:23 +0100

you can use JAXB customizations to generate any type from any element....

like this example:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnbbf.html#bnbci

On Wed, Dec 3, 2008 at 5:46 PM, Tomasz Toczyski <guf_at_kajak.org.pl> wrote:
> Hi!
>
> I have elements of xs:int and xs:double types defined in my xsd file.
> Previously I used Jaxb 1.x - it generated Java classes with fileds of
> primitive types: int and double.
>
> But Jaxb2 generates classes with fields of class types: Integer, Double.
> But I don't want class types (These class types cause many unboxing
> problems in my project). I need primitive types.
>
> I know that I can force Jaxb to generate primitive types by setting
> minOccurs="1" in elements definitions. But it is not a suitable solution
> for me (I should not change my schema).
>
> Do you know any solution for me?
>
>
> Regards,
> -tt.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>