com.cafesoft.core.regex
Class StandardRegexFilter

java.lang.Object
  extended by com.cafesoft.core.regex.StandardRegexFilter
All Implemented Interfaces:
RegexFilter

public class StandardRegexFilter
extends Object
implements RegexFilter

StandardRegexFilter is the standard Cams implementation of the RegexFilter interface. It implements a pattern matching pattern matching filter that uses inclusion and exclusion patterns.

Since:
01/17/2011

Constructor Summary
StandardRegexFilter()
          Create a new StandardRegexFilter
 
Method Summary
 void addExclusionRegex(Pattern pattern)
          Add a regular expression to the exclusion filter.
 void addInclusionRegex(Pattern pattern)
          Add a regular expression to the inclusion filter.
 boolean isExcluded(String value)
          Check a String for a match with at least one exclusion pattern.
 boolean isIncluded(String value)
          Check a String for a match with at least one inclusion pattern.
 boolean isIncludedNotExcluded(String value)
          Check a String for a match with at least one inclusion pattern, but no matches with an exclusion pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardRegexFilter

public StandardRegexFilter()
Create a new StandardRegexFilter

Method Detail

addInclusionRegex

public void addInclusionRegex(Pattern pattern)
Add a regular expression to the inclusion filter.

Specified by:
addInclusionRegex in interface RegexFilter
Parameters:
pattern - the regular expression to be added as an inclusion pattern.

addExclusionRegex

public void addExclusionRegex(Pattern pattern)
Add a regular expression to the exclusion filter.

Specified by:
addExclusionRegex in interface RegexFilter
Parameters:
pattern - the regular expression to be added as an exclusion pattern.

isIncluded

public boolean isIncluded(String value)
Check a String for a match with at least one inclusion pattern.

Specified by:
isIncluded in interface RegexFilter
Parameters:
value - the String to be checked for a match.
Returns:
true if the String matches at least one inclusion regular expression, else false.

isExcluded

public boolean isExcluded(String value)
Check a String for a match with at least one exclusion pattern.

Specified by:
isExcluded in interface RegexFilter
Parameters:
value - the String to be checked for a match.
Returns:
true if the String matches at least one exclusion regular expression, else false.

isIncludedNotExcluded

public boolean isIncludedNotExcluded(String value)
Check a String for a match with at least one inclusion pattern, but no matches with an exclusion pattern.

Specified by:
isIncludedNotExcluded in interface RegexFilter
Parameters:
value - the String to be checked for a match.
Returns:
true if the String matches at least one inclusion regular expression and does not match any exclusion regular expressions.


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.