Class CsvBindException
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.CsvBindException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
CSV Bind Exception - Exception for CSV-to-object binding errors
CSV绑定异常 - CSV到对象绑定错误异常
Thrown when a CSV row cannot be bound to a target object, for example due to type mismatches, missing required fields, or reflection failures.
当CSV行无法绑定到目标对象时抛出,例如类型不匹配、缺少必需字段或反射失败。
Usage Examples | 使用示例:
throw CsvBindException.of(MyRecord.class, "amount", cause);
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Since:
- JDK 25, opencode-base-csv V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCsvBindException(String message, Class<?> targetType, String fieldName) Constructs a bind exception with target type and field name (no cause) 构造带目标类型和字段名的绑定异常(无原因)CsvBindException(String message, Class<?> targetType, String fieldName, Throwable cause) Constructs a bind exception with target type, field name, and cause 构造带目标类型、字段名和原因的绑定异常 -
Method Summary
Modifier and TypeMethodDescriptionGets the field name that caused the binding failure 获取导致绑定失败的字段名Class<?> Gets the target type that binding failed for 获取绑定失败的目标类型static CsvBindExceptionCreates a bind exception for a specific type and field 为特定类型和字段创建绑定异常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
-
CsvBindException
-
CsvBindException
Constructs a bind exception with target type, field name, and cause 构造带目标类型、字段名和原因的绑定异常- Parameters:
message- the detail message | 详细消息targetType- the target type | 目标类型fieldName- the field name | 字段名cause- the cause | 原因
-
-
Method Details
-
getTargetType
Gets the target type that binding failed for 获取绑定失败的目标类型- Returns:
- the target type, or null | 目标类型,或null
-
getFieldName
Gets the field name that caused the binding failure 获取导致绑定失败的字段名- Returns:
- the field name, or null | 字段名,或null
-
of
Creates a bind exception for a specific type and field 为特定类型和字段创建绑定异常- Parameters:
type- the target type | 目标类型field- the field name | 字段名cause- the cause | 原因- Returns:
- the exception | 异常
-