commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject RE: [SANDBOX][BEANUTILS2] Property expressions
Date Fri, 02 May 2014 10:55:01 GMT
There is also our own jxpath.


<div>-------- Original message --------</div><div>From: Benedikt Ritter
<> </div><div>Date:05/02/2014  06:40  (GMT-05:00) </div><div>To:
Commons Developers List <> </div><div>Subject: [SANDBOX][BEANUTILS2]
Property expressions </div><div>
</div>Hi all,

one of the goal of BeanUtils2 is to provide the same functionality as
BeanUtils1. In BeanUtils1 you can do something like this:

BeanUtils.getProperty(person, "");

This would be translated into:


The same can be done with mapped and indexed properties:

BeanUtils.getProperty(person, "contact(5).name");

which would be translated to:


BeanUtils2 provides a fluent API where the first example would be done via:


and the second:


We are currently thinking about how we can implement the property
expressions. We are discussing this in SANDBOX-464 [1] and there is already
a patch. I'm currently unsure whether we should allow mixing up the fluent
API and property expressions. The contributor makes some good examples of
what kind of awful code could be created:


on the other hand I don't want to force people into doing stuff like this:

String path = pos = ...
on(bean).get(path + "[" + pos + "]");

Currently I'm tempted to allow mixing up both API styles, but I'd like to
here your opinion first.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message