ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <>
Subject FilterSet vs FilterChains
Date Thu, 28 Apr 2005 12:46:58 GMT

There is a little overlap between FilterSet and FilterChain types, but
otherwise the two types are quite different.

For example the following two copy tasks are equivalent.

   <copy file="${src.file}" tofile="${dest.file}">
         <filter token="DATE" value="${TODAY}"/>

   <copy file="${src.file}" tofile="${dest.file}">
            <token key="DATE" value="${TODAY}"/>

The FilterSet type does token replacement. A FilterSet can be named and
referenced (reused) later. They also can be aggregated by using nesting.
In addition to the inline enumeration of token/value pairs, the
token/value pairs can be loaded from a file.

The FilterChain type can do a variety of different file transformations
in addition to simple token replacement. The documentation equates the
FilterChain type to Unix pipes. The supplied  nested elements provide
transformations for extracting Java class constants, escaping Unicode
characters, stripping comments, and many more. There is also an optional
filter that can execute an Apache BSF script. This makes the FilterChain
type easily extensible.

If the <replacetokens> element of the FilterChain type supported the
features of the FilterSet type (naming, nesting, file loading), the
FilterSet type would be obsolete.


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

View raw message