ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: [DISC] ${} expansion for data types
Date Thu, 31 May 2001 10:47:16 GMT
At 11:16 AM 5/31/01 +0200, Stefan Bodewig wrote:
>>>Does that mean, we want/have to make the converters a hierarchical
>> Not in my opinion - they just have to be aware of the context in
>> which they are called.  (ie we have to pass in the properties at
>> time they are converted). Context could be hierarchial (or it could
>> not) but that is irrelevent to the converter. 
>Not sure whether I can follow you here.
>So we'd need to store the information that the user requests comma as
>a delimiter and relative file names for the converter into the context
>and the converter would know each and every variation of how the user
>wants to have her fileset expanded?

Well I am thinking slightly differently. I see conversion as requiring data
in context. The most common example being files. Strings that need to be
converted to files need to be relative to project base directory. 

So when doing the conversion you would do something like

Object convert( Object original, Context context )
  final String filename = (String)original;
  final File baseDirectory = context.get( "ant.project.dir" );
  final File result = resolveFile( baseDirectory, filename );
  return result;

I don't see conversion requiring information in the way you portray it. We
would only have one converter for FileSet->String and the user should have
zero choice in how it is laid out (It will be the pair of String->FileSet



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message