BeanIO 2.0.4

org.beanio
Class InvalidRecordException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.beanio.BeanIOException
                  extended by org.beanio.BeanReaderException
                      extended by org.beanio.InvalidRecordException
All Implemented Interfaces:
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
Author:
Kevin Seim
See Also:
Serialized Form

Constructor Summary
  InvalidRecordException(RecordContext context, String message)
          Constructs a new InvalidRecordException.
protected InvalidRecordException(String message)
          Constructs a new InvalidRecordException.
 
Method Summary
protected  void appendMessageDetails(StringBuilder s)
          Called by toString() to append record context details to the error message.
 String getRecordName()
          Returns the name of the record or group that failed validation.
 String toString()
           
 
Methods inherited from class org.beanio.BeanReaderException
getContext, getRecordContext, getRecordContext, getRecordCount, setRecordContext, setRecordContext
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidRecordException

protected InvalidRecordException(String message)
Constructs a new InvalidRecordException.

Parameters:
message - the error message

InvalidRecordException

public InvalidRecordException(RecordContext context,
                              String message)
Constructs a new InvalidRecordException.

Parameters:
context - the RecordContext that caused the exception
message - the error message
Method Detail

getRecordName

public String getRecordName()
Returns the name of the record or group that failed validation.

Returns:
the record or group name
Since:
2.0

toString

public String toString()
Overrides:
toString in class Throwable

appendMessageDetails

protected void appendMessageDetails(StringBuilder s)
Called by toString() to append record context details to the error message.

Parameters:
s - the message to append

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim