Package org.apache.juneau.objecttools
Class StringMatcherFactory
java.lang.Object
org.apache.juneau.objecttools.MatcherFactory
org.apache.juneau.objecttools.StringMatcherFactory
String matcher factory for the
ObjectSearcher
class.
The class provides searching based on the following patterns:
"property=foo" - Simple full word match"property=fo*" ,"property=?ar" - Meta-character matching"property=foo bar" (implicit),"property=^foo ^bar" (explicit) - Multiple OR'ed patterns"property=+fo* +*ar" - Multiple AND'ed patterns"property=fo* -bar" - Negative patterns"property='foo bar'" - Patterns with whitespace"property=foo\\'bar" - Patterns with single-quotes"property=/foo\\s+bar" - Regular expression match
See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue if this matcher can be used on the specified object.Instantiates a matcher for the specified pattern.
-
Field Details
-
DEFAULT
Default reusable matcher.
-
-
Constructor Details
-
StringMatcherFactory
public StringMatcherFactory()
-
-
Method Details
-
canMatch
Description copied from class:MatcherFactory
Returnstrue if this matcher can be used on the specified object.- Specified by:
canMatch
in classMatcherFactory
- Parameters:
cm
- The class type of the object being matched. Nevernull .- Returns:
true if this matcher can be used on the specified object.
-
create
Description copied from class:MatcherFactory
Instantiates a matcher for the specified pattern.- Specified by:
create
in classMatcherFactory
- Parameters:
pattern
- The pattern string.- Returns:
- A matcher for the specified pattern.
-