public class RegexSplitter extends java.lang.Object implements ChangeTable.Splitter
A ValueChanger.Splitter that splits a line of text using a regular expression, returning one value per match.
A list of values is generated by effectively executing:
matcher = pattern.matcher(value.toString()); while(matcher.find()) { values.add(matcher.group(matchGroup); }
Constructor and Description |
---|
RegexSplitter(java.util.regex.Pattern pattern,
int matchGroup)
Create a new RegexSplitter with a pattern.
|
Modifier and Type | Method and Description |
---|---|
java.util.List |
split(java.lang.Object value)
Produce a list of values from an old value.
|
public RegexSplitter(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.util.List split(java.lang.Object value)
ChangeTable.Splitter
Produce a list of values from an old value.
It is strongly recommended that this method is re-entrant and does not modify the state of the Splitter in a way that would affect future return -values.
split
in interface ChangeTable.Splitter
value
- the old value Object