net.sourceforge.pmd.util.filter
public class Filters extends Object
Method Summary | |
---|---|
static Filter<String> | buildRegexFilterExcludeOverInclude(List<String> includeRegexes, List<String> excludeRegexes)
Construct a String Filter using set of include and exclude regular
expressions. |
static Filter<String> | buildRegexFilterIncludeOverExclude(List<String> includeRegexes, List<String> excludeRegexes)
Construct a String Filter using set of include and exclude regular
expressions. |
static <T> List<T> | filter(Filter<T> filter, Collection<T> collection)
Filter a given Collection. |
static <T> Filter<T> | fromStringFilter(Filter<String> filter)
Given a String Filter, expose as a Filter on another type. |
static Filter<File> | getDirectoryFilter()
Get a File Filter for directories. |
static Filter<File> | getFileExtensionFilter(String... extensions)
Get a File Filter for files with the given extensions, ignoring case. |
static Filter<File> | getFileExtensionOrDirectoryFilter(String... extensions)
Get a File Filter for directories or for files with the given extensions, ignoring case. |
static Filter<File> | toFileFilter(FilenameFilter filter)
Given a FilenameFilter, expose as a File Filter. |
static FilenameFilter | toFilenameFilter(Filter<File> filter)
Given a File Filter, expose as a FilenameFilter. |
static Filter<File> | toNormalizedFileFilter(Filter<String> filter)
Given a String Filter, expose as a File Filter. |
In other words, exclude patterns override include patterns.
Parameters: includeRegexes The include regular expressions. May be null
. excludeRegexes The exclude regular expressions. May be null
.
Returns: A String Filter.
In other words, include patterns override exclude patterns.
Parameters: includeRegexes The include regular expressions. May be null
. excludeRegexes The exclude regular expressions. May be null
.
Returns: A String Filter.
Parameters:
Returns: A List containing only those objects for which the Filter returned true
.
toString()
method is called on the objects of the other
type and delegated to the String Filter.Parameters:
Returns: A Filter on the desired type.
Returns: A File Filter.
Parameters: extensions The extensions to filter.
Returns: A File Filter.
Parameters: extensions The extensions to filter.
Returns: A File Filter.
Parameters: filter The FilenameFilter.
Returns: A File Filter.
Parameters: filter The File Filter.
Returns: A FilenameFilter.
/
as a path separator
which can be used cross platform easily in a regular expression based
String Filter.
Parameters: filter A String Filter.
Returns: A File Filter.