This can be for constraints like making certain a number is in a certain range, or it can even be thrown by code using opencsv when constraints outside of opencsv would be violated. An example of the latter is importing into a database when one of the field in the CSV is supposed to contain the primary key for a foreign table, but the foreign key cannot be satisfied.
This exception is not currently used by opencsv itself, since opencsv has no concept of what data consistency means in the context of the application using it. It is meant more for custom converters.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private final transient Object |
| Access | Constructor and Description |
|---|---|
| public | CsvConstraintViolationException()
Default constructor, in case no further information is necessary or available. |
| public | CsvConstraintViolationException(Object
The offending source object sourceObject)Constructor for setting the source object that triggered the constraint violation. |
| public | CsvConstraintViolationException(String
Human-readable error text message)Constructor with a simple text. |
| public | CsvConstraintViolationException(Object
The offending source object sourceObject, String Human-readable error text message)Constructor for setting the source object and an error message. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: The source object that triggered the constraint violationGets the object that would have caused a constraint violation. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sourceObject | back to summary |
|---|---|
| private final transient Object sourceObject | |
| CsvConstraintViolationException | back to summary |
|---|---|
| public CsvConstraintViolationException() Default constructor, in case no further information is necessary or available. | |
| CsvConstraintViolationException | back to summary |
|---|---|
| public CsvConstraintViolationException(Object sourceObject) Constructor for setting the source object that triggered the constraint violation.
| |
| CsvConstraintViolationException | back to summary |
|---|---|
| public CsvConstraintViolationException(String message) Constructor with a simple text.
| |
| CsvConstraintViolationException | back to summary |
|---|---|
| public CsvConstraintViolationException(Object sourceObject, String message) Constructor for setting the source object and an error message. | |
| getSourceObject | back to summary |
|---|---|
| public Object getSourceObject() Gets the object that would have caused a constraint violation.
| |