Class CsvChainedException

  • All Implemented Interfaces:
    java.io.Serializable

    public class CsvChainedException
    extends CsvException
    An exception class for collecting multiple exceptions. For internal use only.
    Since:
    5.3
    See Also:
    Serialized Form
    • Constructor Detail

      • CsvChainedException

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

      • 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 java.util.List<CsvFieldAssignmentException> getExceptionChain()
        Returns:
        A list of all exceptions collected
      • setLine

        public void setLine​(java.lang.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