> Stefan Bodewig wrote:
> David Rees <[EMAIL PROTECTED]> wrote:
[snip]
> > 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()?
Wolf
(just noticed Peter had already proposed the same)