Top Description Fields Constructors Methods
com.univocity.parsers.common

public Class DataProcessingException

extends TextParsingException
Class Inheritance
Known Direct Subclasses
com.univocity.parsers.common.DataValidationException
Imports
com.univocity.parsers.common.processor.*, java.util.*

A DataProcessingException is an error thrown during the processing of a record successfully parsed. This type of error usually indicates that the input text has been parsed correctly, but the subsequent transformations applied over the input (generally via a RowProcessor} failed.
Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
private int
private String
private String
private boolean
private boolean
private Object[]
private static final long
private Object
private Map<String, Object>
Inherited from com.univocity.parsers.common.TextParsingException:
extractedIndexes

Constructor Summary

AccessConstructor and Description
public
DataProcessingException(String
the error message
message
)

Creates a new exception with an error message only.

public
DataProcessingException(String
the error message
message
,
Throwable
the cause of the error
cause
)

Creates a new exception with an error message and error cause

public
DataProcessingException(String
the error message
message
,
Object[]
the row that could not be processed.
row
)

Creates a new exception with an error message and the row that could not be processed.

public
DataProcessingException(String
the error message
message
,
Object[]
the row that could not be processed.
row
,
Throwable
the cause of the error
cause
)

Creates a new exception with an error message, the row that could not be processed, and the error cause.

public
DataProcessingException(String
the error message
message
,
int
index of the column that could not be processed.
columnIndex
)

Creates a new exception with an error message and the column that could not be processed.

public
DataProcessingException(String
the error message
message
,
int
index of the column that could not be processed.
columnIndex
,
Object[]
the row that could not be processed.
row
,
Throwable
the cause of the error
cause
)

Creates a new exception with an error message, the column that could not be processed the row that could not be processed, and the error cause.

Method Summary

Modifier and TypeMethod and Description
public final int

Returns:

the index of the column from where the error occurred.
getColumnIndex
()

Overrides com.univocity.parsers.common.TextParsingException.getColumnIndex.

Returns the index of the column from where the error occurred, if available.
public String

Returns:

the name of the column from where the error occurred.
getColumnName
()

Returns the name of the column from where the error occurred, if available.

protected String
getDetails()

Overrides com.univocity.parsers.common.TextParsingException.getDetails.

Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer.
protected String
private int
public final Object[]

Returns:

the record being processed when error occurred, if available.
getRow
()

Returns the record being processed when the error occurred, if available.

public final Object

Returns:

the value being processed when the error occurred, if available.
getValue
()

Returns the value being processed when the error occurred, if available.

pack-priv final boolean

Returns:

a flag indicating whether this error is fatal and the process must stop as it is impossible to proceed.
isFatal
()

Returns a flag indicating whether this error is fatal and the process must stop as it is impossible to proceed.

public boolean

Returns:

true if this exception has been handled to a user-provided ProcessorErrorHandler, otherwise false
isHandled
()

Returns a flag indicating this exception has been handled by a user-provided ProcessorErrorHandler

public final void
markAsHandled(ProcessorErrorHandler<T extends Context>
the ProcessorErrorHandler used to handle this exception.
handler
)

Marks the error as handled so it doesn't trigger a ProcessorErrorHandler again.

public final void
markAsNonFatal()

Marks the error as non fatal and the parsing process might proceed.

public final void
setColumnIndex(int
the column index being processed when error occurred.
columnIndex
)

Defines the column index being processed when the error occurred.

public final void
setColumnName(String
the name of the column being processed when error occurred.
columnName
)

Defines the name of the column being processed when the error occurred.

public void
setDetails(String details)

public final void
setRow(Object[]
the record data processed when the error occurred.
row
)

Updates the exception with the record being processed when the error occurred.

public final void
setValue(Object
the value being processed when error occurred.
value
)

Defines the value being processed when the error occurred.

public final void
setValue(String
a label in the exception message - any string enclosed by curly braces.
label
,
Object
the value being processed when error occurred, that should be replaced by the label in the exception message.
value
)

Associates a label in the exception message (idenfied in curly braces) with a value being processed when the error occurred.

protected final String
updateMessage(String
the original message
msg
)

Overrides com.univocity.parsers.common.AbstractException.updateMessage.

Allows subclasses to alter the exception message that should be displayed to end users.
Inherited from com.univocity.parsers.common.TextParsingException:
getCharIndexgetHeadersgetLineIndexgetParsedContentgetRecordNumbersetContext

Field Detail

columnIndexback to summary
private int columnIndex

Hides com.univocity.parsers.common.TextParsingException.columnIndex.

columnNameback to summary
private String columnName
detailsback to summary
private String details
fatalback to summary
private boolean fatal
handledback to summary
private boolean handled
rowback to summary
private Object[] row
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.univocity.parsers.common.TextParsingException.serialVersionUID.

valueback to summary
private Object value
valuesback to summary
private Map<String, Object> values

Constructor Detail

DataProcessingExceptionback to summary
public DataProcessingException(String message)

Creates a new exception with an error message only.

Parameters
message:String

the error message

DataProcessingExceptionback to summary
public DataProcessingException(String message, Throwable cause)

Creates a new exception with an error message and error cause

