Package com.opencsv.validators
Interface LineValidator
-
public interface LineValidatorThis is the interface for validators for aStringread by theReaderin theCSVReaderbefore it is processed.This should only be used if you have a very good understanding and full control of the data being processed.
Since this is working on an individual line it may not be a full record if an element has a newline character in it.
- Since:
- 5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisValid(java.lang.String line)Performs the validation check on the string and returns the result.voidvalidate(java.lang.String line)Performs the validation check on the string and throws an exception if invalid.
-
-
-
Method Detail
-
isValid
boolean isValid(java.lang.String line)
Performs the validation check on the string and returns the result. While not called directly in opencsv it is in the interface to provide an easy way to test if the validator is function properly.- Parameters:
line-Stringto be validated- Returns:
trueif the line is valid,falseotherwise
-
validate
void validate(java.lang.String line) throws CsvValidationExceptionPerforms the validation check on the string and throws an exception if invalid.- Parameters:
line-Stringto be validated- Throws:
CsvValidationException- Thrown if invalid. Should contain a message describing the error.
-
-