java.io.Closeable
, java.lang.AutoCloseable
, java.lang.Readable
, ChainableReader
, Parameterizable
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 | Description |
---|---|
LineContainsRegExp() |
Constructor for "dummy" instances.
|
LineContainsRegExp(java.io.Reader in) |
Creates a new filtered reader.
|
Modifier and Type | Method | 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 casesensitively.
|
void |
setNegate(boolean b) |
Set the negation mode.
|
void |
setRegexp(java.lang.String pattern) |
Set the regular expression as an attribute.
|
getInitialized, getProject, read, readFully, readLine, setInitialized, setProject, skip
getParameters, setParameters
public LineContainsRegExp()
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)
b
- booleanpublic boolean isNegated()
public void setRegexp(java.lang.String pattern)
pattern
- String