users@jaxb.java.net

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

From: jrj <jason_nabble_at_reast.net>
Date: Thu, 27 Aug 2009 08:00:04 -0700 (PDT)

Tomasz Toczyski-2 wrote:
>
> Aleksei Valikov:
>> Please see the globalBindings/_at_optionalProperty customization,
>> sections 5.5.1 and 5.5.4 in the spec.
>
> It seems reasonable. Alas, it doesn't work for me. I have tried
> <jaxb:globalBindings optionalProperty="primitive">
> and despite of it Jaxb generates getters of Integer values ( instead of
> int values).
>
> I also tried
> <jaxb:globalBindings optionalProperty="isSet"> - The effect is the same
> (Integers not ints)/
>
> Maybe there is a bug in Jaxb?... I use Jaxb v.2.1.7
>
> -tt.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>


Hi Tomasz,

Very late response, but this might be of use to anyone else coming this way.
The JAXB spec defines the attribute generateIsSetMethod thus:
<jaxb:globalBindings generateIsSetMethod="true">
is the approach you'd have needed here. I discussed this in a blog post
where I was experiencing the opposite problem
http://reast.net/coding/java/jaxb-generating-primitive-type-getters/.

Jason
-- 
View this message in context: http://www.nabble.com/primitive-types-%28int%2C-double-etc.%29--instead-of-class-types-tp20816710p25170251.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.