commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [BeanUtils] About DynaProperty definition
Date Mon, 28 Jul 2003 20:17:26 GMT
i've committed something along the lines i suggested. i'd be grateful if 
you could download and build the CVS HEAD version then check that the 
additions satisfy your needs.

- robert

On Monday, July 28, 2003, at 06:34 PM, Alfonso da Silva wrote:

> Hi!
>
> It sounds great! It's a better solution: clean and painless.
>
> Alf.
>
>
> El Sun, 27 Jul 2003 23:17:16 +0100 robert burrell donkin escribió:
>
>> On Friday, July 25, 2003, at 01:12 PM, Alfonso da Silva wrote:
>>
>>> Hi!
>>>
>>> I have a suggestion about DynaProperty definition. I'm working in a
>>> persistent layer that works with Dyna* classes.
>>>
>>> With the DynaProperty class, the type of an attribute can be
>> defined. But
>>> if I have an indexed (or a mapped) attribute (Vector, ArrayList,
>>> HashMap...) I cann't define what class of objects can the DynaBean
>>> accepts.
>>>
>>> I need something like this:
>>>
>>>  /* A mapped attribute whith Integer values (and String keys) */
>>>  DynaProperty p = new DynaProperty("integerMap",Integer.class);
>>>  p.setMapped(true);
>>>
>>> or
>>>
>>>  /* An indexed attribute whith String values */
>>>  DynaProperty p = new DynaProperty("stringArray",String.class);
>>>  p.setIndexed(true);
>>>
>>> or
>>>
>>>  /* A mapped attribute that accepts any value */
>>>  DynaProperty p = new DynaProperty("objectMap");
>>>  p.setMapped(true);
>>>
>>> or
>>>
>>>  /* A simple Calendar attibute */
>>>  DynaProperty p = new DynaProperty("calendar",Calendar.class);
>>>
>>> I believe that with indexed attributes (the same with mapped attributes)
>>> it isn't necessary to specify if it is a ArrayList or a Vector or an
>>> Array, because we recober the values of the DynaBean with the method
>>> get(java.lang.String name, int index)
>>>
>>> What do you think?
>>
>> hi alf
>>
>> this sounds like a pretty reasonable enhancement. i've taken a look at
>> clazz and they use getContentClazz and getKeyClazz so maybe we could add
>> two additional methods getContentType and getKeyType. these values would
>> be there just to support introspection of these values rather than having
>> needing any changes to the current beanutils code, wouldn't they?
>>
>
> --
> Mensaje enviado desde http://www.e-milio.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


Mime
View raw message