Package proguard.util

Class NameParser

java.lang.Object
proguard.util.NameParser
All Implemented Interfaces:
StringParser

public class NameParser extends Object implements StringParser
This StringParser can create StringMatcher instances for regular expressions matching names. The regular expressions are interpreted as comma-separated lists of names, optionally prefixed with '!' negators. If a name with a negator matches, a negative match is returned, without considering any subsequent entries in the list. The regular expressions can contain the following wildcards: '?' for a single character, '*' for any number of characters, and '' for a reference to an earlier wildcard (n = 1, 2, ...)
  • Constructor Details

    • NameParser

      public NameParser()
      Creates a new NameParser.
    • NameParser

      public NameParser(WildcardManager wildcardManager)
      Creates a new NameParser that supports references to earlier wildcards.
      Parameters:
      wildcardManager - an optional scope for StringMatcher instances that match wildcards.
  • Method Details

    • parse

      public StringMatcher parse(String regularExpression)
      Description copied from interface: StringParser
      Creates a StringMatcher for the given regular expression.
      Specified by:
      parse in interface StringParser
    • main

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