Class WildcardMatcher


  • public class WildcardMatcher
    extends java.lang.Object
    Matches strings against glob like wildcard expressions where ? matches any single character and * matches any number of any character. Multiple expressions can be separated with a colon (:). In this case the expression matches if at least one part matches.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.regex.Pattern pattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      WildcardMatcher​(java.lang.String expression)
      Creates a new matcher with the given expression.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(java.lang.String s)
      Matches the given string against the expressions of this matcher.
      private static java.lang.CharSequence toRegex​(java.lang.String expression)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pattern

        private final java.util.regex.Pattern pattern
    • Constructor Detail

      • WildcardMatcher

        public WildcardMatcher​(java.lang.String expression)
        Creates a new matcher with the given expression.
        Parameters:
        expression - wildcard expressions
    • Method Detail

      • toRegex

        private static java.lang.CharSequence toRegex​(java.lang.String expression)
      • matches

        public boolean matches​(java.lang.String s)
        Matches the given string against the expressions of this matcher.
        Parameters:
        s - string to test
        Returns:
        true, if the expression matches