Class CsvException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.opencsv.exceptions.CsvException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CsvChainedException, CsvFieldAssignmentException
This is the base class for all exceptions for opencsv.
- Since:
- 3.8
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, in case no parameters are required.CsvException(String message) Constructor that allows a human-readable message. -
Method Summary
Modifier and TypeMethodDescriptionString[]getLine()longvoidvoidsetLineNumber(long lineNumber) Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
lineNumber
private long lineNumber -
line
-
-
Constructor Details
-
CsvException
public CsvException()Default constructor, in case no parameters are required. -
CsvException
Constructor that allows a human-readable message.- Parameters:
message- The error text
-
-
Method Details
-
getLineNumber
public long getLineNumber()- Returns:
- The line number that caused the error. This should be the one-based number of the line that caused the error, not including the header line, if present.
-
setLineNumber
public void setLineNumber(long lineNumber) - Parameters:
lineNumber- The line number that caused the error. This should be the one-based number of the line that caused the error, not including the header line, if present.
-
getLine
- Returns:
- The line that caused the error if reading and the data are
available. Is always
nullon errors during writing, and may also benullor empty on certain errors that occur during reading. - Since:
- 4.4
-
setLine
- Parameters:
line- The line that caused the error on reading. May benull.- Since:
- 4.4
-