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

public Class TextParsingException

extends AbstractException
Class Inheritance
Known Direct Subclasses
com.univocity.parsers.common.DataProcessingException

Exception type used provide information about any issue that might happen while parsing from a given input.

It generally provides location information about where in the input a parsing error occurred.

Author
Univocity Software Pty Ltd - [email protected]

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
TextParsingException(Context
the context of the parser when an error occurred
context
,
String
message with details about the error
message
,
Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when parsing some input.

public
TextParsingException(ParsingContext
the context of the parser when an error occurred
context
,
String
message with details about the error
message
)

Creates a new exception with information about an error that occurred when parsing some input.

public
TextParsingException(ParsingContext
the context of the parser when an error occurred
context
,
Throwable
the cause of the error
cause
)

Creates a new exception with information about an error that occurred when parsing some input.

public
TextParsingException(ParsingContext
the context of the parser when an error occurred
context
)

Creates a new exception with information about an error that occurred when parsing some input.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the location of the last character read from before the error occurred.
getCharIndex
()

Returns the location of the last character read from before the error occurred.

public int

Returns:

the column index where the exception occurred.
getColumnIndex
()

Returns the column index where the exception occurred.

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 final String[]

Returns:

the headers processed from the input, if any.
getHeaders
()

Returns the headers processed from the input, if any.

public long

Returns:

the line number where the exception occurred.
getLineIndex
()

Returns the line number where the exception occurred.

public final String

Returns:

the last chunk of content parsed before the error took place
getParsedContent
()

Returns the last chunk of content parsed before the error took place

public long

Returns:

the record number when the exception occurred.
getRecordNumber
()

Returns the record number when the exception occurred.

protected void
private void
Inherited from com.univocity.parsers.common.AbstractException:
getMessageprintIfNotEmptyrestrictContentrestrictContentrestrictContentrestrictContentrestrictContentsetErrorContentLengthupdateMessage

Field Detail

charIndexback to summary
private long charIndex
columnIndexback to summary
private int columnIndex
contentback to summary
private String content
extractedIndexesback to summary
protected int[] extractedIndexes
headersback to summary
private String[] headers
lineIndexback to summary
private long lineIndex
recordNumberback to summary
private long recordNumber
serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

TextParsingExceptionback to summary
public TextParsingException(Context context, String message, Throwable cause)

Creates a new exception with information about an error that occurred when parsing some input.

Parameters
context:Context

the context of the parser when an error occurred

message:String

message with details about the error

cause:Throwable

the cause of the error

TextParsingExceptionback to summary
public TextParsingException(ParsingContext context, String message)

Creates a new exception with information about an error that occurred when parsing some input.

Parameters
context:ParsingContext

the context of the parser when an error occurred

message:String

message with details about the error

TextParsingExceptionback to summary
public TextParsingException(ParsingContext context, Throwable cause)

Creates a new exception with information about an error that occurred when parsing some input.

Parameters
context:ParsingContext

the context of the parser when an error occurred

cause:Throwable

the cause of the error

TextParsingExceptionback to summary
public TextParsingException(ParsingContext context)

Creates a new exception with information about an error that occurred when parsing some input.

Parameters
context:ParsingContext

the context of the parser when an error occurred

Method Detail

getCharIndexback to summary
public long getCharIndex()

Returns the location of the last character read from before the error occurred.

Returns:long

the location of the last character read from before the error occurred.

getColumnIndexback to summary
public int getColumnIndex()

Returns the column index where the exception occurred.

Returns:int

the column index where the exception occurred.

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
getHeadersback to summary
public final String[] getHeaders()

Returns the headers processed from the input, if any.

Returns:String[]

the headers processed from the input, if any.

getLineIndexback to summary
public long getLineIndex()

Returns the line number where the exception occurred.

Returns:long

the line number where the exception occurred.

getParsedContentback to summary
public final String getParsedContent()

Returns the last chunk of content parsed before the error took place

Returns:String

the last chunk of content parsed before the error took place

getRecordNumberback to summary
public long getRecordNumber()

Returns the record number when the exception occurred.

Returns:long

the record number when the exception occurred.

setContextback to summary
protected void setContext(Context context)
setParsingContextback to summary
private void setParsingContext(ParsingContext parsingContext)