org.kuali.common.util
Class StringFilter

java.lang.Object
  extended by org.kuali.common.util.StringFilter

public class StringFilter
extends Object

This class provides logic for filtering strings based on regular expressions.


Field Summary
protected  List<Pattern> excludePatterns
           
protected  List<Pattern> includePatterns
           
 
Constructor Summary
protected StringFilter(List<String> includes, List<String> excludes)
           
 
Method Summary
protected  void compilePatterns()
          Compile the string patterns into Pattern objects
 boolean exclude(String s)
          Return true if the string should be excluded.
static StringFilter getInstance(List<String> includes, List<String> excludes)
           
protected  List<Pattern> getPatterns(List<String> patterns)
          Convert a List<String> into List<Pattern>
 boolean include(String s)
          Return true if the string should be included.
protected  boolean isMatch(String s, List<Pattern> patterns)
          Return true if the string matches any of the patterns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includePatterns

protected List<Pattern> includePatterns

excludePatterns

protected List<Pattern> excludePatterns
Constructor Detail

StringFilter

protected StringFilter(List<String> includes,
                       List<String> excludes)
Method Detail

getInstance

public static final StringFilter getInstance(List<String> includes,
                                             List<String> excludes)

include

public boolean include(String s)
Return true if the string should be included.


exclude

public boolean exclude(String s)
Return true if the string should be excluded.


isMatch

protected boolean isMatch(String s,
                          List<Pattern> patterns)
Return true if the string matches any of the patterns


compilePatterns

protected void compilePatterns()
Compile the string patterns into Pattern objects


getPatterns

protected List<Pattern> getPatterns(List<String> patterns)
Convert a List<String> into List<Pattern>



Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.