@@ -56,7 +56,7 @@ FilterReaders can be easily plugged in as nested elements of
<code><filterchain></code> by using <code><filterreader></code> elements.
<p>
Example:
<blockquote> <pre>
<pre>
<copy file="${src.file}" tofile="${dest.file}">
<filterchain>
<filterreader classname="your.extension.of.java.io.FilterReader">
@@ -71,21 +71,21 @@ Example:
</filterreader>
</filterchain>
</copy>
</pre></blockquote>
</pre>
Ant provides some built-in filter readers. These filter readers
can also be declared using a syntax similar to the above syntax.
However, they can be declared using some simpler syntax also.<p>
Example:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<headfilter lines="15"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
is equivalent to:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
@@ -93,7 +93,7 @@ is equivalent to:
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
The following built-in tasks support nested <code><filterchain></code> elements.<br>
<a href="../Tasks/concat.html">Concat</a>,<br>
@@ -188,18 +188,18 @@ distribution.
This loads the basic constants defined in a Java class as Ant properties.
<blockquote> <pre>
<pre>
<loadproperties srcfile="foo.class" encoding="ISO-8859-1">
<filterchain>
<classconstants/>
</filterchain>
</loadproperties>
</pre></blockquote>
</pre>
This loads the constants from a Java class file as Ant properties,
prepending the names with a prefix.
<blockquote>< pre>
<pre>
<loadproperties srcfile="build/classes/org/acme/bar.class"
encoding="ISO-8859-1">
<filterchain>
@@ -207,7 +207,7 @@ prepending the names with a prefix.
<prefixlines prefix="ini."/>
</filterchain>
</loadproperties>
</pre></blockquote>
</pre>
<h3 id="escapeunicode">EscapeUnicode</h3>
<p>
This filter converts its input by changing all non US-ASCII characters
@@ -218,34 +218,34 @@ into their equivalent unicode escape backslash u plus 4 digits.</p>
<h4>Example:</h4>
This loads the basic constants defined in a Java class as Ant properties.
<blockquote> <pre>
<pre>
<loadproperties srcfile="non_ascii_property.properties">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.EscapeUnicode"/>
</filterchain>
</loadproperties>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadproperties srcfile="non_ascii_property.properties">
<filterchain>
<escapeunicode/>
</filterchain>
</loadproperties>
</pre></blockquote>
</pre>
<h3 id="expandproperties">ExpandProperties</h3>
<p>
If the data contains data that represents Ant
properties (of the form ${...}), that is substituted
with the property's actual value.
<p>
</ p>
<h4>Example:</h4>
This results in the property modifiedmessage holding the value
"All these moments will be lost in time, like teardrops in the rain"
<blockquote> <pre>
<pre>
<echo
message="All these moments will be lost in time, like teardrops in the ${weather}"
file="loadfile1.tmp"
@@ -256,10 +256,10 @@ This results in the property modifiedmessage holding the value
<filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<echo
message="All these moments will be lost in time, like teardrops in the ${weather}"
file="loadfile1.tmp"
@@ -270,12 +270,12 @@ Convenience method:
<expandproperties/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<p><em>Since Ant 1.8.3</em>, a nested
<a href="propertyset.html">PropertySet</a> can be specified:
<a href="propertyset.html">PropertySet</a> can be specified:</p>
<blockquote> <pre>
<pre>
<property name="weather" value="rain"/>
<loadfile property="modifiedmessage" srcFile="loadfile1.tmp">
<filterchain>
@@ -286,7 +286,7 @@ Convenience method:
</expandproperties>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="headfilter">HeadFilter</h3>
@@ -316,7 +316,7 @@ This filter reads the first few lines from the data supplied to it.
<h4>Example:</h4>
This stores the first 15 lines of the supplied data in the property src.file.head
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
@@ -324,26 +324,26 @@ This stores the first 15 lines of the supplied data in the property src.file.hea
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<headfilter lines="15"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This stores the first 15 lines, skipping the first 2 lines, of the supplied data
in the property src.file.head. (Means: lines 3-17)
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<headfilter lines="15" skip="2"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
See the testcases for more examples (<i>src\etc\testcases\filters\head-tail.xml</i> in the
source distribution).
@@ -376,36 +376,36 @@ strings.
This will include only those lines that contain <code>foo</code> and
<code>bar</code>.
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.LineContains">
<param type="contains" value="foo"/>
<param type="contains" value="bar"/>
</filterreader>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<linecontains>
<contains value="foo"/>
<contains value="bar"/>
</linecontains>
</pre></blockquote>
</pre>
Negation:
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.LineContains">
<param type="negate" value="true"/>
<param type="contains" value="foo"/>
<param type="contains" value="bar"/>
</filterreader>
</pre></blockquote>
</pre>
<i>or</i>
<blockquote> <pre>
<pre>
<linecontains negate="true">
<contains value="foo"/>
<contains value="bar"/>
</linecontains>
</pre></blockquote>
</pre>
<h3 id="linecontainsregexp">LineContainsRegExp</h3>
@@ -447,32 +447,32 @@ the choice of regular expression implementation.
<h4>Example:</h4>
This will fetch all those lines that contain the pattern <code>foo</code>
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
<param type="regexp" value="foo*"/>
</filterreader>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<linecontainsregexp>
<regexp pattern="foo*"/>
</linecontainsregexp>
</pre></blockquote>
</pre>
Negation:
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
<param type="negate" value="true"/>
<param type="regexp" value="foo*"/>
</filterreader>
</pre></blockquote>
</pre>
<i>or</i>
<blockquote> <pre>
<pre>
<linecontainsregexp negate="true">
<regexp pattern="foo*"/>
</linecontainsregexp>
</pre></blockquote>
</pre>
<h3 id="prefixlines">PrefixLines</h3>
@@ -494,16 +494,16 @@ Attaches a prefix to every line.
<h4>Example:</h4>
This will attach the prefix <code>Foo</code> to all lines.
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.PrefixLines">
<param name="prefix" value="Foo"/>
</filterreader>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<prefixlines prefix="Foo"/>
</pre></blockquote>
</pre>
<h3 id="suffixlines">SuffixLines</h3>
@@ -527,16 +527,16 @@ Attaches a suffix to every line.
<h4>Example:</h4>
This will attach the suffix <code>Foo</code> to all lines.
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.SuffixLines">
<param name="suffix" value="Foo"/>
</filterreader>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<suffixlines suffix="Foo"/>
</pre></blockquote>
</pre>
<h3 id="replacetokens">ReplaceTokens</h3>
@@ -598,7 +598,7 @@ user defined values.
This replaces occurrences of the string @DATE@ in the data
with today's date and stores it in the property ${src.file.replaced}.
<blockquote> <pre>
<pre>
<tstamp/>
<!-- just for explaining the use of the properties -->
<property name="src.file" value="orders.csv"/>
@@ -615,10 +615,10 @@ with today's date and stores it in the property ${src.file.replaced}.
<!-- just for explaining the use of the properties -->
<echo message="${orders.replaced}"/>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<tstamp/>
<loadfile srcfile="${src.file}" property="${src.file.replaced}">
<filterchain>
@@ -627,11 +627,11 @@ Convenience method:
</replacetokens>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This replaces occurrences of the string {{DATE}} in the data
with today's date and stores it in the property ${src.file.replaced}.
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.replaced}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
@@ -640,10 +640,10 @@ with today's date and stores it in the property ${src.file.replaced}.
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<tstamp/>
<loadfile srcfile="${src.file}" property="${src.file.replaced}">
<filterchain>
@@ -652,10 +652,10 @@ Convenience method:
</replacetokens>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This will treat each properties file entry in sample.properties as a token/key pair :
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.replaced}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
@@ -663,10 +663,10 @@ This will treat each properties file entry in sample.properties as a token/key p
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This reads the properties from an Ant resource referenced by its id:
<blockquote> <pre>
<pre>
<string id="embedded-properties">
foo=bar
baz=xyzzy
@@ -676,7 +676,7 @@ baz=xyzzy
<replacetokens propertiesResource="${ant.refid:embedded-properties}"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="stripjavacomments">StripJavaComments</h3>
@@ -686,22 +686,22 @@ take in any parameters.
<p>
<h4>Example:</h4>
<blockquote> <pre>
<pre>
<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}">
<filterchain>
<stripjavacomments/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="striplinebreaks">StripLineBreaks</h3>
@@ -725,26 +725,26 @@ from the data supplied to it.
<h4>Examples:</h4>
This strips the '\r' and '\n' characters.
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.contents}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.contents}">
<filterchain>
<striplinebreaks/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This treats the '(' and ')' characters as line break characters and
strips them.
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.contents}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks">
@@ -752,7 +752,7 @@ strips them.
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="striplinecomments">StripLineComments</h3>
@@ -776,7 +776,7 @@ that represent comments as specified by the user.
<h4>Examples:</h4>
This removes all lines that begin with #, --, REM, rem and //
<blockquote> <pre>
<pre>
<filterreader classname="org.apache.tools.ant.filters.StripLineComments">
<param type="comment" value="#"/>
<param type="comment" value="--"/>
@@ -784,10 +784,10 @@ This removes all lines that begin with #, --, REM, rem and //
<param type="comment" value="rem "/>
<param type="comment" value="//"/>
</filterreader>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<striplinecomments>
<comment value="#"/>
<comment value="--"/>
@@ -795,7 +795,7 @@ Convenience method:
<comment value="rem "/>
<comment value="//"/>
</striplinecomments>
</pre></blockquote>
</pre>
<h3 id="tabstospaces">TabsToSpaces</h3>
@@ -817,22 +817,22 @@ This filter replaces tabs with spaces
<h4>Examples:</h4>
This replaces tabs in ${src.file} with spaces.
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.notab}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.TabsToSpaces"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.notab}">
<filterchain>
<tabstospaces/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="tailfilter">TailFilter</h3>
@@ -931,7 +931,7 @@ This graphic shows the dependencies:
<h4>Examples:</h4>
This stores the last 15 lines of the supplied data in the property ${src.file.tail}
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.tail}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.TailFilter">
@@ -939,20 +939,20 @@ This stores the last 15 lines of the supplied data in the property ${src.file.ta
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.tail}">
<filterchain>
<tailfilter lines="15"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This stores the last 5 lines of the first 15 lines of the supplied
data in the property ${src.file.mid}
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.mid}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
@@ -963,28 +963,28 @@ data in the property ${src.file.mid}
</filterreader>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
Convenience method:
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="${src.file.mid}">
<filterchain>
<headfilter lines="15"/>
<tailfilter lines="5"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
This stores the last 10 lines, skipping the last 2 lines, of the supplied data
in the property src.file.head. (Means: if supplied data contains 60 lines,
lines 49-58 are extracted)
<blockquote> <pre>
<pre>
<loadfile srcfile="${src.file}" property="src.file.head">
<filterchain>
<tailfilter lines="10" skip="2"/>
</filterchain>
</loadfile>
</pre></blockquote>
</pre>
<h3 id="deletecharacters">DeleteCharacters</h3>
@@ -1011,9 +1011,9 @@ lines 49-58 are extracted)
<h4>Examples:</h4>
Delete tabs and returns from the data.
<blockquote> <pre>
<pre>
<deletecharacters chars="\t\r"/>
</pre></blockquote>
</pre>
<h3 id="concatfilter">ConcatFilter</h3>
<p>This filter prepends or appends the content file to the filtered files.</p>
@@ -1044,18 +1044,18 @@ Delete tabs and returns from the data.
<h4>Examples:</h4>
Do nothing:
<blockquote> <pre>
<pre>
<filterchain>
<concatfilter/>
</filterchain>
</pre></blockquote>
</pre>
Adds a license text before each java source:
<blockquote> <pre>
<pre>
<filterchain>
<concatfilter prepend="apache-license-java.txt"/>
</filterchain>
</pre></blockquote>
</pre>
<h3 id="sortfilter">SortFilter</h3>
<p><em>since Ant 1.8.0</em></p>
@@ -1094,14 +1094,14 @@ Adds a license text before each java source:
<h4>Examples:</h4>
<blockquote> <pre>
<pre>
<copy todir="build">
<fileset dir="input" includes="*.txt"/>
<filterchain>
<sortfilter/>
</filterchain>
</copy>
</pre></blockquote>
</pre>
<p>
Sort all files <code>*.txt</code> from <i>src</i> location
@@ -1110,21 +1110,21 @@ ascendant order comparing the lines via the
<code>String.compareTo(Object o)</code> method.
</p>
<blockquote> <pre>
<pre>
<copy todir="build">
<fileset dir="input" includes="*.txt"/>
<filterchain>
<sortfilter reverse="true"/>
</filterchain>
</copy>
</pre></blockquote>
</pre>
<p>
Sort all files <code>*.txt</code> from <i>src</i> location into reverse
order and copy them into <i>build</i> location.
</p>
<blockquote> <pre>
<pre>
<copy todir="build">
<fileset dir="input" includes="*.txt"/>
<filterchain>
@@ -1133,7 +1133,7 @@ order and copy them into <i>build</i> location.
</filterreader>
</filterchain>
</copy>
</pre></blockquote>
</pre>
<p>
Sort all files <code>*.txt</code> from <i>src</i> location using as
@@ -1157,7 +1157,7 @@ implement <code>java.util.Comparator</code> interface, for example:
<p>The example above is equivalent to:</p>
<blockquote> <pre>
<pre>
<componentdef name="evenfirst"
classname="org.apache.tools.ant.filters.EvenFirstCmp"/>
<copy todir="build">
@@ -1168,7 +1168,7 @@ implement <code>java.util.Comparator</code> interface, for example:
</sortfilter>
</filterchain>
</copy>
</pre></blockquote>
</pre>
<h3 id="tokenfilter">TokenFilter</h3>
This filter tokenizes the inputstream into strings and passes these
@@ -1274,17 +1274,17 @@ This is the default tokenizer.
<h5>Examples:</h5>
Convert input current line endings to unix style line endings.
<blockquote> <pre>
<pre>
<tokenfilter delimoutput="\n"/>
</pre></blockquote>
</pre>
Remove blank lines.
<blockquote> <pre>
<pre>
<tokenfilter>
<ignoreblank/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="filetokenizer">FileTokenizer</h4>
This tokenizer treats <b>all</b> the input as a token. So be
@@ -1292,14 +1292,14 @@ careful not to use this on very large input.
<h5>Examples:</h5>
Replace the first occurrence of package with //package.
<blockquote> <pre>
<pre>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="([\n\r]+[ \t]*|^[ \t]*)package"
flags="s"
replace="\1//package"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="stringtokenizer">StringTokenizer</h4>
This tokenizer is based on java.util.StringTokenizer.
@@ -1353,13 +1353,13 @@ attribute is used).
Surround each non space token with a "[]".
<blockquote> <pre>
<pre>
<tokenfilter>
<stringtokenizer/>
<replaceregex pattern="(.+)" replace="[\1]"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="replacestring">ReplaceString</h4>
This is a simple filter to replace strings.
@@ -1389,11 +1389,11 @@ This filter may be used directly within a filterchain.
Replace "sun" with "moon".
<blockquote> <pre>
<pre>
<tokenfilter>
<replacestring from="sun" to="moon"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="containsstring">ContainsString</h4>
This is a simple filter to filter tokens that contains
@@ -1416,12 +1416,12 @@ a specified string.
Include only lines that contain "foo";
<blockquote> <pre>
<pre>
<tokenfilter>
<containsstring contains="foo"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="replaceregex">ReplaceRegex</h4>
This string filter replaces regular expressions.
@@ -1461,12 +1461,12 @@ for an explanation of regex flags.</td>
Replace all occurrences of "hello" with "world", ignoring case.
<blockquote> <pre>
<pre>
<tokenfilter>
<replaceregex pattern="hello" replace="world" flags="gi"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="containsregex">ContainsRegex</h4>
This filters strings that match regular expressions.
@@ -1509,23 +1509,23 @@ for an explanation of regex flags.</td>
Filter lines that contain "hello" or "world", ignoring case.
<blockquote> <pre>
<pre>
<tokenfilter>
<containsregex pattern="(hello|world)" flags="i"/>
</tokenfilter>
</pre></blockquote>
</pre>
This example replaces lines like "SUITE(TestSuite, bits);" with
"void register_bits();" and removes other lines.
<blockquote> <pre>
<pre>
<tokenfilter>
<containsregex
pattern="^ *SUITE\(.*,\s*(.*)\s*\).*"
replace="void register_\1();"/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="trim">Trim</h4>
This filter trims whitespace from the start and end of
@@ -1557,14 +1557,14 @@ This filter deletes specified characters from tokens.
Delete tabs from lines, trim the lines and removes empty lines.
<blockquote> <pre>
<pre>
<tokenfilter>
<deletecharacters chars="\t"/>
<trim/>
<ignoreblank/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="uniqfilter">UniqFilter</h4>
@@ -1576,11 +1576,11 @@ Delete tabs from lines, trim the lines and removes empty lines.
<h5>Example:</h5>
This suppresses duplicate lines.
<blockquote> <pre>
<pre>
<tokenfilter>
<uniqfilter/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="native2asciifilter">Native2AsciiFilter</h4>
@@ -1609,11 +1609,11 @@ This suppresses duplicate lines.
<h5>Example:</h5>
<p>This replaces all non-ASCII characters by their Unicode-escapes.</p>
<blockquote> <pre>
<pre>
<tokenfilter>
<native2asciifilter/>
</tokenfilter>
</pre></blockquote>
</pre>
<h4 id="scriptfilter">ScriptFilter</h4>
<p>
@@ -1694,18 +1694,17 @@ Must be a supported Apache BSF or JSR 223 language</td>
<h5>Examples:</h5>
Convert to uppercase:
<blockquote> <pre>
<pre>
<tokenfilter>
<scriptfilter language="javascript">
self.setToken(self.getToken().toUpperCase());
</scriptfilter>
</tokenfilter>
</pre></blockquote>
</pre>
Remove lines containing the string "bad" while
copying text files:
<blockquote>
<pre>
<pre>
<copy todir="dist">
<fileset dir="src" includes="**/*.txt"/>
<filterchain>
@@ -1716,8 +1715,7 @@ copying text files:
</scriptfilter>
</filterchain>
</copy>
</pre>
</blockquote>
</pre>
<h4 id="custom">Custom tokenizers and string filters</h4>
@@ -1727,7 +1725,7 @@ and org.apache.tools.ant.util.Tokenizer respectly.
They are defined in the build file using <code><typedef/></code>. For
example a string filter that capitalizes words may be declared as:
<blockquote> <pre>
<pre>
package my.customant;
import org.apache.tools.ant.filters.TokenFilter;
@@ -1741,10 +1739,10 @@ public class Capitalize
token.substring(1);
}
}
</pre></blockquote>
</pre>
This may be used as follows:
<blockquote> <pre>
<pre>
<typedef name="capitalize" classname="my.customant.Capitalize"
classpath="my.customant.path"/>
<copy file="input" tofile="output">
@@ -1755,6 +1753,7 @@ This may be used as follows:
</tokenfilter>
</filterchain>
</copy>
</pre></blockquote>
</pre>
</body></html>
</body>
</html>