ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko van Dooren <>
Subject Internal Iterators for FileSet, and AbstractFileSetTask
Date Sat, 16 Feb 2002 13:53:57 GMT

I just added an inner class Visitor to, to 
act as an internal iterator. An internal iterator makes it very easy to 
perform a certain action on all elements of a certain structure. I've added a 
piece of class documentation that shows how to use it.

I also created AbstractFileSetTask that can be subclassed by tasks that work 
with FileSets. It also provides an internal iterator to perform a certain 
action on all files in all its filesets.

I didn't provide methods to perform actions on directories since I didn't 
need that. You can add it yourself, in which case, the abstract visit(File) 
methods probably needs a default implementation that does NOP (otherwise you 
also have to implement that one if you only do something with directories).

The modified, a patch for that file, and can be found here :

I've tested it with a task I'm writing for replacing regular expressions in 
files, and it works fine.

The specifications are partly JML ( I didn't use the Visitor class to avoid a dependency. If you wish to use more 
iterators, you can find them in the package (link 

Hope you like it, and thanx very much for a great build tool.

Marko No. 5
-- - Programming as you know it is over

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

View raw message