ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject [RT] [myrmidon] Property evaluation
Date Sun, 21 Apr 2002 04:13:44 GMT

I have just went and look at some of the other build tools emerging and they 
all share one common characteristeric. They all have a richer property access 
expressions. What do I mean? Consider the following case;

class MyDataStructure
  Vector items = new Vector();

MyDataStructure mds = new MyDataStructure();
mds.items.add( "item1" );
mds.items.add( "item2" );
mds.items.add( "item3" );

getContext().setProperty( "mds", mds );

The above creates a complex object and places in property store. However under 
the current model there is no way to access the "insides" of the mds property 
- at least not without writing another task. I was thinking that it may be a 
nice idea to add a simple path expression library on top of our property 
evaluation system so that you could do something like

<echo message="The following should evaluate to the string 'item'"/>
<echo message="${mds/items['item1']}"/>

We could create our own expression language or clone it from an existing 
project (maybe velocity). However I believe there is an XPath library at 
Apache that is meant to be damn fine (Jaxen in commons IIRC) that we could 
use (Not sure I personally haven't looked at it but it is meant to be all 

Anyways I haven't actually prototyped this but I thought it would be neat to 
do. Anyone who wants to have a play should feel free to do so ;)


Peter Donald

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message