<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
| Modifier and Type | Field and Description |
|---|---|
| private static final String | CS_KEY
Parameter name for the casesensitive attribute. |
| private String | line
Remaining line to be read from this filter, or |
| private boolean | |
| private static final String | NEGATE_KEY
Parameter name for the negate attribute. |
| private static final String | REGEXP_KEY
Parameter name for the regular expression to filter on. |
| private int | |
| private Vector | regexps
Vector that holds the expressions that input lines must contain. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | LineContainsRegExp(final Reader
A Reader object providing the underlying stream.
Must not be in)null.Creates a new filtered reader. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addConfiguredRegexp(final RegularExpression
The regExp)regexp element to add.
Must not be null.Adds a |
| public Reader | Returns: a new filter based on this configuration, but filtering the specified readerA Reader object providing the underlying stream.
Must not be rdr)null.Implements org. |
| private Vector | Returns: the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. The returned object is "live" - in other words, changes made to the returned object are mirrored in the filter.Returns the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. |
| private void | |
| public boolean | |
| public int | Returns: the next character in the resulting stream, or -1 if the end of the resulting stream has been reachedOverrides java. |
| public void | |
| public void | |
| public void | |
| private void | setRegexps(final Vector<RegularExpression>
A vector of regular expressions which must be contained
within a line in order for it to match in this filter. Must not be
regexps)null.Sets the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter. |
| CS_KEY | back to summary |
|---|---|
| private static final String CS_KEY Parameter name for the casesensitive attribute. | |
| line | back to summary |
|---|---|
| private String line Remaining line to be read from this filter, or | |
| negate | back to summary |
|---|---|
| private boolean negate | |
| NEGATE_KEY | back to summary |
|---|---|
| private static final String NEGATE_KEY Parameter name for the negate attribute. | |
| REGEXP_KEY | back to summary |
|---|---|
| private static final String REGEXP_KEY Parameter name for the regular expression to filter on. | |
| regexpOptions | back to summary |
|---|---|
| private int regexpOptions | |
| regexps | back to summary |
|---|---|
| private Vector<RegularExpression> regexps Vector that holds the expressions that input lines must contain. | |
| LineContainsRegExp | back to summary |
|---|---|
| public LineContainsRegExp() Constructor for "dummy" instances.
| |
| LineContainsRegExp | back to summary |
|---|---|
| public LineContainsRegExp(final Reader in) Creates a new filtered reader.
| |
| addConfiguredRegexp | back to summary |
|---|---|
| public void addConfiguredRegexp(final RegularExpression regExp) Adds a
| |
| chain | back to summary |
|---|---|
| public Reader chain(final Reader rdr) Implements org. Creates a new LineContainsRegExp using the passed in Reader for instantiation. | |
| getRegexps | back to summary |
|---|---|
| private Vector Returns the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter.
| |
| initialize | back to summary |
|---|---|
| private void initialize() Parses parameters to add user defined regular expressions. | |
| isNegated | back to summary |
|---|---|
| public boolean isNegated() Find out whether we have been negated.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Returns the next character in the filtered stream, only including lines from the original stream which match all of the specified regular expressions.
| |
| setCaseSensitive | back to summary |
|---|---|
| public void setCaseSensitive(boolean b) Whether to match casesensitively.
| |
| setNegate | back to summary |
|---|---|
| public void setNegate(boolean b) Set the negation mode. Default false (no negation).
| |
| setRegexp | back to summary |
|---|---|
| public void setRegexp(String pattern) Set the regular expression as an attribute.
| |
| setRegexps | back to summary |
|---|---|
| private void setRegexps(final Vector<RegularExpression> regexps) Sets the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter.
| |