ant-user mailing list archives

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

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}">
      <filterset>
         <filter token="DATE" value="${TODAY}"/>
      </filterset>
   </copy>

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

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.

</braindump>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message