public class StrReplace extends CellProcessorAdaptor implements BoolCellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor
next
Constructor and Description |
---|
StrReplace(String regex,
String replacement)
Constructs a new StrReplace processor, which replaces each substring of the input that matches the regex
with the supplied replacement.
|
StrReplace(String regex,
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 |
---|---|
Object |
execute(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(String regex, String replacement)
regex
- the regular expression to matchreplacement
- the string to be substituted for each matchIllegalArgumentException
- if regex is emptyNullPointerException
- if regex or replacement is nullPatternSyntaxException
- if regex is not a valid regular expressionpublic StrReplace(String regex, String replacement, StringCellProcessor next)
regex
- the regular expression to matchreplacement
- the string to be substituted for each matchnext
- the next processor in the chainIllegalArgumentException
- if regex is emptyNullPointerException
- if regex or replacement is nullPatternSyntaxException
- if regex is not a valid regular expressionpublic Object execute(Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is nullCopyright © 2007–2015 Super CSV. All rights reserved.