users@jaxb.java.net

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

From: Tomasz Toczyski <guf_at_kajak.org.pl>
Date: Thu, 4 Dec 2008 10:22:59 +0100 (CET)

> 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

It does not solve my problem. If I declare minOccurs="0" Jaxb2 maps such
element to Integer type. But I want primitive int type.

Jaxb1 generated primitive int type even if I declare minOccurs="0". If
there were no such an element in my xml document a getter related to this
element returned 0 value. Can I force Jaxb2 to operate like Jaxb1 ?

-tt.