Class CsvChainedException

All Implemented Interfaces:
Serializable

public class CsvChainedException extends CsvException
An exception class for collecting multiple exceptions. For internal use only.
Since:
5.3
See Also:
  • Field Details

  • Constructor Details

    • CsvChainedException

      public CsvChainedException(CsvFieldAssignmentException csve)
      Constructor.
      Parameters:
      csve - The first exception for the list being collected. Must not be null.
  • Method Details

    • add

      public void add(CsvFieldAssignmentException csve)
      Add an exception to the chain of collections.
      Parameters:
      csve - Exception to be added to this chain. Must not be null.
    • getExceptionChain

      public List<CsvFieldAssignmentException> getExceptionChain()
      Returns:
      A list of all exceptions collected
    • setLine

      public void setLine(String[] line)
      Sets the line for all exceptions collected.
      Overrides:
      setLine in class CsvException
      Parameters:
      line - The line that caused the error on reading. May be null.
    • setLineNumber

      public void setLineNumber(long lineNumber)
      Sets the line number for all exceptions collected.
      Overrides:
      setLineNumber in class CsvException
      Parameters:
      lineNumber - The line number that caused the error. This should be the one-based number of the line that caused the error, not including the header line, if present.
    • hasOnlyOneException

      public boolean hasOnlyOneException()
      Convenience method that checks if the chain only has a single exception.
      Returns:
      true if chain has only a single exception, false otherwise
    • getFirstException

      public CsvFieldAssignmentException getFirstException()
      Convenience method to return the first exception from the exception chain.
      Returns:
      CsvFieldAssignmentException at the first position in the list, null otherwise.