public class StrRegEx extends CellProcessorAdaptor implements StringCellProcessor
next| Constructor and Description |
|---|
StrRegEx(java.lang.String regex)
Constructs a new StrRegEx processor, which ensures that the input data matches the given regular
expression.
|
StrRegEx(java.lang.String regex,
StringCellProcessor next)
Constructs a new StrRegEx processor, which ensures that the input data matches the given regular
expression, 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.
|
static void |
registerMessage(java.lang.String regex,
java.lang.String message)
Register a message detailing in plain language the constraint representing a regular expression.
|
toString, validateInputNotNullpublic StrRegEx(java.lang.String regex)
regex - the regular expression to matchjava.lang.NullPointerException - if regex is nulljava.lang.IllegalArgumentException - if regex is emptyjava.util.regex.PatternSyntaxException - if regex is not a valid regular expressionpublic StrRegEx(java.lang.String regex,
StringCellProcessor next)
regex - the regular expression to matchnext - the next processor in the chainjava.lang.NullPointerException - if regex is nulljava.lang.IllegalArgumentException - if regex is emptyjava.util.regex.PatternSyntaxException - if regex is not a valid regular expressionpublic java.lang.Object execute(java.lang.Object value,
CsvContext context)
execute in interface CellProcessorvalue - the value to be processedcontext - the CSV contextSuperCsvCellProcessorException - if value is nullSuperCsvConstraintViolationException - if value doesn't match the regular expressionpublic static void registerMessage(java.lang.String regex,
java.lang.String message)
regex - the regular expressionmessage - the message to associate with the regexCopyright © 2007-2014 Super CSV. All Rights Reserved.