Package com.norconex.commons.lang.io
Class RegexInputStreamFilter
- java.lang.Object
-
- com.norconex.commons.lang.io.RegexInputStreamFilter
-
- All Implemented Interfaces:
IInputStreamFilter
public class RegexInputStreamFilter extends Object implements IInputStreamFilter
Filters lines of text read from an InputStream decorated withFilteredInputStream, based on a given regular expression.- Author:
- Pascal Essiembre
- See Also:
Pattern
-
-
Constructor Summary
Constructors Constructor Description RegexInputStreamFilter(String regex)Constructor.RegexInputStreamFilter(Pattern pattern)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(String string)Whether a line is "accepted" or not.
-
-
-
Method Detail
-
accept
public boolean accept(String string)
Description copied from interface:IInputStreamFilterWhether a line is "accepted" or not. An accepted line is being returned when read.- Specified by:
acceptin interfaceIInputStreamFilter- Parameters:
string- line being read- Returns:
trueif line is accepted
-
-