Interface LineValidator


public interface LineValidator
This is the interface for validators for a String read by the Reader in the CSVReader before 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

    Modifier and Type
    Method
    Description
    boolean
    Performs the validation check on the string and returns the result.
    void
    Performs the validation check on the string and throws an exception if invalid.
  • Method Details

    • isValid

      boolean isValid(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 - String to be validated
      Returns:
      true if the line is valid, false otherwise
    • validate

      void validate(String line) throws CsvValidationException
      Performs the validation check on the string and throws an exception if invalid.
      Parameters:
      line - String to be validated
      Throws:
      CsvValidationException - Thrown if invalid. Should contain a message describing the error.