You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by robert burrell donkin <ro...@blueyonder.co.uk> on 2004/02/10 23:26:34 UTC

Re: [beanutils] Indexed/Mapped DynaProperty

hmmm....

bit of a tough one this. i think that it'd involve an addition to the 
DynaBean's API. this is question probably belongs on the dev list so 
i'd suggest that we take it there. (if you're unwilling to process - by 
filtering - the torrent of mail that is commons-dev then you might like 
to subscribe through the news bridge at gname, i think.)

- robert

On 6 Feb 2004, at 09:07, guillaume.tuloup@fr.thalesgroup.com wrote:

>
>  Hi,
>
>   is it possible to have the length/keyset of an indexed/mapped 
> dynaproperty
> ? My wish is to copy a dynaproperty from a dynabean to another, any 
> other
> solution will be appreciated...
>
> TIA,
> Guillaume.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Indexed/Mapped DynaProperty

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Shouldn't it be though - if you look at DynaProperty it has an isIndexed()
method which checks if the type is either an array or a List and it has an
isMapped() method which checks if the type is a Map. Doesn't that imply that
these define the types for mapped and indexed properties? Obviously an
implementation could ignore that and set/get values to other types
(WrapDynaBean being an example that could break that rule). Interesting
enough BasicDynaBean doesn't bother using these methods, but duplicates the
code and I guess if the standard implementation ignores them, it doesn't
give them much weight.

Also, maybe my solution would suit Guillaume - because perhaps he knows all
his mapped/indexed properties are backed by Maps, Lists and arrays and he
can live with that - mine are and I don't think thats much of a restriction
as they are only types and not implementations.

Don't get me wrong, I'm not arguing against an API change - I think
size(property) and keySet(property) methods would be v. useful additions to
the API - less getting and casting - making code neater and simpler.

Niall


----- Original Message ----- 
From: "robert burrell donkin" <ro...@blueyonder.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Thursday, February 12, 2004 10:43 PM
Subject: Re: [beanutils] Indexed/Mapped DynaProperty


> i think that the issue is that though the property acts like a map,
> there is actually no guarantee that it will actually be backed by a
> map. a DynaBean is quite at liberty to use something different - for
> example, instances of an enumeration class.
>
> that's why i think an addition to the API would be needed which would
> allow the underlying implementation to be supply the information
> required.
>
> - robert
>
> On 10 Feb 2004, at 23:22, Niall Pemberton wrote:
>
> > I don't understand what the issue is, if you want the keyset fro
> > example
> > then...
> >
> >     Map myMap = (Map)myDynaBean.get("myMapPropertyName");
> >     Set myKeySet = myMap.keySet()
> >
> > Niall
> >
> >
> > ----- Original Message -----
> > From: "robert burrell donkin" <ro...@blueyonder.co.uk>
> > To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> > Cc: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > Sent: Tuesday, February 10, 2004 10:26 PM
> > Subject: Re: [beanutils] Indexed/Mapped DynaProperty
> >
> >
> >> hmmm....
> >>
> >> bit of a tough one this. i think that it'd involve an addition to the
> >> DynaBean's API. this is question probably belongs on the dev list so
> >> i'd suggest that we take it there. (if you're unwilling to process -
> >> by
> >> filtering - the torrent of mail that is commons-dev then you might
> >> like
> >> to subscribe through the news bridge at gname, i think.)
> >>
> >> - robert
> >>
> >> On 6 Feb 2004, at 09:07, guillaume.tuloup@fr.thalesgroup.com wrote:
> >>
> >>>
> >>>  Hi,
> >>>
> >>>   is it possible to have the length/keyset of an indexed/mapped
> >>> dynaproperty
> >>> ? My wish is to copy a dynaproperty from a dynabean to another, any
> >>> other
> >>> solution will be appreciated...
> >>>
> >>> TIA,
> >>> Guillaume.
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Indexed/Mapped DynaProperty

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
i think that the issue is that though the property acts like a map, 
there is actually no guarantee that it will actually be backed by a 
map. a DynaBean is quite at liberty to use something different - for 
example, instances of an enumeration class.

that's why i think an addition to the API would be needed which would 
allow the underlying implementation to be supply the information 
required.

- robert

On 10 Feb 2004, at 23:22, Niall Pemberton wrote:

> I don't understand what the issue is, if you want the keyset fro 
> example
> then...
>
>     Map myMap = (Map)myDynaBean.get("myMapPropertyName");
>     Set myKeySet = myMap.keySet()
>
> Niall
>
>
> ----- Original Message -----
> From: "robert burrell donkin" <ro...@blueyonder.co.uk>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Cc: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> Sent: Tuesday, February 10, 2004 10:26 PM
> Subject: Re: [beanutils] Indexed/Mapped DynaProperty
>
>
>> hmmm....
>>
>> bit of a tough one this. i think that it'd involve an addition to the
>> DynaBean's API. this is question probably belongs on the dev list so
>> i'd suggest that we take it there. (if you're unwilling to process - 
>> by
>> filtering - the torrent of mail that is commons-dev then you might 
>> like
>> to subscribe through the news bridge at gname, i think.)
>>
>> - robert
>>
>> On 6 Feb 2004, at 09:07, guillaume.tuloup@fr.thalesgroup.com wrote:
>>
>>>
>>>  Hi,
>>>
>>>   is it possible to have the length/keyset of an indexed/mapped
>>> dynaproperty
>>> ? My wish is to copy a dynaproperty from a dynabean to another, any
>>> other
>>> solution will be appreciated...
>>>
>>> TIA,
>>> Guillaume.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Indexed/Mapped DynaProperty

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I don't understand what the issue is, if you want the keyset fro example
then...

    Map myMap = (Map)myDynaBean.get("myMapPropertyName");
    Set myKeySet = myMap.keySet()

Niall


----- Original Message ----- 
From: "robert burrell donkin" <ro...@blueyonder.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Cc: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Tuesday, February 10, 2004 10:26 PM
Subject: Re: [beanutils] Indexed/Mapped DynaProperty


> hmmm....
>
> bit of a tough one this. i think that it'd involve an addition to the
> DynaBean's API. this is question probably belongs on the dev list so
> i'd suggest that we take it there. (if you're unwilling to process - by
> filtering - the torrent of mail that is commons-dev then you might like
> to subscribe through the news bridge at gname, i think.)
>
> - robert
>
> On 6 Feb 2004, at 09:07, guillaume.tuloup@fr.thalesgroup.com wrote:
>
> >
> >  Hi,
> >
> >   is it possible to have the length/keyset of an indexed/mapped
> > dynaproperty
> > ? My wish is to copy a dynaproperty from a dynabean to another, any
> > other
> > solution will be appreciated...
> >
> > TIA,
> > Guillaume.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org