public class DataValidationException extends DataProcessingException
DataValidationException
is an error thrown during the processing of a record successfully parsed,
but whose data failed to pass a validation defined by annotation Validate
Modifier and Type | Field and Description |
---|---|
protected int |
errorContentLength |
extractedIndexes
Constructor and Description |
---|
DataValidationException(String message)
Creates a new validation exception with an error message only.
|
DataValidationException(String message,
int columnIndex)
Creates a new validation exception with an error message and the column that could not be validated.
|
DataValidationException(String message,
Object[] row)
Creates a new validation exception with an error message and the row that could not be validated.
|
DataValidationException(String message,
Object[] row,
Throwable cause)
Creates a new validation exception with an error message, the row that could not be validated, and the error cause.
|
DataValidationException(String message,
Throwable cause)
Creates a new validation exception with an error message and error cause
|
Modifier and Type | Method and Description |
---|---|
protected String |
getErrorDescription()
Returns a generic description of the error.
|
String |
getMessage()
Returns a detailed message describing the error, and the internal state of the parser/writer.
|
protected static String |
printIfNotEmpty(String previous,
String description,
Object o) |
protected String |
restrictContent(CharSequence content) |
static String |
restrictContent(int errorContentLength,
CharSequence content) |
static Object[] |
restrictContent(int errorContentLength,
Object[] content) |
protected String |
restrictContent(Object content) |
protected Object[] |
restrictContent(Object[] content) |
void |
setErrorContentLength(int errorContentLength) |
getColumnIndex, getColumnName, getDetails, getRow, getValue, isHandled, markAsHandled, markAsNonFatal, setColumnIndex, setColumnName, setDetails, setRow, setValue, setValue, updateMessage
getCharIndex, getHeaders, getLineIndex, getParsedContent, getRecordNumber, setContext
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public DataValidationException(String message)
message
- the error messagepublic DataValidationException(String message, Throwable cause)
message
- the error messagecause
- the cause of the errorpublic DataValidationException(String message, Object[] row)
message
- the error messagerow
- the row that could not be processed.public DataValidationException(String message, Object[] row, Throwable cause)
message
- the error messagerow
- the row that could not be processed.cause
- the cause of the errorpublic DataValidationException(String message, int columnIndex)
message
- the error messagecolumnIndex
- index of the column that could not be validated.protected String getErrorDescription()
getMessage()
to print out a general description of the error before a detailed message of the root cause.getErrorDescription
in class DataProcessingException
public final String getMessage()
getMessage
in class Throwable
protected static String printIfNotEmpty(String previous, String description, Object o)
public static String restrictContent(int errorContentLength, CharSequence content)
public void setErrorContentLength(int errorContentLength)
protected String restrictContent(CharSequence content)
Copyright © 2019 Univocity Software Pty Ltd. All rights reserved.