|
|
@@ -0,0 +1,231 @@ |
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|
|
|
|
|
|
|
<HTML> |
|
|
|
<HEAD> |
|
|
|
<TITLE>FilterReaderSet Type</TITLE> |
|
|
|
</HEAD> |
|
|
|
|
|
|
|
<BODY> |
|
|
|
<H2><A name="filterreaderset">FilterReaderSet</A></H2> |
|
|
|
|
|
|
|
<P>FilterReaderSets are groups of FilterReaders. FilterReaderSets can appear |
|
|
|
inside tasks that support this feature. <BR>FilterReaderSets are used for |
|
|
|
filtering file contents read in by tasks like LoadFile, etc.<BR> |
|
|
|
|
|
|
|
Each FilterReaderSet is composed of nested <a name="filterreader">FilterReader</a> elements. |
|
|
|
|
|
|
|
<H2>FilterReader</H2> |
|
|
|
|
|
|
|
A FilterReader element must be supplied with a class name as |
|
|
|
an attribute value. The class resolved by this name must |
|
|
|
extend java.io.FilterReader. If the custom filter reader |
|
|
|
needs to be parameterized, it must implement |
|
|
|
org.apache.tools.type.Parameterizable. |
|
|
|
|
|
|
|
<TABLE cellSpacing=0 cellPadding=2 border=1> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top><B>Attribute</B></TD> |
|
|
|
<TD vAlign=top><B>Description</B></TD> |
|
|
|
<TD vAlign=top align="center"><B>Required</B></TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>classname</TD> |
|
|
|
<TD vAlign=top>The class name of the filter reader.</TD> |
|
|
|
<TD vAlign=top align="center">Yes</TD> |
|
|
|
</TR> |
|
|
|
</TABLE> |
|
|
|
|
|
|
|
<p> |
|
|
|
The following FilterReaders are supplied with the default |
|
|
|
distribution. |
|
|
|
|
|
|
|
<H3>org.apache.tools.ant.filters.<a name="striplinebreaks">StripLineBreaks</a></H3> |
|
|
|
|
|
|
|
This filter reader strips away specific characters |
|
|
|
from the data supplied to it. |
|
|
|
|
|
|
|
<TABLE cellSpacing=0 cellPadding=2 border=1> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top><B>Parameter Name</B></TD> |
|
|
|
<TD vAlign=top><B>Parameter Value</B></TD> |
|
|
|
<TD vAlign=top align="center"><B>Required</B></TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>linebreaks</TD> |
|
|
|
<TD vAlign=top align="center">Characters that are to |
|
|
|
be stripped out. Defaults to "\r\n"</TD> |
|
|
|
<TD vAlign=top align="center">No</TD> |
|
|
|
</TR> |
|
|
|
</TABLE> |
|
|
|
<P> |
|
|
|
<H4>Examples:</H4> |
|
|
|
|
|
|
|
This strips the '\r' and '\n' characters. |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.contents}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"/> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
This treats the '(' and ')' characters as line break characters and |
|
|
|
strips them. |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.contents}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.StripLineBreaks"> |
|
|
|
<param name="linebreaks" value="()"/> |
|
|
|
</filterreader> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
<H3>org.apache.tools.ant.filters.<a name="stripjavacomments">StripJavaComments</a></H3> |
|
|
|
|
|
|
|
This filter reader strips away comments from the data, |
|
|
|
using Java syntax guidelines. This filter does not |
|
|
|
take in any parameters. |
|
|
|
<P> |
|
|
|
<H4>Example:</H4> |
|
|
|
|
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${java.src.file}" property="${java.src.file.nocomments}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
<H3>org.apache.tools.ant.filters.<a name="replacetokens">ReplaceTokens</a></H3> |
|
|
|
|
|
|
|
This filter reader replaces all strings that are |
|
|
|
sandwiched between begintoken and endtoken with |
|
|
|
user defined values. |
|
|
|
|
|
|
|
<TABLE cellSpacing=0 cellPadding=2 border=1> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top><B>Parameter Type</B></TD> |
|
|
|
<TD vAlign=top><B>Parameter Name</B></TD> |
|
|
|
<TD vAlign=top><B>Parameter Value</B></TD> |
|
|
|
<TD vAlign=top align="center"><B>Required</B></TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>tokenchar</TD> |
|
|
|
<TD vAlign=top>begintoken</TD> |
|
|
|
<TD vAlign=top>Character marking the |
|
|
|
beginning of a token. Defaults to @</TD> |
|
|
|
<TD vAlign=top align="center">No</TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>tokenchar</TD> |
|
|
|
<TD vAlign=top>endtoken</TD> |
|
|
|
<TD vAlign=top>Character marking the |
|
|
|
end of a token. Defaults to @</TD> |
|
|
|
<TD vAlign=top align="center">No</TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>token</TD> |
|
|
|
<TD vAlign=top>User defined String.</TD> |
|
|
|
<TD vAlign=top>User defined search String</TD> |
|
|
|
<TD vAlign=top align="center">Yes</TD> |
|
|
|
</TR> |
|
|
|
</TABLE> |
|
|
|
<P> |
|
|
|
|
|
|
|
<H4>Example</H4> |
|
|
|
|
|
|
|
This replaces occurences of the string @DATE@ in the data |
|
|
|
with today's date and stores it in the property ${src.file.replaced} |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<tstamp/> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.replaced}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens"> |
|
|
|
<param type="token" name="DATE" value="${TODAY}"/> |
|
|
|
<filterreader/> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
<H3>org.apache.tools.ant.filters.<a name="headfilter">HeadFilter</a></H3> |
|
|
|
|
|
|
|
This filter reads the first few lines from the data supplied to it. |
|
|
|
|
|
|
|
<TABLE cellSpacing=0 cellPadding=2 border=1> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top><B>Parameter Name</B></TD> |
|
|
|
<TD vAlign=top><B>Parameter Value</B></TD> |
|
|
|
<TD vAlign=top align="center"><B>Required</B></TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>lines</TD> |
|
|
|
<TD vAlign=top align="center">Number of lines to be read. |
|
|
|
Defaults to "10"</TD> |
|
|
|
<TD vAlign=top align="center">No</TD> |
|
|
|
</TR> |
|
|
|
</TABLE> |
|
|
|
<P> |
|
|
|
<H4>Example:</H4> |
|
|
|
|
|
|
|
This stores the first 15 lines of the supplied data in the property ${src.file.head} |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.head}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.HeadFilter"> |
|
|
|
<param name="lines" value="15"/> |
|
|
|
</filterreader> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
<H3>org.apache.tools.ant.filters.<a name="tailfilter">TailFilter</a></H3> |
|
|
|
|
|
|
|
This filter reads the last few lines from the data supplied to it. |
|
|
|
|
|
|
|
<TABLE cellSpacing=0 cellPadding=2 border=1> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top><B>Parameter Name</B></TD> |
|
|
|
<TD vAlign=top><B>Parameter Value</B></TD> |
|
|
|
<TD vAlign=top align="center"><B>Required</B></TD> |
|
|
|
</TR> |
|
|
|
<TR> |
|
|
|
<TD vAlign=top>lines</TD> |
|
|
|
<TD vAlign=top align="center">Number of lines to be read. |
|
|
|
Defaults to "10"</TD> |
|
|
|
<TD vAlign=top align="center">No</TD> |
|
|
|
</TR> |
|
|
|
</TABLE> |
|
|
|
<P> |
|
|
|
<H4>Examples:</H4> |
|
|
|
|
|
|
|
This stores the last 15 lines of the supplied data in the property ${src.file.tail} |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.tail}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.TailFilter"> |
|
|
|
<param name="lines" value="15"/> |
|
|
|
</filterreader> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
This stores the last 5 lines of the first 15 lines of the supplied |
|
|
|
data in the property ${src.file.mid} |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<loadfile srcfile="${src.file}" property="${src.file.mid}"> |
|
|
|
<filterreaderset> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.HeadFilter"> |
|
|
|
<param name="lines" value="15"/> |
|
|
|
</filterreader> |
|
|
|
<filterreader classname="org.apache.tools.ant.filters.TailFilter"> |
|
|
|
<param name="lines" value="5"/> |
|
|
|
</filterreader> |
|
|
|
</filterreaderset> |
|
|
|
</loadfile> |
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
<HR> |
|
|
|
|
|
|
|
<P align=center>Copyright © 2001 Apache Software Foundation. All rights |
|
|
|
Reserved.</P></BODY></HTML> |