commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfonso da Silva <>
Subject [BeanUtils] About DynaProperty definition
Date Fri, 25 Jul 2003 13:12:05 GMT

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);


 /* An indexed attribute whith String values */
 DynaProperty p = new DynaProperty("stringArray",String.class);


 /* A mapped attribute that accepts any value */
 DynaProperty p = new DynaProperty("objectMap");


 /* 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?


Mensaje enviado desde

View raw message