>From Wendy Smoak:
> Since properties can be read-only (no set method) it first looks for the
> is/get method to determine the type.  In your case, it saw the boolean
> isBound() method.  Right there it decided that the 'bound' property was of
> type boolean.  Now it goes looking for the setBound(boolean b) method,
which
> it did not find.  So it decided that the boolean 'bound' method was
> read-only.

It does not appear the BeanUtils is following this process. When the
descriptors are returned from java.beans.Introspector BeanUtils assumes that
there is one or two descriptors containing the get<PropertyName> and the
set<PropertyName> descriptors, for non-boolean data types, and validates
this by checking for names that start with "get" and "set". Unfortunately,
in my case java.beans.Introspector returned three descriptors; the first was
get<PropertyName>, the second was is<PropertyName>, and the third was
set<PropertyName>. Since BeanUtils is hardcoded to always look at the first
two descriptors for the setter it completely missed that a perfectly good
set<PropertyName> that was in the third descriptor.

Now if everyone followed the standards then java.beans.Introspector should
never have returned the is<PropertyName> and then BeanUtils could get away
with only looking at the first two descriptors. However, since
java.beans.Introspector does not impose the standard is would seem that
BeanUtils should make allowances for more than two descriptors and look at
all of the information returned for a set<PropertyName> before it decides to
say the property is read-only when it is in fact not.

Kenneth.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to