This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: isProperty patch
- From: Per Bothner <per at bothner dot com>
- To: Chris Dean <ctdean at sokitomi dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Wed, 11 Aug 2004 14:33:18 -0700
- Subject: Re: isProperty patch
- References: <87brholrbz.fsf@mercedsystems.com>
Chris Dean wrote:
Here's a patch that adds "isName" property detection, a commonly used
pattern in Java Beans for boolean properties. This logic in this code
is similar to the logic in java.beans.PropertyDescriptor which plays
fast and loose with with whole "boolean" part of boolean properties.
Thanks. I checked this in.
The field name is "mangled" (@pxref{Mangling}) into a valid Java name.
If there is no accessible field whose name is @code{"@var{fieldname}"},
-we look for a no-argument method whose name is @code{"get@var{Fieldname}"}.
+we look for a no-argument method whose name is
+@code{"get@var{Fieldname}"} (or @code{"get@var{Fieldname}"}" for a
+boolean property).
s/or @code{"get/or @code{"is/
s/"}"/"}/
--
--Per Bothner
per@bothner.com http://per.bothner.com/