ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
Subject Re: Extending Ant [was RE: Comparing files in subdirectories]
Date Tue, 29 Oct 2002 23:24:32 GMT
Costin Manolache wrote:
> Another hook I'm lobying for deals with replacement of ${properties}.
> I'm experimenting with a more advanced one that would allow 
> "${ref:reference}" to actually call a setter using the real 
> reference type ( foo="${ref:a} -> setFoo( Bar param ), where 'a'
> is a reference to a Bar type ). That would require hooking into
> IntrospectionHelper - and I can tell you it's not very hard.

Yes, that is a cool feature.  I brought up something perhaps related 
once upon a time when the <basename>/<dirname> tasks were being put in 
such that you could have MessageFormat-like replacements (see how a {0} 
being fed with a Date can be flexibly formatted).

For example, a property representing a file could be used in a situation 
where only the basename is wanted: ${file.property:basename}

That syntax might not be quite the end implementation, but something 
along those lines so we don't need to keep adding property morphing 
tasks, we can simply have the underlying data structure have getters or 
something like that to return pieces.  So dirname, toUpper, toLower, O/S 
conversions and the like could all fit into that realm.

This would mean that, perhaps, properties aren't simply strings but 
represent a richer Object instead.  <tstamp> for example could create 
the properties as real Date objects and rather than formatting them 
itself the formatting could be done at the time of its use.

These ideas might be tangential to where you were going with this, 
Costin, but I figured while it was on my mind :)

Thoughts?

	Erik


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message