com.projectnine.csvmapper
Class CsvFieldValidator
java.lang.Object
com.projectnine.csvmapper.CsvFieldValidator
- All Implemented Interfaces:
- org.apache.commons.chain.Command
- Direct Known Subclasses:
- NoopCsvFieldValidator, NoSpecialCharacterCsvFieldValidator, PostalCodeCsvFieldValidator, RegularExpressionCsvFieldValidator
public abstract class CsvFieldValidator
- extends java.lang.Object
- implements org.apache.commons.chain.Command
A CsvFieldValidator
may be used to validate that the value of a CSV
field falls within certain parameters.
- Author:
- robweber
Fields inherited from interface org.apache.commons.chain.Command |
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CsvFieldValidator
public CsvFieldValidator()
execute
public final boolean execute(org.apache.commons.chain.Context context)
throws java.lang.Exception
- Child classes should invoke super
execute(Context)
in order to
access simple progress tracking of the Context
through a
Chain
of CsvFieldValidator
s.
Return false to run the next command in the chain (if there is a next
command); return true to stop execution with this command; throw an
Exception when validation fails.
- Specified by:
execute
in interface org.apache.commons.chain.Command
- Throws:
java.lang.Exception
doValidate
protected abstract boolean doValidate(CsvFieldValidationContext csvFieldValidationContext)
throws java.lang.Exception
- Throws:
java.lang.Exception
setRequired
public void setRequired(boolean required)
- Parameters:
required
- the required to set
Copyright © 2008. All Rights Reserved.