程序包 proguard.util
类 WildcardManager
java.lang.Object
proguard.util.WildcardManager
This utility class creates and manages
StringMatcher instances that (1) match wildcards,
and (2) refer back to matched wildcards.
Each instance represents a scope in which wildcards can be specified and referenced.
-
构造器概要
构造器构造器说明Creates a new WildcardManager.WildcardManager(WildcardManager wildcardManager) Creates a new WildcardManager with the current list of string matchers of the given WildcardManager. -
方法概要
修饰符和类型方法说明createMatchedStringFunction(String expression) Creates new StringFunction that transforms the given expression with possible references to wildcards, based on the list of string matchers.createMatchedStringMatcher(int index, StringMatcher nextMatcher) Creates new MatchedStringMatcher to match the the specified variable string matcher from the list of string matchers.createVariableStringMatcher(char[] allowedCharacters, char[] disallowedCharacters, int minimumLength, int maximumLength, StringMatcher nextMatcher) Creates a new VariableStringMatcher and remembers it as a next element in the list of string matchers, so it can be referenced by its index later.voidrememberVariableStringMatcher(VariableStringMatcher variableStringMatcher) Remembers the given VariableStringMatcher as a next element in the list of string matchers, so it can be referenced by its index later.voidreset()Resets the list of string matchers.intwildCardIndex(String regularExpression, int index) Parses a reference to a wildcard at a given index, if any.
-
构造器详细资料
-
WildcardManager
public WildcardManager()Creates a new WildcardManager. -
WildcardManager
Creates a new WildcardManager with the current list of string matchers of the given WildcardManager.
-
-
方法详细资料
-
reset
public void reset()Resets the list of string matchers. -
createVariableStringMatcher
public VariableStringMatcher createVariableStringMatcher(char[] allowedCharacters, char[] disallowedCharacters, int minimumLength, int maximumLength, StringMatcher nextMatcher) Creates a new VariableStringMatcher and remembers it as a next element in the list of string matchers, so it can be referenced by its index later.- 参数:
allowedCharacters- an optional list of allowed characters.disallowedCharacters- an optional list of disallowed characters.minimumLength- the minimum length of te variable string.maximumLength- the maximum length of te variable string.nextMatcher- an optional next matcher for the remainder of the string.
-
rememberVariableStringMatcher
Remembers the given VariableStringMatcher as a next element in the list of string matchers, so it can be referenced by its index later. -
createMatchedStringMatcher
Creates new MatchedStringMatcher to match the the specified variable string matcher from the list of string matchers.- 参数:
index- the 0-based index of previously created and remembered VariableStringMatcher instances.nextMatcher- an optional next matcher for the remainder of the string.
-
createMatchedStringFunction
Creates new StringFunction that transforms the given expression with possible references to wildcards, based on the list of string matchers.For example:
"foo<1>"returns a string function that prepends "foo" to the first wildcard of the recently matched string. -
wildCardIndex
Parses a reference to a wildcard at a given index, if any.For example:
"foo<1>"at index 0 returns -1,"foo<1>"at index 3 returns 0."foo<8>"at index 3 returns 7.- 参数:
regularExpression- the regular expression.index- the index at which the regular expression is to be checked for a reference.- 返回:
- the 0-based index of the back reference, or -1 otherwise.
- 抛出:
IllegalArgumentException- if the reference is malformed.
-