Package org.jboss.weld.metadata
Class Selectors
- java.lang.Object
-
- org.jboss.weld.metadata.Selectors
-
public class Selectors extends Object
Algorithm taken from Apache Ant's SelectorUtils class and modified to handle class hierarchies.- Author:
- Pete Muir, Apache Ant Team
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEEP_TREE_MATCH
The pattern that matches an arbitrary number of directories.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
match(String pattern, String str, boolean caseSensitive)
Tests whether or not a string matches against a pattern.static boolean
matchPath(String pattern, String str)
Tests whether or not a given path matches a given pattern.static boolean
matchPath(String pattern, String str, boolean isCaseSensitive)
Tests whether or not a given path matches a given pattern.
-
-
-
Field Detail
-
DEEP_TREE_MATCH
public static final String DEEP_TREE_MATCH
The pattern that matches an arbitrary number of directories.- Since:
- Ant 1.8.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
matchPath
public static boolean matchPath(String pattern, String str)
Tests whether or not a given path matches a given pattern. If you need to call this method multiple times with the same pattern you should rather use TokenizedPath- Parameters:
pattern
- The pattern to match against. Must not benull
.str
- The path to match, as a String. Must not benull
.- Returns:
true
if the pattern matches against the string, orfalse
otherwise.- See Also:
TokenizedPath
-
matchPath
public static boolean matchPath(String pattern, String str, boolean isCaseSensitive)
Tests whether or not a given path matches a given pattern. If you need to call this method multiple times with the same pattern you should rather use TokenizedPattern- Parameters:
pattern
- The pattern to match against. Must not benull
.str
- The path to match, as a String. Must not benull
.isCaseSensitive
- Whether or not matching should be performed case sensitively.- Returns:
true
if the pattern matches against the string, orfalse
otherwise.- See Also:
TokenizedPattern
-
match
public static boolean match(String pattern, String str, boolean caseSensitive)
Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character- Parameters:
pattern
- The pattern to match against. Must not benull
.str
- The string which must be matched against the pattern. Must not benull
.caseSensitive
- Whether or not matching should be performed case sensitively.- Returns:
true
if the string matches against the pattern, orfalse
otherwise.
-
-