users@jaxb.java.net

Re: Re: JAXB, XJC and the Java Beans spec. - boolean getter methods

From: <torsten.reinhard_at_gi-de.com>
Date: Wed, 5 Nov 2008 17:42:55 +0100

Hi,

I know about the fix in 2.2 (
https://jaxb.dev.java.net/issues/show_bug.cgi?id=131)
- but I´m looking for an "easy to apply workaround" solution for now....

The xjc-plugin API could be a solution - just generate a "Boolean
get....()" method in addition to the "Boolean is....()" method.
But I´m wondering, why there isn´t already a "booleangetter plugin"
available at https://jaxb2-commons.dev.java.net/ - if so many people have
the same issue.

Or better via the bindings? As Felipe recommended?

It would be nice to have an "official" hint / download URL or whatever
placed at the bug issue.


thanx, Torsten







Martin Grebac <Martin.Grebac_at_Sun.COM>
Gesendet von: Martin.Grebac_at_Sun.COM
05.11.2008 17:05
Bitte antworten an
users_at_jaxb.dev.java.net


An
users_at_jaxb.dev.java.net
Kopie

Thema
Re: JAXB, XJC and the Java Beans spec. - boolean getter methods






Hi,
 this is already fixed for JAXB 2.2. I didn't want the fix enabled for
2.1 to not break the compatibility, but there seems to be more and
more requests for this, so I might reevaluate that decision.
  MartinG

torsten.reinhard_at_gi-de.com wrote:
>
> Hi,
>
> I have problems in using XJC to generate JAXB classes to match the
> Java Beans specification.
>
> The generated methods for <boolean> types are
> void set.....(Boolean value )
> Boolean is....()
>
> instead of
>
> void set....(boolean value)
> boolean is....()
>
> That causes problems in using JXPath (apache) for example, and other
> libraries, too.
>
> I´ve read a lot about this problem, for example:
>
>
http://weblogs.java.net/blog/kohsuke/archive/2007/07/hudson_1122_and.html
>
http://www.nabble.com/How-can-JAXB-generate-getter-method-for-boolean--td16563661.html

>
>
http://www.mojavelinux.com/blog/archives/2006/09/the_great_jaxb_api_blunder/

>
> https://jaxb.dev.java.net/issues/show_bug.cgi?id=131
> http://forums.java.net/jive/thread.jspa?messageID=301300&tstart=0
> <http://forums.java.net/jive/thread.jspa?messageID=301300&tstart=0>
>
> I´ve read something about a "booleangetter" plugin - is this already
> available anywhere?
> Isn´t there maybe another (simple) solution?
>
> What would you suggest to come around this "boolean getter method
> problem" ?
>
>
> Thanx, Torsten

-- 
Martin Grebac, http://blogs.sun.com/mgrebac
Web Technologies & Standards
Sun Microsystems Czech
ICQ: 93478885
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net