Class RegexpClassNameMatcher
- java.lang.Object
-
- org.apache.commons.io.serialization.RegexpClassNameMatcher
-
- All Implemented Interfaces:
ClassNameMatcher
final class RegexpClassNameMatcher extends java.lang.Object implements ClassNameMatcher
AClassNameMatcher
that uses regular expressions.This object is immutable and thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.regex.Pattern
pattern
-
Constructor Summary
Constructors Constructor Description RegexpClassNameMatcher(java.lang.String regex)
Constructs an object based on the specified regular expression.RegexpClassNameMatcher(java.util.regex.Pattern pattern)
Constructs an object based on the specified pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(java.lang.String className)
Returnstrue
if the supplied class name matches this object's condition.
-
-
-
Constructor Detail
-
RegexpClassNameMatcher
public RegexpClassNameMatcher(java.lang.String regex)
Constructs an object based on the specified regular expression.- Parameters:
regex
- a regular expression for evaluating acceptable class names
-
RegexpClassNameMatcher
public RegexpClassNameMatcher(java.util.regex.Pattern pattern)
Constructs an object based on the specified pattern.- Parameters:
pattern
- a pattern for evaluating acceptable class names- Throws:
java.lang.IllegalArgumentException
- ifpattern
is null
-
-
Method Detail
-
matches
public boolean matches(java.lang.String className)
Description copied from interface:ClassNameMatcher
Returnstrue
if the supplied class name matches this object's condition.- Specified by:
matches
in interfaceClassNameMatcher
- Parameters:
className
- fully qualified class name- Returns:
true
if the class name matches this object's condition
-
-