Class SuperCsvCellProcessorException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SuperCsvConstraintViolationException

public class SuperCsvCellProcessorException extends SuperCsvException
Exception thrown when CellProcessor execution fails (typically due to invalid input) - constraint validating CellProcessors should throw SuperCsvConstraintViolationException for constraint validation failures.
Since:
2.0.0
See Also:
  • Field Details

  • Constructor Details

    • SuperCsvCellProcessorException

      public SuperCsvCellProcessorException(String msg, CsvContext context, CellProcessor processor)
      Constructs a new SuperCsvCellProcessorException.
      Parameters:
      msg - the exception message
      context - the CSV context
      processor - the cell processor that was executing
    • SuperCsvCellProcessorException

      public SuperCsvCellProcessorException(String msg, CsvContext context, CellProcessor processor, Throwable t)
      Constructs a new SuperCsvCellProcessorException.
      Parameters:
      msg - the exception message
      context - the CSV context
      processor - the cell processor that was executing
      t - the nested exception
    • SuperCsvCellProcessorException

      public SuperCsvCellProcessorException(Class<?> expectedType, Object actualValue, CsvContext context, CellProcessor processor)
      Constructs a new SuperCsvCellProcessorException to indicate that the value received by a CellProcessor wasn't of the correct type.
      Parameters:
      expectedType - the expected type
      actualValue - the value received by the CellProcessor
      context - the CSV context
      processor - the cell processor that was executing
  • Method Details

    • getUnexpectedTypeMessage

      private static String getUnexpectedTypeMessage(Class<?> expectedType, Object actualValue)
      Assembles the exception message when the value received by a CellProcessor isn't of the correct type.
      Parameters:
      expectedType - the expected type
      actualValue - the value received by the CellProcessor
      Returns:
      the message
      Throws:
      NullPointerException - if expectedType is null
    • getProcessor

      public CellProcessor getProcessor()
      Gets the processor that was executing.
      Returns:
      the processor that was executing
    • toString

      public String toString()
      Returns the String representation of this exception.
      Overrides:
      toString in class SuperCsvException