public class StrReplace extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor
next
Constructor and Description |
---|
StrReplace(java.lang.String regex,
java.lang.String replacement)
Constructs a new StrReplace processor, which replaces each substring of the input that matches the regex
with the supplied replacement.
|
StrReplace(java.lang.String regex,
java.lang.String replacement,
StringCellProcessor next)
Constructs a new StrReplace processor, which replaces each substring of the input that matches the regex
with the supplied replacement, then calls the next processor in the chain.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(java.lang.Object value,
CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.
|
toString, validateInputNotNull
public StrReplace(java.lang.String regex, java.lang.String replacement)
regex
- the regular expression to matchreplacement
- the string to be substituted for each matchjava.lang.IllegalArgumentException
- if regex is emptyjava.lang.NullPointerException
- if regex or replacement is nulljava.util.regex.PatternSyntaxException
- if regex is not a valid regular expressionpublic StrReplace(java.lang.String regex, java.lang.String replacement, StringCellProcessor next)
regex
- the regular expression to matchreplacement
- the string to be substituted for each matchnext
- the next processor in the chainjava.lang.IllegalArgumentException
- if regex is emptyjava.lang.NullPointerException
- if regex or replacement is nulljava.util.regex.PatternSyntaxException
- if regex is not a valid regular expressionpublic java.lang.Object execute(java.lang.Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is nullCopyright © 2007-2014 Super CSV. All Rights Reserved.