I can confirm that! This weekend i traced through Betwixt's attempt to extract the properties of my bean and saw that it was in java.beans.Introspector where
the list of properties were coming from and my "Boolean isSomeValue()" was not being put in that list. At that point i kind of assumed Craig's assessment: it's
probobly not a valid getter. So at this point i'm weighing whether to do the extend-solution you mentioned versus just doing some after-the-fact tweaking the
XML being returned.
Thanks all!
- Jordi
Sweetland, Jesse wrote:
That would explain it. Betwixt uses java.beans.Introspector to generate
java.beans.PropertyDescriptors, which only recognizes spec-valid bean
properties. Betwixt allows you to specify an mutator method override via
the "updater" attribute, but as far as I can tell by looking at
ElementRule.java, it does not have any way to override the accessor method.
Your best bet is probably to rename the accessor method to getFoo() instead
of isFoo(), or if you do not have access to the class itself, extend the
class and add a getFoo() method that calls super.isFoo().
-----Original Message-----
From: Craig McClanahan [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 23, 2006 1:50 AM
To: Jakarta Commons Users List
Subject: Re: Boolean getters in Betwixt
On 9/22/06, J. H. <[EMAIL PROTECTED]> wrote:
Alas, this still doesn't recognize "public Boolean isSomeValue()" as a
valid getter, though i suspect if i could get that to work i'd also have
to
implement
these steps as well in order to get everything running smoothly. Which
leads to the question:
FWIW, this is *not* a valid getter, according to the JavaBeans spec that
defines the introspection rules. The "is" prefix only works for properties
of type boolean (the primitive), not Boolean (the wrapper class). If
Betwixt is not recognizing that, it seems to me that it is doing the correct
thing.
Craig McClanahan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]