org.apache.jackrabbit.mk.util
Class NameFilter
java.lang.Object
org.apache.jackrabbit.mk.util.NameFilter
public class NameFilter
- extends Object
Simple name filter utility class.
- a filter consists of one or more globs
- a glob prefixed by
- (dash) is treated as an exclusion pattern;
all others are considered inclusion patterns
- a leading
- (dash) must be escaped by prepending \ (backslash)
if it should be interpreted as a literal
* (asterisk) serves as a wildcard, i.e. it matches any
substring in the target name
* (asterisk) occurrences within the glob to be interpreted as
literals must be escaped by prepending \ (backslash)
- a filter matches a target name if any of the inclusion patterns match but
none of the exclusion patterns
Examples:
["foo*", "-foo99"] matches "foo" and "foo bar"
but not "foo99".
["foo\*"] matches "foo*" but not "foo99".
["\-blah"] matches "-blah".
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WILDCARD
public static final char WILDCARD
- See Also:
- Constant Field Values
EXCLUDE_PREFIX
public static final char EXCLUDE_PREFIX
- See Also:
- Constant Field Values
ESCAPE
public static final char ESCAPE
- See Also:
- Constant Field Values
NameFilter
public NameFilter(String[] patterns)
matches
public boolean matches(String name)
containsWildcard
public boolean containsWildcard()
getExclusionPatterns
public List<String> getExclusionPatterns()
getInclusionPatterns
public List<String> getInclusionPatterns()
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.