|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.univocity.parsers.common.TextParsingException
public class TextParsingException
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.
Field Summary | |
---|---|
protected int[] |
extractedIndexes
|
Constructor Summary | |
---|---|
TextParsingException(ParsingContext context)
Creates a new exception with information about an error that occurred when parsing some input. |
|
TextParsingException(ParsingContext context,
String message)
Creates a new exception with information about an error that occurred when parsing some input. |
|
TextParsingException(ParsingContext context,
String message,
Throwable cause)
Creates a new exception with information about an error that occurred when parsing some input. |
|
TextParsingException(ParsingContext context,
Throwable cause)
Creates a new exception with information about an error that occurred when parsing some input. |
Method Summary | |
---|---|
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 String |
getDetails()
Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer. |
protected String |
getErrorDescription()
Returns a generic description of the error. |
String[] |
getHeaders()
Returns the headers processed from the input, if any. |
long |
getLineIndex()
Returns the line number where the exception occurred. |
String |
getMessage()
Returns a detailed message describing the error, and the internal state of the parser/writer. |
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 static String |
printIfNotEmpty(String previous,
String description,
Object o)
|
protected void |
setContext(ParsingContext context)
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int[] extractedIndexes
Constructor Detail |
---|
public TextParsingException(ParsingContext context, String message, 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, String message)
context
- the context of the parser when an error occurredmessage
- message with details about the errorpublic TextParsingException(ParsingContext context, 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 occurredMethod Detail |
---|
protected void setContext(ParsingContext context)
protected String getErrorDescription()
getMessage()
to print out a general description of the error before a detailed message of the root cause.
protected String getDetails()
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.
public long getRecordNumber()
public int getColumnIndex()
public long getLineIndex()
public long getCharIndex()
public final String getParsedContent()
public final String[] getHeaders()
public final String getMessage()
getMessage
in class Throwable
protected static String printIfNotEmpty(String previous, String description, Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |