ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siberski, Wolf" <>
Subject RE: [VOTE] the simple stuff
Date Thu, 29 Mar 2001 09:34:59 GMT
> Stefan Bodewig wrote:
> David Rees <> wrote:
> > Should it really be toString()?
> Yes.
> > Perhaps a toAntAttributeString() that falls back to toString()?
> Do you mean whoever expands the ${} should look whether the referenced
> object has a toAntAttributeString() method and invoke this - and fall
> back to toString if it doesn't? Why?

Because toString() is too unflexible for some purposes.
Assume a Date attribute. It's toString output is completely
useless. You need to associate a DateFormat with it to
get a reasonable String representation.
Unfortunately toAntAttributeString() doesn't help here, too.
Couldn't we associate a formatter to each data type where
the default formatter returns the result of toString()?


(just noticed Peter had already proposed the same)

View raw message