org.apache.tools.ant.filters
public class TokenFilter extends BaseFilterReader implements ChainableReader
Since: Ant 1.6
See Also: BaseFilterReader ChainableReader DynamicConfigurator
Nested Class Summary | |
---|---|
abstract static class | TokenFilter.ChainableReaderFilter
Abstract class that converts derived filter classes into
ChainableReaderFilter's |
static class | TokenFilter.ContainsRegex
filter to filter tokens matching regular expressions. |
static class | TokenFilter.ContainsString
Simple filter to filter lines contains strings |
static class | TokenFilter.DeleteCharacters
Filter to delete characters |
static class | TokenFilter.FileTokenizer
class to read the complete input into a string |
interface | TokenFilter.Filter
string filters implement this interface |
static class | TokenFilter.IgnoreBlank Filter remove empty tokens |
static class | TokenFilter.ReplaceRegex
filter to replace regex. |
static class | TokenFilter.ReplaceString
Simple replace string filter. |
static class | TokenFilter.StringTokenizer
class to tokenize the input as areas separated
by white space, or by a specified list of
delim characters. |
static class | TokenFilter.Trim Filter to trim white space |
Constructor Summary | |
---|---|
TokenFilter()
Constructor for "dummy" instances.
| |
TokenFilter(Reader in)
Creates a new filtered reader.
|
Method Summary | |
---|---|
void | add(Tokenizer tokenizer)
add an arbitrary tokenizer |
void | add(TokenFilter.Filter filter)
Add an arbitrary filter |
void | addContainsRegex(TokenFilter.ContainsRegex filter)
contains regex filter |
void | addContainsString(TokenFilter.ContainsString filter)
contains string filter |
void | addDeleteCharacters(TokenFilter.DeleteCharacters filter)
delete chars |
void | addFileTokenizer(TokenFilter.FileTokenizer tokenizer)
add a file tokenizer |
void | addIgnoreBlank(TokenFilter.IgnoreBlank filter)
ignore blank filter |
void | addLineTokenizer(LineTokenizer tokenizer)
add a line tokenizer - this is the default. |
void | addReplaceRegex(TokenFilter.ReplaceRegex filter)
replace regex filter |
void | addReplaceString(TokenFilter.ReplaceString filter)
replace string filter |
void | addStringTokenizer(TokenFilter.StringTokenizer tokenizer)
add a string tokenizer |
void | addTrim(TokenFilter.Trim filter)
trim filter |
Reader | chain(Reader reader)
Creates a new TokenFilter using the passed in
Reader for instantiation.
|
static int | convertRegexOptions(String flags)
convert regex option flag characters to regex options
|
int | read()
Returns the next character in the filtered stream, only including
lines from the original stream which match all of the specified
regular expressions.
|
static String | resolveBackSlash(String input)
xml does not do "c" like interpretation of strings.
i.e. |
void | setDelimOutput(String delimOutput)
set the output delimiter. |
See Also: BaseFilterReader
Parameters: in A Reader object providing the underlying stream.
Must not be null
.
Parameters: tokenizer the tokenizer to all, only one allowed
Parameters: filter the filter to add
Parameters: filter the contains regex filter
Parameters: filter the contains string filter
Parameters: filter the delete characters filter
Parameters: tokenizer the file tokenizer
Parameters: filter the ignore blank filter
Parameters: tokenizer the line tokenizer
Parameters: filter the replace regex filter
Parameters: filter the replace string filter
Parameters: tokenizer the string tokenizer
Parameters: filter the trim filter
Parameters: reader A Reader object providing the underlying stream.
Returns: a new filter based on this configuration
Parameters: flags the string containing the flags
Returns: the Regexp option bits
Returns: the next character in the resulting stream, or -1 if the end of the resulting stream has been reached
Throws: IOException if the underlying stream throws an IOException during reading
Parameters: input raw string with possible embedded '\'s
Returns: converted string
Parameters: delimOutput replaces the delim string returned by the tokenizer, if present.