net.sourceforge.pmd.util.filter
Class RegexStringFilter
java.lang.Object
net.sourceforge.pmd.util.filter.RegexStringFilter
- All Implemented Interfaces:
- Filter<String>
public class RegexStringFilter
- extends Object
- implements Filter<String>
A filter which uses a regular expression to match Strings. Invalid regular
expressions will match nothing.
Because regular expression matching is slow, and a common usage is to match
some sort of relative file path, the regular expression is checked to see if
it can be evaluated using much faster calls to
String.endsWith(String)
.
regex
protected String regex
pattern
protected Pattern pattern
endsWith
protected String endsWith
RegexStringFilter
public RegexStringFilter(String regex)
getRegex
public String getRegex()
getEndsWith
public String getEndsWith()
optimize
protected void optimize()
filter
public boolean filter(String obj)
- Specified by:
filter
in interface Filter<String>
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2002-2015 InfoEther. All Rights Reserved.