commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rune Johannesen <>
Subject [BeanUtils] - Extensions for dotted queries in composite data str uctures
Date Tue, 18 Mar 2003 18:06:16 GMT

Attached you find some classes that extends the functionality of the
existing BeanUtils package;




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,

as opposed to

	String text = (String) ((List) ((Catalog)

The NestedObjectUtils lets you do the same, but allows nested queries like;


The NestedObjectUtils depends on the Commons-Lang
(org.apache.commons.lang.StringUtils) in addition to the existing BeanUtils

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?




View raw message