com.projectnine.csvmapper
Class RegularExpressionCsvFieldValidator

java.lang.Object
  extended by com.projectnine.csvmapper.CsvFieldValidator
      extended by com.projectnine.csvmapper.RegularExpressionCsvFieldValidator
All Implemented Interfaces:
org.apache.commons.chain.Command

public class RegularExpressionCsvFieldValidator
extends CsvFieldValidator

Give this CsvFieldValidator one or more regular expressions, and it will not allow a String that fails any of them to pass validation.

Author:
robweber

Field Summary
 
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
RegularExpressionCsvFieldValidator()
           
 
Method Summary
protected  boolean doValidate(CsvFieldValidationContext csvFieldValidationContext)
           
 void setRegularExpression(java.lang.String regularExpression)
           
 void setRegularExpressions(java.util.List<java.lang.String> regularExpressions)
           
 
Methods inherited from class com.projectnine.csvmapper.CsvFieldValidator
execute, setRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularExpressionCsvFieldValidator

public RegularExpressionCsvFieldValidator()
Method Detail

setRegularExpressions

public void setRegularExpressions(java.util.List<java.lang.String> regularExpressions)
Parameters:
regularExpression - the regularExpression to set

setRegularExpression

public void setRegularExpression(java.lang.String regularExpression)

doValidate

protected boolean doValidate(CsvFieldValidationContext csvFieldValidationContext)
                      throws java.lang.Exception
Specified by:
doValidate in class CsvFieldValidator
Throws:
java.lang.Exception


Copyright © 2008. All Rights Reserved.