Package org.beanio

Class InvalidRecordException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    InvalidRecordGroupException

    public class InvalidRecordException
    extends BeanReaderException
    Exception thrown when a record or one of its fields does not pass validation during unmarshalling.

    An invalid record does not affect the state of a BeanReader, and subsequent calls to read() are not affected.

    Since:
    1.0
    See Also:
    Serialized Form
    • Constructor Detail

      • InvalidRecordException

        protected InvalidRecordException​(java.lang.String message)
        Constructs a new InvalidRecordException.
        Parameters:
        message - the error message
      • InvalidRecordException

        public InvalidRecordException​(RecordContext context,
                                      java.lang.String message)
        Constructs a new InvalidRecordException.
        Parameters:
        context - the RecordContext that caused the exception
        message - the error message
    • Method Detail

      • getRecordName

        public java.lang.String getRecordName()
        Returns the name of the record or group that failed validation.
        Returns:
        the record or group name
        Since:
        2.0
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable
      • appendMessageDetails

        protected void appendMessageDetails​(java.lang.StringBuilder s)
        Called by toString() to append record context details to the error message.
        Parameters:
        s - the message to append