public class RegexMatcher extends java.lang.Object implements ValueConverter<java.lang.String>
| Constructor and Description |
|---|
RegexMatcher(java.lang.String pattern,
int flags)
Creates a matcher that uses the given regular expression, modified by the given flags.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
convert(java.lang.String value)
Converts the given string value into a Java type.
|
static ValueConverter<java.lang.String> |
regex(java.lang.String pattern)
Gives a matcher that uses the given regular expression.
|
java.lang.String |
valuePattern()
Gives a string that describes the pattern of the values this converter expects, if any.
|
java.lang.Class<java.lang.String> |
valueType()
Gives the class of the type of values this converter converts to.
|
public RegexMatcher(java.lang.String pattern,
int flags)
pattern - the regular expression patternflags - modifying regex flagsjava.lang.IllegalArgumentException - if bit values other than those corresponding to the defined match flags are
set in flagsjava.util.regex.PatternSyntaxException - if the expression's syntax is invalidpublic static ValueConverter<java.lang.String> regex(java.lang.String pattern)
pattern - the regular expression patternjava.util.regex.PatternSyntaxException - if the expression's syntax is invalidpublic java.lang.String convert(java.lang.String value)
convert in interface ValueConverter<java.lang.String>value - the string to convertpublic java.lang.Class<java.lang.String> valueType()
valueType in interface ValueConverter<java.lang.String>public java.lang.String valuePattern()
date format string.valuePattern in interface ValueConverter<java.lang.String>null if there's nothing interesting here