org.apache.sling.discovery.impl.common
Class WildcardHelper

java.lang.Object
  extended by org.apache.sling.discovery.impl.common.WildcardHelper

public class WildcardHelper
extends Object

Helper class for wildcards


Constructor Summary
WildcardHelper()
           
 
Method Summary
static boolean matchesWildcard(String comparee, String patternWithWildcards)
          Compare a given string (comparee) against a pattern that contains wildcards and return true if it matches.
static String wildcardAsRegex(String patternWithWildcards)
          converts a string containing wildcards (* and ?) into a valid regex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WildcardHelper

public WildcardHelper()
Method Detail

wildcardAsRegex

public static String wildcardAsRegex(String patternWithWildcards)
converts a string containing wildcards (* and ?) into a valid regex


matchesWildcard

public static boolean matchesWildcard(String comparee,
                                      String patternWithWildcards)
Compare a given string (comparee) against a pattern that contains wildcards and return true if it matches.

Parameters:
comparee - the string which should be tested against a pattern containing wildcards
patternWithWildcards - the pattern containing wildcards (* and ?)
Returns:
true if the comparee string matches against the pattern containing wildcards


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.