public class TextParsingException extends AbstractException
It generally provides location information about where in the input a parsing error occurred.
Modifier and Type | Field and Description |
---|---|
private long |
charIndex |
private int |
columnIndex |
private java.lang.String |
content |
protected int[] |
extractedIndexes |
private java.lang.String[] |
headers |
private long |
lineIndex |
private long |
recordNumber |
private static long |
serialVersionUID |
errorContentLength
Constructor and Description |
---|
TextParsingException(Context context,
java.lang.String message,
java.lang.Throwable cause)
Creates a new exception with information about an error that occurred when parsing some input.
|
TextParsingException(ParsingContext context)
Creates a new exception with information about an error that occurred when parsing some input.
|
TextParsingException(ParsingContext context,
java.lang.String message)
Creates a new exception with information about an error that occurred when parsing some input.
|
TextParsingException(ParsingContext context,
java.lang.Throwable cause)
Creates a new exception with information about an error that occurred when parsing some input.
|
Modifier and Type | Method and Description |
---|---|
long |
getCharIndex()
Returns the location of the last character read from before the error occurred.
|
int |
getColumnIndex()
Returns the column index where the exception occurred.
|
protected java.lang.String |
getDetails()
Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer.
|
protected java.lang.String |
getErrorDescription()
Returns a generic description of the error.
|
java.lang.String[] |
getHeaders()
Returns the headers processed from the input, if any.
|
long |
getLineIndex()
Returns the line number where the exception occurred.
|
java.lang.String |
getParsedContent()
Returns the last chunk of content parsed before the error took place
|
long |
getRecordNumber()
Returns the record number when the exception occurred.
|
protected void |
setContext(Context context) |
private void |
setParsingContext(ParsingContext parsingContext) |
getMessage, printIfNotEmpty, restrictContent, restrictContent, restrictContent, restrictContent, restrictContent, setErrorContentLength, updateMessage
private static final long serialVersionUID
private long lineIndex
private long charIndex
private long recordNumber
private int columnIndex
private java.lang.String content
private java.lang.String[] headers
protected int[] extractedIndexes
public TextParsingException(Context context, java.lang.String message, java.lang.Throwable cause)
context
- the context of the parser when an error occurredmessage
- message with details about the errorcause
- the cause of the errorpublic TextParsingException(ParsingContext context, java.lang.String message)
context
- the context of the parser when an error occurredmessage
- message with details about the errorpublic TextParsingException(ParsingContext context, java.lang.Throwable cause)
context
- the context of the parser when an error occurredcause
- the cause of the errorpublic TextParsingException(ParsingContext context)
context
- the context of the parser when an error occurredprotected void setContext(Context context)
private void setParsingContext(ParsingContext parsingContext)
protected java.lang.String getErrorDescription()
AbstractException
AbstractException.getMessage()
to print out a general description of the error before a detailed message of the root cause.getErrorDescription
in class AbstractException
protected java.lang.String getDetails()
AbstractException
AbstractException.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 AbstractException.getMessage()
method to print out these details after the error message.getDetails
in class AbstractException
public long getRecordNumber()
public int getColumnIndex()
public long getLineIndex()
public long getCharIndex()
public final java.lang.String getParsedContent()
public final java.lang.String[] getHeaders()