Parameters
message:String

the error message

cause:Throwable

the cause of the error

DataProcessingExceptionback to summary
public DataProcessingException(String message, Object[] row)

Creates a new exception with an error message and the row that could not be processed.

Parameters
message:String

the error message

row:Object[]

the row that could not be processed.

DataProcessingExceptionback to summary
public DataProcessingException(String message, Object[] row, Throwable cause)

Creates a new exception with an error message, the row that could not be processed, and the error cause.

Parameters
message:String

the error message

row:Object[]

the row that could not be processed.

cause:Throwable

the cause of the error

DataProcessingExceptionback to summary
public DataProcessingException(String message, int columnIndex)

Creates a new exception with an error message and the column that could not be processed.

Parameters
message:String

the error message

columnIndex:int

index of the column that could not be processed.

DataProcessingExceptionback to summary
public DataProcessingException(String message, int columnIndex, Object[] row, Throwable cause)

Creates a new exception with an error message, the column that could not be processed the row that could not be processed, and the error cause.

Parameters
message:String

the error message

columnIndex:int

index of the column that could not be processed.

row:Object[]

the row that could not be processed.

cause:Throwable

the cause of the error

Method Detail

getColumnIndexback to summary
public final int getColumnIndex()

Overrides com.univocity.parsers.common.TextParsingException.getColumnIndex.

Returns the index of the column from where the error occurred, if available.

Returns:int

the index of the column from where the error occurred.

getColumnNameback to summary
public String getColumnName()

Returns the name of the column from where the error occurred, if available.

Returns:String

the name of the column from where the error occurred.

getDetailsback to summary
protected String getDetails()

Overrides com.univocity.parsers.common.TextParsingException.getDetails.

Doc from com.univocity.parsers.common.AbstractException.getDetails.

Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer. Use printIfNotEmpty(String, String, Object) to create a comma-separated list of relevant properties and their (non null) values. The result of this method is used by the getMessage() method to print out these details after the error message.

Returns:String

a String describing the internal state of the parser/writer.

Annotations
@Override
getErrorDescriptionback to summary
protected String getErrorDescription()

Overrides com.univocity.parsers.common.TextParsingException.getErrorDescription.

Doc from com.univocity.parsers.common.AbstractException.getErrorDescription.

Returns a generic description of the error. The result of this method is used by getMessage() to print out a general description of the error before a detailed message of the root cause.

Returns:String

a generic description of the error.

Annotations
@Override
getExtractedColumnIndexback to summary
private int getExtractedColumnIndex()
getRowback to summary
public final Object[] getRow()

Returns the record being processed when the error occurred, if available.

Returns:Object[]

the record being processed when error occurred, if available.

getValueback to summary
public final Object getValue()

Returns the value being processed when the error occurred, if available.

Returns:Object

the value being processed when the error occurred, if available.

isFatalback to summary
pack-priv final boolean isFatal()

Returns a flag indicating whether this error is fatal and the process must stop as it is impossible to proceed.

Returns:boolean

a flag indicating whether this error is fatal and the process must stop as it is impossible to proceed.

isHandledback to summary
public boolean isHandled()

Returns a flag indicating this exception has been handled by a user-provided ProcessorErrorHandler

Returns:boolean

true if this exception has been handled to a user-provided ProcessorErrorHandler, otherwise false

markAsHandledback to summary
public final void markAsHandled(ProcessorErrorHandler<T extends Context> handler)

Marks the error as handled so it doesn't trigger a ProcessorErrorHandler again.

Parameters
handler:ProcessorErrorHandler<T extends Context>

the ProcessorErrorHandler used to handle this exception.

markAsNonFatalback to summary
public final void markAsNonFatal()

Marks the error as non fatal and the parsing process might proceed.

setColumnIndexback to summary
public final void setColumnIndex(int columnIndex)

Defines the column index being processed when the error occurred.

Parameters
columnIndex:int

the column index being processed when error occurred.

setColumnNameback to summary
public final void setColumnName(String columnName)

Defines the name of the column being processed when the error occurred.

Parameters
columnName:String

the name of the column being processed when error occurred.

setDetailsback to summary
public void setDetails(String details)
setRowback to summary
public final void setRow(Object[] row)

Updates the exception with the record being processed when the error occurred.

Parameters
row:Object[]

the record data processed when the error occurred.

setValueback to summary
public final void setValue(Object value)

Defines the value being processed when the error occurred.

Parameters
value:Object

the value being processed when error occurred.

setValueback to summary
public final void setValue(String label, Object value)

Associates a label in the exception message (idenfied in curly braces) with a value being processed when the error occurred. Used for formatting the exception message

Parameters
label:String

a label in the exception message - any string enclosed by curly braces.

value:Object

the value being processed when error occurred, that should be replaced by the label in the exception message.

updateMessageback to summary
protected final String updateMessage(String msg)

Overrides com.univocity.parsers.common.AbstractException.updateMessage.

Doc from com.univocity.parsers.common.AbstractException.updateMessage.

Allows subclasses to alter the exception message that should be displayed to end users. By default the original message is kept unchanged.

Parameters
msg:String

the original message

Returns:String

the updated message.

Annotations
@Override