You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2002/02/14 08:11:02 UTC

Re: [BeanUtils] Having a mapped property and indexed property with th e same name


On Thu, 14 Feb 2002, Guijt, Bart (fin) wrote:

>
> My question is: Is this the intended behaviour? My property is both mapped
> and indexed, and using method overloading to support this seems to be the
> right way to do it.
>

Unfortunately, having overloaded property getters or setters violates the
JavaBeans spec.  I would suggest changing the name of one or the other
getter to something unique.

> - Bart Guijt
>

Craig McClanahan


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [BeanUtils] Having a mapped property and indexed property with th e same name

Posted by Arron Bates <ar...@keyboardmonkey.com>.
The overloaded property is just side-tracking.
I also can't get a result out of a mapped property without a hack inside 
PropertyUtils to directly turn the returned object into a Map. This hack 
doesn't use the MappedPropertyDescriptor class otherwise I would submit 
the patch.

But in terms of the JavaBeans spec, it's all academic as I can't find it 
mentioning mapped properties.
I only tried to fix it as it was already in there.


Arron.

Craig R. McClanahan wrote:

>
>On Thu, 14 Feb 2002, Guijt, Bart (fin) wrote:
>
>>My question is: Is this the intended behaviour? My property is both mapped
>>and indexed, and using method overloading to support this seems to be the
>>right way to do it.
>>
>
>Unfortunately, having overloaded property getters or setters violates the
>JavaBeans spec.  I would suggest changing the name of one or the other
>getter to something unique.
>
>>- Bart Guijt
>>
>
>Craig McClanahan
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>