« Return to Thread: primitive types (int, double etc.) instead of class types

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

by jrj :: Rate this Message:

| View in Thread


Tomasz Toczyski-2 wrote:
Aleksei Valikov:
> Please see the globalBindings/@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@jaxb.dev.java.net
For additional commands, e-mail: users-help@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

 « Return to Thread: primitive types (int, double etc.) instead of class types