Class CsvParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.csv.exception.OpenCsvException
cloud.opencode.base.csv.exception.CsvParseException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
CSV Parse Exception - Exception for CSV parsing errors
CSV解析异常 - CSV解析错误异常
Thrown when CSV content cannot be parsed due to syntax errors such as unclosed quotes, invalid escaping, or malformed records. Carries the problematic line content for diagnostics.
当CSV内容因语法错误(如未关闭的引号、无效转义或畸形记录)而无法解析时抛出。 携带有问题的行内容用于诊断。
Usage Examples | 使用示例:
throw CsvParseException.of("Unclosed quote", 5, 23, "field1,\"unclosed");
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Since:
- JDK 25, opencode-base-csv V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCsvParseException(String message, int line, int column, String lineContent) Constructs a parse exception with all details 构造带所有详细信息的解析异常CsvParseException(String message, int line, int column, String lineContent, Throwable cause) Constructs a parse exception with all details and cause 构造带所有详细信息和原因的解析异常 -
Method Summary
Modifier and TypeMethodDescriptionGets the content of the problematic line 获取有问题的行内容static CsvParseExceptionCreates a parse exception with location and line content 创建带位置和行内容的解析异常Methods inherited from class OpenCsvException
bindError, getColumn, getLine, hasColumnInfo, hasLineInfo, ioError, parseError, writeErrorMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OpenExceptionMeta
getMetaPrefix
-
Constructor Details
-
CsvParseException
Constructs a parse exception with all details 构造带所有详细信息的解析异常- Parameters:
message- the detail message | 详细消息line- the line number | 行号column- the column number | 列号lineContent- the problematic line content | 有问题的行内容
-
CsvParseException
Constructs a parse exception with all details and cause 构造带所有详细信息和原因的解析异常- Parameters:
message- the detail message | 详细消息line- the line number | 行号column- the column number | 列号lineContent- the problematic line content | 有问题的行内容cause- the cause | 原因
-
-
Method Details
-
getLineContent
Gets the content of the problematic line 获取有问题的行内容- Returns:
- the line content, or null if not available | 行内容,如果不可用则为null
-
of
Creates a parse exception with location and line content 创建带位置和行内容的解析异常- Parameters:
message- the error message | 错误消息line- the line number | 行号column- the column number | 列号lineContent- the problematic line content | 有问题的行内容- Returns:
- the exception | 异常
-