/** * Constructs a new <tt>StrRegEx</tt> processor, which ensures that the input data matches the given regular * expression. * * @param regex * the regular expression to match * @throws NullPointerException * if regex is null * @throws IllegalArgumentException * if regex is empty * @throws PatternSyntaxException * if regex is not a valid regular expression */ public StrRegEx(final String regex) { super(); checkPreconditions(regex); this.regexPattern = Pattern.compile(regex); this.regex = regex; }
/** * Constructs a new <tt>StrRegEx</tt> processor, which ensures that the input data matches the given regular * expression, then calls the next processor in the chain. * * @param regex * the regular expression to match * @param next * the next processor in the chain * @throws NullPointerException * if regex is null * @throws IllegalArgumentException * if regex is empty * @throws PatternSyntaxException * if regex is not a valid regular expression */ public StrRegEx(final String regex, final StringCellProcessor next) { super(next); checkPreconditions(regex); this.regexPattern = Pattern.compile(regex); this.regex = regex; }