public class RegexMatcher extends Object implements ValueConverter<String>
Constructor and Description |
---|
RegexMatcher(String pattern,
int flags)
Creates a matcher that uses the given regular expression, modified by the given flags.
|
Modifier and Type | Method and Description |
---|---|
String |
convert(String value)
Converts the given string value into a Java type.
|
static ValueConverter<String> |
regex(String pattern)
Gives a matcher that uses the given regular expression.
|
String |
valuePattern()
Gives a string that describes the pattern of the values this converter expects, if any.
|
Class<String> |
valueType()
Gives the class of the type of values this converter converts to.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
revert
public RegexMatcher(String pattern, int flags)
pattern
- the regular expression patternflags
- modifying regex flagsIllegalArgumentException
- if bit values other than those corresponding to the defined match flags are
set in flags
PatternSyntaxException
- if the expression's syntax is invalidpublic static ValueConverter<String> regex(String pattern)
pattern
- the regular expression patternPatternSyntaxException
- if the expression's syntax is invalidpublic String convert(String value)
ValueConverter
convert
in interface ValueConverter<String>
value
- the string to convertpublic Class<String> valueType()
ValueConverter
valueType
in interface ValueConverter<String>
public String valuePattern()
ValueConverter
date format string
.valuePattern
in interface ValueConverter<String>
null
if there's nothing interesting here© Copyright 2004-2016 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License.