public final class LineContainsRegExp extends BaseParamFilterReader implements ChainableReader
<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
Constructor and Description |
---|
LineContainsRegExp()
Constructor for "dummy" instances.
|
LineContainsRegExp(java.io.Reader in)
Creates a new filtered reader.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfiguredRegexp(RegularExpression regExp)
Adds a
regexp element. |
java.io.Reader |
chain(java.io.Reader rdr)
Creates a new LineContainsRegExp using the passed in
Reader for instantiation.
|
boolean |
isNegated()
Find out whether we have been negated.
|
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.
|
void |
setCaseSensitive(boolean b)
Whether to match casesensitevly.
|
void |
setNegate(boolean b)
Set the negation mode.
|
getParameters, setParameters
getInitialized, getProject, read, readFully, readLine, setInitialized, setProject, skip
public LineContainsRegExp()
BaseFilterReader.BaseFilterReader()
public LineContainsRegExp(java.io.Reader in)
in
- A Reader object providing the underlying stream.
Must not be null
.public int read() throws java.io.IOException
read
in class java.io.FilterReader
java.io.IOException
- if the underlying stream throws an IOException
during readingpublic void addConfiguredRegexp(RegularExpression regExp)
regexp
element.regExp
- The regexp
element to add.
Must not be null
.public java.io.Reader chain(java.io.Reader rdr)
chain
in interface ChainableReader
rdr
- A Reader object providing the underlying stream.
Must not be null
.public void setNegate(boolean b)
b
- the boolean negation mode to set.public void setCaseSensitive(boolean b)
public boolean isNegated()