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

public Class TextWritingException

extends AbstractException
Class Inheritance

Exception type used provide information about any issue that might happen while writing to a given output.

It generally provides location and data information in case of a writing failure.

Author
Univocity Software Pty Ltd - [email protected]

Field Summary

Modifier and TypeField and Description
private final String
private final long
private final Object[]
private static final long
Inherited from com.univocity.parsers.common.AbstractException:
errorContentLength

Constructor Summary

AccessConstructor and Description
private
TextWritingException(String
message with details about the error
message
,
long
the number of records written until the error occurred
recordCount
,
Object[]
the input row that was being written when the error occurred
row
,
String
the characters already written to the output record.
recordCharacters
,
Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(String
message with details about the error
message
,
long
the number of records written until the error occurred
recordCount
,
String
the characters already written to the output record.
recordCharacters
,
Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(String
message with details about the error
message
,
long
the number of records written until the error occurred
recordCount
,
Object[]
the input row that was being written when the error occurred
row
,
Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(String
message with details about the error
message
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(String
message with details about the error
message
,
long
index of the line being written to the output when the error occurred
line
,
Object[]
the input row that was being written when the error occurred
row
)

Creates a new exception with information about an error that occurred when writing data to some output.

public
TextWritingException(String
message with details about the error
message
,
long
index of the line being written to the output when the error occurred
line
,
String
the characters already written to the output record.
recordCharacters
)

Creates a new exception with information about an error that occurred when writing data to some output.

Method Summary

Modifier and TypeMethod and Description
protected String
getDetails()

Implements abstract 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.
protected String
getErrorDescription()

Implements abstract com.univocity.parsers.common.AbstractException.getErrorDescription.

Returns a generic description of the error.
public String

Returns:

the character data that failed to be written
getRecordCharacters
()

Returns the character data that failed to be written

public long

Returns:

the number of records written before the exception occurred.
getRecordCount
()

Returns the number of records written before the exception occurred.

public Object[]

Returns:

the data that failed to be written
getRecordData
()

Returns the data that failed to be written

Inherited from com.univocity.parsers.common.AbstractException:
getMessageprintIfNotEmptyrestrictContentrestrictContentrestrictContentrestrictContentrestrictContentsetErrorContentLengthupdateMessage

Field Detail

recordCharactersback to summary
private final String recordCharacters
recordCountback to summary
private final long recordCount
recordDataback to summary
private final Object[] recordData
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.univocity.parsers.common.AbstractException.serialVersionUID.

Constructor Detail

TextWritingExceptionback to summary
private TextWritingException(String message, long recordCount, Object[] row, String recordCharacters, Throwable cause)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

recordCount:long

the number of records written until the error occurred

row:Object[]

the input row that was being written when the error occurred

recordCharacters:String

the characters already written to the output record.

cause:Throwable

the cause of the error

TextWritingExceptionback to summary
public TextWritingException(String message, long recordCount, String recordCharacters, Throwable cause)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

recordCount:long

the number of records written until the error occurred

recordCharacters:String

the characters already written to the output record.

cause:Throwable

the cause of the error

TextWritingExceptionback to summary
public TextWritingException(String message, long recordCount, Object[] row, Throwable cause)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

recordCount:long

the number of records written until the error occurred

row:Object[]

the input row that was being written when the error occurred

cause:Throwable

the cause of the error

TextWritingExceptionback to summary
public TextWritingException(String message)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

TextWritingExceptionback to summary
public TextWritingException(Throwable cause)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
cause:Throwable

the cause of the error

TextWritingExceptionback to summary
public TextWritingException(String message, long line, Object[] row)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

line:long

index of the line being written to the output when the error occurred

row:Object[]

the input row that was being written when the error occurred

TextWritingExceptionback to summary
public TextWritingException(String message, long line, String recordCharacters)

Creates a new exception with information about an error that occurred when writing data to some output.

Parameters
message:String

message with details about the error

line:long

index of the line being written to the output when the error occurred

recordCharacters:String

the characters already written to the output record.

Method Detail

getDetailsback to summary
protected String getDetails()

Implements abstract com.univocity.parsers.common.AbstractException.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()

Implements abstract com.univocity.parsers.common.AbstractException.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
getRecordCharactersback to summary
public String getRecordCharacters()

Returns the character data that failed to be written

Returns:String

the character data that failed to be written

getRecordCountback to summary
public long getRecordCount()

Returns the number of records written before the exception occurred.

Returns:long

the number of records written before the exception occurred.

getRecordDataback to summary
public Object[] getRecordData()

Returns the data that failed to be written

Returns:Object[]

the data that failed to be written