ProGuard

proguard.util
Class BasicListMatcher

java.lang.Object
  extended byproguard.util.BasicListMatcher
All Implemented Interfaces:
StringMatcher
Direct Known Subclasses:
ClassNameListMatcher, FileNameListMatcher

public class BasicListMatcher
extends Object
implements StringMatcher

This StringMatcher tests whether strings match an entry in a given list of regular expressions. The list is given as a comma-separated string or as a List of strings. An exclamation mark preceding a list entry acts as a negator: if the expression matches, a negative match is returned, without considering any subsequent entries. If none of the entries match, a positive match is returned depending on whether the last regular expression had a negator or not.

The individual regular expression matching is delegated to a StringMatcher that is created by the #createBasicMatcher(String} method. If it is not overridden, this method returns a BasicMatcher.

See Also:
BasicMatcher

Constructor Summary
BasicListMatcher(List regularExpressionList)
          Creates a new BasicListMatcher.
BasicListMatcher(String regularExpression)
          Creates a new BasicListMatcher.
 
Method Summary
protected  StringMatcher createBasicMatcher(String regularExpression)
          Creates a new StringMatcher for the given regular expression.
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

BasicListMatcher

public BasicListMatcher(String regularExpression)
Creates a new BasicListMatcher.

Parameters:
regularExpression - the comma-separated list of regular expressions against which strings will be matched.

BasicListMatcher

public BasicListMatcher(List regularExpressionList)
Creates a new BasicListMatcher.

Parameters:
regularExpressionList - the list of regular expressions against which strings will be matched.
Method Detail

createBasicMatcher

protected StringMatcher createBasicMatcher(String regularExpression)
Creates a new StringMatcher for the given regular expression.


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