commons-dev 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] - Extensions for dotted queries...
Date Thu, 27 Mar 2003 20:12:32 GMT
hi Rune

(maybe i'm a little confused but...)

could you explain to me the differences between you code and the existing 
support for nested property access?

- robert

On Thursday, March 20, 2003, at 03:00 PM, Rune Toalango Johannesen wrote:

> Due to problems getting the previous email with some code through 
> paranoid firewalls I try again here... ;)
>
> The original email:
>
> [BeanUtils] - Extensions for dotted queries in composite data structures
>
> Guys,
>
> Attached you find some classes that extends the functionality of the 
> existing BeanUtils package;
>
>         ObjectUtils
>
> and
>
>         NestedObjectUtils
>
> The purpose of this extension is to allow bean property queries not only 
> on pure beans, but in composite data structures that might involve maps, 
> lists, arrays and collections in addition to the traditional beans.
>
> The ObjectUtils lets you resolve dotted queries like this;
>
>         String text = (String) ObjectUtils.get(namespace, 
> "session.products.0.children.2.displayText");
>
> as opposed to
>
>         String text = (String) ((List) ((Catalog) namespace.get("session"
> )).getProducts()).get(0)............
>
> The NestedObjectUtils lets you do the same, but allows nested queries 
> like;
>
>         
> "session.products.0.children.{request.parameter.childNumber}.displayText"
>
> The NestedObjectUtils depends on the Commons-Lang 
> (org.apache.commons.lang.StringUtils) in addition to the existing 
> BeanUtils dependencies.
>
> I've javadoc'ed the code and provided some unit tests... Let me know what 
> you think - should this be included in the BeanUtils package in some 
> future release? What about extending it to support the DynaBean concept? 
> What about extending the query language in the BeanUtils package in 
> general to support both traditional () and [] delimiters in addition to 
> the uniformed dot - as it is used in these classes?
>
>
>
> <<beanutils-extension.zip>>
>
>
>
> Cheers,
>
> Rune
> ______________________________________________________________________________
> Sie haben mehr zu sagen als in eine SMS passt? Mit WEB.DE FreeMail ist
> das jetzt kein Problem mehr! http://freemail.web.de/features/?mc=021182
>  ---------------------------------------------------------------------
> 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


Mime
View raw message