public class ListFunctionParser extends java.lang.Object implements StringFunctionParser
StringFunctionParser can create StringFunction instances for regular
expressions. The created function returns a String, or null if it doesn't
match. The regular expressions are either presented as a list, or they are
interpreted as comma-separated lists, optionally prefixed with '!' negators.
If an entry with a negator matches, a negative match is returned, without
considering any subsequent entries in the list. The creation of
StringFunction instances for the entries is delegated to the given
StringFunctionParser.| Constructor and Description |
|---|
ListFunctionParser(StringFunctionParser stringFunctionParser)
Creates a new ListFunctionParser that parses individual elements in the
comma-separated list with the given StringFunctionParser.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args)
A main method for testing name matching and replacement.
|
StringFunction |
parse(java.util.List regularExpressions)
Creates a StringFunction for the given regular expression, which can
be a list of optionally negated simple entries.
|
StringFunction |
parse(java.lang.String regularExpression)
Creates a StringFunction for the given regular expression.
|
public ListFunctionParser(StringFunctionParser stringFunctionParser)
public StringFunction parse(java.lang.String regularExpression)
StringFunctionParserparse in interface StringFunctionParserpublic StringFunction parse(java.util.List regularExpressions)
public static void main(java.lang.String[] args)