<headfilter>
(Of type HeadFilter )
Reads the first
n
lines of a stream.
(Default is first 10 lines.)
Example:
<headfilter lines="3"/>
Or:
<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
<param name="lines" value="3"/>
</filterreader>
Attribute |
Description |
Type |
Required |
lines |
Sets the number of lines to be returned in the filtered stream.
|
long
|
?
|
skip |
Sets the number of lines to be skipped in the filtered stream.
|
long
|
?
|
<classconstants>
(Of type ClassConstants )
Assembles the constants declared in a Java class in
key1=value1(line separator)key2=value2
format.
Notes:
- This filter uses the BCEL external toolkit.
- This assembles only those constants that are not created
using the syntax
new whatever()
- This assembles constants declared using the basic datatypes
and String only.
- The access modifiers of the declared constants do not matter.
Example:
<classconstants/>
Or:
<filterreader
classname="org.apache.tools.ant.filters.ClassConstants"/>
Attribute |
Description |
Type |
Required |
<linecontains>
(Of type LineContains )
Filter which includes only those lines that contain all the user-specified
strings.
Example:
<linecontains>
<contains value="foo">
<contains value="bar">
</linecontains>
Or:
<filterreader classname="org.apache.tools.ant.filters.LineContains">
<param type="contains" value="foo"/>
<param type="contains" value="bar"/>
</filterreader>
This will include only those lines that contain
foo
and
bar
.
Attribute |
Description |
Type |
Required |
An AntFileReader is a wrapper class that encloses the classname
and configuration of a Configurable FilterReader.
Attribute |
Description |
Type |
Required |
classpath |
Set the classpath to load the FilterReader through (attribute).
|
Path
|
?
|
classpathref |
Set the classpath to load the FilterReader through via
reference (attribute).
|
Reference
|
?
|
refid |
Makes this instance in effect a reference to another AntFilterReader
instance.
You must not set another attribute or nest elements inside
this element if you make it a reference.
|
Reference
|
?
|
classname |
|
String
|
?
|
<replaceregex>
(Of type TokenFilter.ReplaceRegex )
filter to replace regex.
Attribute |
Description |
Type |
Required |
flags |
|
String
|
?
|
byline |
|
boolean
|
?
|
replace |
the to attribute
|
String
|
?
|
pattern |
the from attribute
|
String
|
?
|
<replacetokens>
(Of type ReplaceTokens )
Replaces tokens in the original input with user-supplied values.
Example:
<replacetokens begintoken="#" endtoken="#">
<token key="DATE" value="${TODAY}"/>
</replacetokens>
Or:
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
<param type="tokenchar" name="begintoken" value="#"/>
<param type="tokenchar" name="endtoken" value="#"/>
<param type="token" name="DATE" value="${TODAY}"/>
</filterreader>
Attribute |
Description |
Type |
Required |
begintoken |
Sets the "begin token" character.
|
char
|
?
|
endtoken |
Sets the "end token" character.
|
char
|
?
|
<escapeunicode>
(Of type EscapeUnicode )
This method converts non-latin characters to unicode escapes.
Useful to load properties containing non latin
Example:
<escapeunicode>
Or:
<filterreader
classname="org.apache.tools.ant.filters.EscapeUnicode"/>
Attribute |
Description |
Type |
Required |
<ignoreblank>
(Of type TokenFilter.IgnoreBlank )
Filter remove empty tokens
Attribute |
Description |
Type |
Required |
byline |
|
boolean
|
?
|
<tailfilter>
(Of type TailFilter )
Reads the last
n
lines of a stream. (Default is last10 lines.)
Example:
<tailfilter lines="3"/>
Or:
<filterreader classname="org.apache.tools.ant.filters.TailFilter">
<param name="lines" value="3"/>
</filterreader>
Attribute |
Description |
Type |
Required |
lines |
Sets the number of lines to be returned in the filtered stream.
|
long
|
?
|
skip |
Sets the number of lines to be skipped in the filtered stream.
|
long
|
?
|
<tabstospaces>
(Of type TabsToSpaces )
Converts tabs to spaces.
Example:
<tabtospaces tablength="8"/>
Or:
<filterreader classname="org.apache.tools.ant.filters.TabsToSpaces">
<param name="tablength" value="8"/>
</filterreader>
Attribute |
Description |
Type |
Required |
tablength |
Sets the tab length.
|
int
|
?
|
<prefixlines>
(Of type PrefixLines )
Attaches a prefix to every line.
Example:
<prefixlines prefix="Foo"/>
Or:
<filterreader classname="org.apache.tools.ant.filters.PrefixLines">
<param name="prefix" value="Foo"/>
</filterreader>
Attribute |
Description |
Type |
Required |
prefix |
Sets the prefix to add at the start of each input line.
|
String
|
?
|
<trim>
(Of type TokenFilter.Trim )
Filter to trim white space
Attribute |
Description |
Type |
Required |
byline |
|
boolean
|
?
|
<expandproperties>
(Of type ExpandProperties )
Expands Ant properties, if any, in the data.
Example:
<expandproperties/>
Or:
<filterreader
classname="org.apache.tools.ant.filters.ExpandProperties"/>
Attribute |
Description |
Type |
Required |
<striplinebreaks>
(Of type StripLineBreaks )
Filter to flatten the stream to a single line.
Example:
<striplinebreaks/>
Or:
<filterreader
classname="org.apache.tools.ant.filters.StripLineBreaks"/>
Attribute |
Description |
Type |
Required |
linebreaks |
Sets the line-breaking characters.
|
String
|
?
|
<replacestring>
(Of type TokenFilter.ReplaceString )
Simple replace string filter.
Attribute |
Description |
Type |
Required |
byline |
|
boolean
|
?
|
from |
the from attribute
|
String
|
?
|
to |
the to attribute
|
String
|
?
|
<striplinecomments>
(Of type StripLineComments )
This filter strips line comments.
Example:
<striplinecomments>
<comment value="#"/>
<comment value="--"/>
<comment value="REM "/>
<comment value="rem "/>
<comment value="//"/>
</striplinecomments>
Or:
<filterreader
classname="org.apache.tools.ant.filters.StripLineComments">
<param type="comment" value="#"/>
<param type="comment" value="--"/>
<param type="comment" value="REM "/>
<param type="comment" value="rem "/>
<param type="comment" value="//"/>
</filterreader>
Attribute |
Description |
Type |
Required |
<tokenfilter>
(Of type TokenFilter )
This splits up input into tokens and passes
the tokens to a sequence of filters.
Attribute |
Description |
Type |
Required |
delimoutput |
set the output delimiter.
|
String
|
?
|
<stripjavacomments>
(Of type StripJavaComments )
This is a Java comment and string stripper reader that filters
those lexical tokens out for purposes of simple Java parsing.
(if you have more complex Java parsing needs, use a real lexer).
Since this class heavily relies on the single char read function,
you are recommended to make it work on top of a buffered reader.
Attribute |
Description |
Type |
Required |
<containsregex>
(Of type TokenFilter.ContainsRegex )
filter to filter tokens matching regular expressions.
Attribute |
Description |
Type |
Required |
flags |
|
String
|
?
|
byline |
|
boolean
|
?
|
replace |
|
String
|
?
|
pattern |
|
String
|
?
|
<deletecharacters>
(Of type TokenFilter.DeleteCharacters )
Filter to delete characters
Attribute |
Description |
Type |
Required |
chars |
Set the list of characters to delete
|
String
|
?
|
<linecontainsregexp>
(Of type LineContainsRegExp )
Filter which includes only those lines that contain the user-specified
regular expression matching strings.
Example:
<linecontainsregexp>
<regexp pattern="foo*">
</linecontainsregexp>
Or:
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
<param type="regexp" value="foo*"/>
</filterreader>
This will fetch all those lines that contain the pattern
foo
Attribute |
Description |
Type |
Required |