com.qizx.api.util
Class GlobFilter
java.lang.Object
com.qizx.api.util.GlobFilter
- All Implemented Interfaces:
- LibraryMemberFilter
public final class GlobFilter
- extends Object
- implements LibraryMemberFilter
An implementation of LibraryMemberFilter which matches the name of
Library members using Unix shell-like regular expressions.
Constructor Summary |
GlobFilter(String regex)
Builds a GlobFilter with a regular expression. |
Method Summary |
boolean |
accept(LibraryMember member)
The implemented method should return true to accept the member. |
GlobFilter
public GlobFilter(String regex)
throws PatternSyntaxException
- Builds a GlobFilter with a regular expression.
- Parameters:
regex
- a Unix-style regular expression, for example 'doc*' matching
all strings that start with "doc".
- Throws:
PatternSyntaxException
- if the regex is invalid
accept
public boolean accept(LibraryMember member)
- Description copied from interface:
LibraryMemberFilter
- The implemented method should return true to accept the member.
- Specified by:
accept
in interface LibraryMemberFilter
- Parameters:
member
- a library member to accept or to reject by the filter
- Returns:
- true if the member item is accepted.