From 19731e2b2f86f9b7e0d653592c5062d342e5d823 Mon Sep 17 00:00:00 2001
From: Matthew Jason Benson
Date: Fri, 8 Apr 2005 19:14:34 +0000
Subject: [PATCH] Lower-case HTML tags
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278123 13f79535-47bb-0310-9956-ffa450edef68
---
docs/manual/CoreTypes/filterchain.html | 1228 ++++++++++++------------
1 file changed, 614 insertions(+), 614 deletions(-)
diff --git a/docs/manual/CoreTypes/filterchain.html b/docs/manual/CoreTypes/filterchain.html
index a31d66472..8a37d712b 100644
--- a/docs/manual/CoreTypes/filterchain.html
+++ b/docs/manual/CoreTypes/filterchain.html
@@ -1,28 +1,28 @@
-
-
+
+
-FilterChains and FilterReaders
-
+FilterChains and FilterReaders
+
-
+
-
FilterChains and FilterReaders
+
FilterChains and FilterReaders
Look at Unix pipes - they offer you so much flexibility -
say you wanted to copy just those lines that contained the
string blee from the first 10 lines of a file 'foo'
-to a file 'bar' - you would do something like
+to a file 'bar' - you would do something like
cat foo|head -n10|grep blee > bar
-
+
Ant was not flexible enough. There was no way for the
<copy> task to do something similar. If you wanted
the <copy> task to get the first 10 lines, you would have
-had to create special attributes:
The obvious problem thus surfaced: Ant tasks would not be able
to accommodate such data transformation attributes as they would
be endless. The task would also not know in which order these
@@ -31,7 +31,7 @@ contains attribute first and then the head attribute or vice-versa?
What Ant tasks needed was a mechanism to allow pluggable filter (data
transformer) chains. Ant would provide a few filters for which there
have been repeated requests. Users with special filtering needs
-would be able to easily write their own and plug them in.
+would be able to easily write their own and plug them in.
The solution was to refactor data transformation oriented
tasks to support FilterChains. A FilterChain is a group of
@@ -39,9 +39,9 @@ ordered FilterReaders. Users can define their own FilterReaders
by just extending the java.io.FilterReader class. Such custom
FilterReaders can be easily plugged in as nested elements of
<filterchain> by using <filterreader> elements.
-
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.
+However, they can be declared using some simpler syntax also.
The filterreader element is the generic way to
define a filter. User defined filter elements are
@@ -121,91 +121,91 @@ extend java.io.FilterReader. If the custom filter reader
needs to be parameterized, it must implement
org.apache.tools.type.Parameterizable.
-
-
-
Attribute
-
Description
-
Required
-
-
-
classname
-
The class name of the filter reader.
-
Yes
-
-
-
-
-
Nested Elements:
+
+
+
Attribute
+
Description
+
Required
+
+
+
classname
+
The class name of the filter reader.
+
Yes
+
+
+
+
+
Nested Elements:
<filterreader> supports <classpath> and <param>
as nested elements. Each <param> element may take in the following
attributes - name, type and value.
-
+
The following FilterReaders are supplied with the default
distribution.
-
If the data contains data that represents Ant
properties (of the form ${...}), that is substituted
with the property's actual value.
-
-
Example:
+
+
Example:
This results in the property modifiedmessage holding the value
"All these moments will be lost in time, like teardrops in the rain"
-
+
<echo
message="All these moments will be lost in time, like teardrops in the ${weather}"
file="loadfile1.tmp"
@@ -216,10 +216,10 @@ This results in the property modifiedmessage holding the value
<filterreader classname="org.apache.tools.ant.filters.ExpandProperties"/>
</filterchain>
</loadfile>
-
+
Convenience method:
-
+
<echo
message="All these moments will be lost in time, like teardrops in the ${weather}"
file="loadfile1.tmp"
@@ -230,37 +230,37 @@ Convenience method:
<expandproperties/>
</filterchain>
</loadfile>
-
This filter reads the first few lines from the data supplied to it.
-
-
-
Parameter Name
-
Parameter Value
-
Required
-
-
-
lines
-
Number of lines to be read.
- Defaults to "10" A negative value means that all lines are
- passed (useful with skip)
-
No
-
-
-
skip
-
Number of lines to be skipped (from the beginning).
- Defaults to "0"
-
No
-
-
-
-
Example:
+
+
+
Parameter Name
+
Parameter Value
+
Required
+
+
+
lines
+
Number of lines to be read.
+ Defaults to "10" A negative value means that all lines are
+ passed (useful with skip)
+
No
+
+
+
skip
+
Number of lines to be skipped (from the beginning).
+ Defaults to "0"
+
No
+
+
+
+
Example:
This stores the first 15 lines of the supplied data in the property ${src.file.head}
-
+
<loadfile srcfile="${src.file}" property="${src.file.head}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.HeadFilter">
@@ -268,162 +268,162 @@ This stores the first 15 lines of the supplied data in the property ${src.file.h
</filterreader>
</filterchain>
</loadfile>
-
-See the testcases for more examples (src\etc\testcases\filters\head-tail.xml in the
+See the testcases for more examples (src\etc\testcases\filters\head-tail.xml in the
source distribution).
-
Filter which includes only those lines that contain the user-specified
regular expression matching strings.
See Regexp Type for the description of the nested element regexp and of
the choice of regular expression implementation.
-
Example:
+
Example:
This will fetch all those lines that contain the pattern foo
-
This filter reader replaces all strings that are
sandwiched between begintoken and endtoken with
user defined values.
-
-
-
Parameter Type
-
Parameter Name
-
Parameter Value
-
Required
-
-
-
tokenchar
-
begintoken
-
Character marking the
- beginning of a token. Defaults to @
-
No
-
-
-
tokenchar
-
endtoken
-
Character marking the
- end of a token. Defaults to @
-
No
-
-
-
token
-
User defined String.
-
User defined search String
-
Yes
-
-
-
-
-
Example:
+
+
+
Parameter Type
+
Parameter Name
+
Parameter Value
+
Required
+
+
+
tokenchar
+
begintoken
+
Character marking the
+ beginning of a token. Defaults to @
+
No
+
+
+
tokenchar
+
endtoken
+
Character marking the
+ end of a token. Defaults to @
+
No
+
+
+
token
+
User defined String.
+
User defined search String
+
Yes
+
+
+
+
+
Example:
This replaces occurrences of the string @DATE@ in the data
with today's date and stores it in the property ${src.file.replaced}
-
+
<tstamp/>
<loadfile srcfile="${src.file}" property="${src.file.replaced}">
<filterchain>
@@ -432,10 +432,10 @@ with today's date and stores it in the property ${src.file.replaced}
</filterreader>
</filterchain>
</loadfile>
-
This filter removes all those lines that begin with strings
that represent comments as specified by the user.
-
-
-
Parameter Type
-
Parameter Value
-
Required
-
-
-
comment
-
Strings that identify a line as a comment
- when they appear at the start of the line.
-
Yes
-
-
-
-
Examples:
+
+
+
Parameter Type
+
Parameter Value
+
Required
+
+
+
comment
+
Strings that identify a line as a comment
+ when they appear at the start of the line.
+
Yes
+
+
+
+
Examples:
This removes all lines that begin with #, --, REM, rem and //
-
+
<filterreader classname="org.apache.tools.ant.filters.StripLineComments">
<param type="comment" value="#"/>
<param type="comment" value="--"/>
@@ -552,10 +552,10 @@ This removes all lines that begin with #, --, REM, rem and //
<param type="comment" value="rem "/>
<param type="comment" value="//"/>
</filterreader>
-
This stores the last 15 lines of the supplied data in the property ${src.file.tail}
-
+
<loadfile srcfile="${src.file}" property="${src.file.tail}">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.TailFilter">
@@ -730,21 +730,21 @@ This stores the last 15 lines of the supplied data in the property ${src.file.ta
</filterreader>
</filterchain>
</loadfile>
-
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)
-
This filter tokenizes the inputstream into strings and passes these
strings to filters of strings. Unlike the other filterreaders, this does
not support params, only convenience methods are implemented.
The tokenizer and the string filters are defined by nested elements.
-
since Ant 1.6
-
+
since Ant 1.6
+
Only one tokenizer element may be used, the LineTokenizer is the
default if none are specified. A tokenizer
splits the input into token strings and trailing delimiter strings.
-
+
There may be zero or more string filters. A string filter processes
a token and either returns a string or a null.
It the string is not null it is passed to the next filter. This
@@ -872,30 +872,30 @@ outputs with its associated token delimitier
(if one is present).
The trailing delimiter may be overridden by the delimOutput
attribute.
-
+
blackslash interpretation
A number of attributes (including delimOutput) interpret
backslash escapes. The following are understood: \n, \r, \f, \t
and \\.
-
-
-
Attribute
-
Description
-
Required
-
-
-
delimOutput
-
+
+
+
Attribute
+
Description
+
Required
+
+
+
delimOutput
+
This overrides the tokendelimiter
returned by the tokenizer if it is not empty. This
attribute is backslash enabled.
-
-
No
-
-
-
+
+
No
+
+
+
The following tokenizers are provided by the default distribution.
@@ -925,58 +925,58 @@ case a tokenfilter is created implicitly. An extra attribute "byline"
is added to the filter to specify whether to use a linetokenizer
(byline="true") or a filetokenizer (byline="false"). The default
is "true".
-
This tokenizer is based on java.util.StringTokenizer.
@@ -986,20 +986,20 @@ If the stream starts with delimiter characters, the first
token will be the empty string (unless the delimsaretokens
attribute is used).
-
-
-
Attribute
-
Description
-
Required
-
-
-
delims
-
The delimiter characters. White space
+
+
+
Attribute
+
Description
+
Required
+
+
+
delims
+
The delimiter characters. White space
is used if this is not set. (White space is defined
in this case by java.lang.Character.isWhitespace()).
-
-
No
-
+
+
No
+
delimsaretokens
If this is true,
@@ -1024,35 +1024,35 @@ attribute is used).
This string filter replaces regular expressions.
@@ -1108,42 +1108,42 @@ This filter may be used directly within a filterchain.
concerning the choice of the implementation.
-
-
-
Attribute
-
Description
-
Required
-
-
-
pattern
-
The regular expression pattern to match in
- the token.
-
Yes
-
-
-
replace
-
The substitution pattern to replace the matched
- regular expression. When omitted an empty string is used.
-
No
-
-
-
flags
-
See
+
+
+
Attribute
+
Description
+
Required
+
+
+
pattern
+
The regular expression pattern to match in
+ the token.
+
Yes
+
+
+
replace
+
The substitution pattern to replace the matched
+ regular expression. When omitted an empty string is used.
+
No
+
+
+
flags
+
See
ReplaceRegexp
-for an explanation of regex flags.
-
No
-
-
-
Examples:
+for an explanation of regex flags.
+
No
+
+
+
Examples:
Replace all occurrences of "hello" with "world", ignoring case.
-
This filters strings that match regular expressions.
@@ -1154,55 +1154,55 @@ See
Regexp Type
concerning the choice of regular expression implementation.
-
-
-
Attribute
-
Description
-
Required
-
-
-
pattern
-
The regular expression pattern to match in
- the token.
-
Yes
-
-
-
replace
-
The substitution pattern to replace the matched
+
+
+
Attribute
+
Description
+
Required
+
+
+
pattern
+
The regular expression pattern to match in
+ the token.
+
Yes
+
+
+
replace
+
The substitution pattern to replace the matched
regular expression. When omitted the orignal token is returned.
-
-
No
-
-
-
flags
-
See
+
+
No
+
+
+
flags
+
See
ReplaceRegexp
-for an explanation of regex flags.
-
No
-
-
+for an explanation of regex flags.
+
No
+
+
-
Examples:
+
Examples:
Filter lines that contain "hello" or "world", ignoring case.
-
This is an optional filter that executes a script in a
@@ -1256,37 +1256,37 @@ method replaces the current token.
This filter may be used directly within a filterchain.
-
-
-
Attribute
-
Description
-
Required
-
-
-
language
-
The programming language the script is written in.
-Must be a supported Apache BSF language
-
Yes
-
-
-
src
-
The location of the script as a file, if not inline
-
-
No
-
-
-
-
-
Examples:
+
+
+
Attribute
+
Description
+
Required
+
+
+
language
+
The programming language the script is written in.
+Must be a supported Apache BSF language
+
Yes
+
+
+
src
+
The location of the script as a file, if not inline
+
Remove lines containing the string "bad" while
copying text files:
@@ -1303,7 +1303,7 @@ copying text files:
-
Custom tokenizers and string filters
+
Custom tokenizers and string filters
Custom string filters and tokenizers may be plugged in by
extending the interfaces org.apache.tools.ant.filters.TokenFilter.Filter
@@ -1341,7 +1341,7 @@ This may be used as follows:
</copy>
-
+
-