On Mon, 13 Aug 2001, Gregor Rayman wrote:

> Hi all,
>
> I've used the source code from Fracois Rey and have patched the
> PropertyUtils and BeanUtils to support string indexed properties.
>
> e.g. property prop(id) gets translated into getProp("id") and setProp("id",
> value)
>
> It works in combination with integer indexed and nested properties.
> It will probably not work correctly, if the index strings contain
> the separator characters ".", "[", "]" or "(", ")".
>
> I have not done any unit tests yet, I've only tested it in my
> Struts based application.
>
>
> I have no idea how to sumbit code to Jakarta, so I send the sources as they
> are
> to this mailing list. If you'd like the idea, I will clean them up, test
> them etc.
>

I've just checked in updates to the BeanUtils package based on your
contributions, plus some unit tests.  As we discussed earlier, I changed
the names from "String Keyed" to "Mapped".

Thanks for the contribution!

> Possible improvements might be:
>  - escape syntax which would allow separator characters in the index string

Yah, this is pretty important -- fortunately, it's fairly easy.

>  - allow using Map, if there are no getProp(String) and setProp(String, ...)
>    but there is Map getProp();
>

This actually corresponds to the way that Dmitri's JXPath stuff looks
at things, so it's a good idea as well.  It should also be fairly
straightforward.

> --
> gR
>

Craig


Reply via email to