Class RegexpClassNameMatcher

java.lang.Object
org.apache.commons.io.serialization.RegexpClassNameMatcher
All Implemented Interfaces:
ClassNameMatcher

final class RegexpClassNameMatcher extends Object implements ClassNameMatcher
A ClassNameMatcher that uses regular expressions.

This object is immutable and thread-safe.

  • Field Details

    • pattern

      private final Pattern pattern
  • Constructor Details

    • RegexpClassNameMatcher

      public RegexpClassNameMatcher(Pattern pattern)
      Constructs an object based on the specified pattern.
      Parameters:
      pattern - a pattern for evaluating acceptable class names
      Throws:
      NullPointerException - if pattern is null
    • RegexpClassNameMatcher

      public RegexpClassNameMatcher(String regex)
      Constructs an object based on the specified regular expression.
      Parameters:
      regex - a regular expression for evaluating acceptable class names
  • Method Details

    • matches

      public boolean matches(String className)
      Description copied from interface: ClassNameMatcher
      Returns true if the supplied class name matches this object's condition.
      Specified by:
      matches in interface ClassNameMatcher
      Parameters:
      className - fully qualified class name
      Returns:
      true if the class name matches this object's condition