Package org.beanio
Class InvalidRecordException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.beanio.BeanIOException
-
- org.beanio.BeanReaderException
-
- org.beanio.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 toread()
are not affected.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
InvalidRecordException(java.lang.String message)
Constructs a newInvalidRecordException
.InvalidRecordException(RecordContext context, java.lang.String message)
Constructs a newInvalidRecordException
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendMessageDetails(java.lang.StringBuilder s)
Called bytoString()
to append record context details to the error message.java.lang.String
getRecordName()
Returns the name of the record or group that failed validation.java.lang.String
toString()
-
Methods inherited from class org.beanio.BeanReaderException
getContext, getRecordContext, getRecordContext, getRecordCount, setRecordContext, setRecordContext
-
-
-
-
Constructor Detail
-
InvalidRecordException
protected InvalidRecordException(java.lang.String message)
Constructs a newInvalidRecordException
.- Parameters:
message
- the error message
-
InvalidRecordException
public InvalidRecordException(RecordContext context, java.lang.String message)
Constructs a newInvalidRecordException
.- Parameters:
context
- theRecordContext
that caused the exceptionmessage
- 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 classjava.lang.Throwable
-
appendMessageDetails
protected void appendMessageDetails(java.lang.StringBuilder s)
Called bytoString()
to append record context details to the error message.- Parameters:
s
- the message to append
-
-