public class RegexChanger extends java.lang.Object implements ChangeTable.Changer
A ValueChanger.Changer that returns a specific match value using a regex Pattern.
Constructor and Description |
---|
RegexChanger(java.util.regex.Pattern pattern,
int matchGroup)
Create a new RegexChanger with a pattern.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
change(java.lang.Object value)
Produce a modified value from an old value.
|
public RegexChanger(java.util.regex.Pattern pattern, int matchGroup)
pattern
- the Pattern used to split valuesmatchGroup
- the group to pull out - use 0 to pull out the whole matchpublic java.lang.Object change(java.lang.Object value) throws ParserException
ChangeTable.Changer
Produce a modified value from an old value.
It is strongly recommended that this method is re-entrant and does not modify the state of the Changer in a way that would affect future return -values.
change
in interface ChangeTable.Changer
value
- the old value ObjectParserException
- if value could not be changed