commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@eurobell.co.uk>
Subject Re: [BeanUtils] PropertyUtils and DynaBeans (getPropertyDescriptors)
Date Fri, 12 Apr 2002 21:41:57 GMT
I've just spent the evening trying to figure out the property descriptor
classes myself. For the joda project I wanted to return a BeanInfo
specifying a description of the bean. But it seems to be a bit tricky.

PropertyDescriptor is OK for my needs (just about)
IndexedPropertyDesciptor is not much use as it only covers arrays, not Lists
MappedPropertyDescriptor seems to be of limited use. It is picked up from
BeanInfo, but does not include the Map getXxxMap() type method as Arron
noted.

Nothing really handles Lists, and I also noted that DynaBeans don't use
PropertyDescriptors.

One solution would be for beanutils to have a ListPropertyDescriptor that
copes with getXxxList() and getXxx(int). Plus extending
MappedPropertyDescriptor to cover getXxxMap().

This all seems hard work however. The beans spec is pretty outdated these
days (thats why I started joda really). My question is whether these
extended (ie. java.beans) PropertyDescriptor classes really are that
useful - can they really be used as general purpose classes without writing
a full replacement to java.beans.Introspector?

> What's the MappedPropertyDescriptor class in the package then?...
> Seems to work too. For "Object getMyProperty(String key)". The
> getPropertyDescriptor method seems to find it okay.
>
> Or is something else needed?...
>
> Only thing which made it an issue before was the other variety
> "java.util.Map getMyProperty()" but then again, the
> IndexedPropertyDescriptor doesn't like that version (Get the whole
> collection, then use the index on it) of property methods either.
>
> Arron.
>
> Craig R. McClanahan wrote:
>
> >
> >On Fri, 12 Apr 2002, Matt Johnson wrote:
> >
> >>Date: Fri, 12 Apr 2002 10:45:39 +1000
> >>From: Matt Johnson <johnsonm@whitesmiths.com.au>
> >>Reply-To: Jakarta Commons Developers List
<commons-dev@jakarta.apache.org>
> >>To: commons-dev@jakarta.apache.org
> >>Subject: [BeanUtils] PropertyUtils and DynaBeans
(getPropertyDescriptors)
> >>
> >>[apologies - package name now inserted in subject]
> >>
> >>Folks,
> >>
> >>Is anyone working towards fixing PropertyUtils to work with DynaBeans
(ie,
> >>where all the FIXME tags are)?  What's the status (if any), and will
this be
> >>included in 1.1 final?
> >>
> >>If this is currently in limbo, has anyone already patched this privately
> >>(before I go and diy)?
> >>
> >
> >Patches to these areas would be welcomed!  Some of them are going to get
> >really interesting, though, because the standard PropertyDescriptor
> >doesn't really contemplate such a thing as a mapped property.
> >
> >>Thanks,
> >>
> >>
> >>Matt J.
> >>
> >
> >Craig
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>
>


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


Mime
View raw message