ProGuard

proguard.util
Class BasicMatcher

java.lang.Object
  extended byproguard.util.BasicMatcher
All Implemented Interfaces:
StringMatcher
Direct Known Subclasses:
ClassNameMatcher, FileNameMatcher

public class BasicMatcher
extends Object
implements StringMatcher

This StringMatcher tests whether strings match a given regular expression. Supported wildcards are

The sets of wildcard characters, extended wildcard characters, and special wildcard characters can be defined by the user.


Constructor Summary
BasicMatcher(String regularExpression)
          Creates a new BasicMatcher without extra wildcard matching characters.
BasicMatcher(String regularExpression, char[] wildcardCharacters, char[] extendedWildcardCharacters, char[] specialWildcardCharacters)
          Creates a new BasicMatcher.
 
Method Summary
static void main(String[] args)
          A main method for testing string matching.
 boolean matches(String string)
          Checks whether the given string matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicMatcher

public BasicMatcher(String regularExpression)
Creates a new BasicMatcher without extra wildcard matching characters.

Parameters:
regularExpression - the regular expression against which strings will be matched.

BasicMatcher

public BasicMatcher(String regularExpression,
                    char[] wildcardCharacters,
                    char[] extendedWildcardCharacters,
                    char[] specialWildcardCharacters)
Creates a new BasicMatcher.

Parameters:
regularExpression - the regular expression against which strings will be matched.
wildcardCharacters - an optional extra list of wildcard matching characters.
Method Detail

matches

public boolean matches(String string)
Description copied from interface: StringMatcher
Checks whether the given string matches.

Specified by:
matches in interface StringMatcher
Parameters:
string - the string to match.
Returns:
a boolean indicating whether the string matches the criterion.

main

public static void main(String[] args)
A main method for testing string matching.


ProGuard