com.norconex.commons.lang.io
Class RegexInputStreamFilter

java.lang.Object
  extended by 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 with FilteredInputStream, based on a given regular expression.

Author:
Pascal Essiembre

Constructor Summary
RegexInputStreamFilter(Pattern pattern)
           
RegexInputStreamFilter(String regex)
           
 
Method Summary
 boolean accept(String string)
          Whether a line is "accepted" or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexInputStreamFilter

public RegexInputStreamFilter(String regex)

RegexInputStreamFilter

public RegexInputStreamFilter(Pattern pattern)
Method Detail

accept

public boolean accept(String string)
Description copied from interface: IInputStreamFilter
Whether a line is "accepted" or not. An accepted line is being returned when read.

Specified by:
accept in interface IInputStreamFilter
Parameters:
string - line being read
Returns:
true if line is accepted


Copyright © 2008-2013 Norconex Inc.. All Rights Reserved.