Class XmlBindException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.xml.exception.OpenXmlException
cloud.opencode.base.xml.exception.XmlBindException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
XML Bind Exception - Thrown when XML-to-Bean binding fails
XML 绑定异常 - 当 XML 到 Bean 绑定失败时抛出
This exception is thrown when the binder cannot convert XML to a Java object or vice versa, due to type mismatches, missing annotations, or other issues.
当绑定器由于类型不匹配、缺少注解或其他问题而无法将 XML 转换为 Java 对象(或反之)时抛出此异常。
Features | 主要功能:
- Exception for XML-to-Bean binding failures - XML 到 Bean 绑定失败的异常
- Extends OpenXmlException with specific context - 继承 OpenXmlException,带特定上下文
Usage Examples | 使用示例:
// Catch specific exception
try {
// XML operation
} catch (XmlBindException e) {
System.err.println(e.getMessage());
}
Security | 安全性:
- Thread-safe: Yes (immutable exception) - 线程安全: 是(不可变异常)
- Null-safe: No (message must not be null) - 空值安全: 否(消息不能为 null)
- Since:
- JDK 25, opencode-base-xml V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXmlBindException(Class<?> targetType, String message) Constructs a bind exception with target type and message.XmlBindException(Class<?> targetType, String message, Throwable cause) Constructs a bind exception with target type, message and cause.XmlBindException(String message) Constructs a bind exception with message only.XmlBindException(String message, Throwable cause) Constructs a bind exception with message and cause. -
Method Summary
Methods inherited from class OpenXmlException
bindError, getColumn, getLine, hasLocation, parseError, transformError, validationError, xpathErrorMethods 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
-
XmlBindException
-
XmlBindException
-
XmlBindException
Constructs a bind exception with message only. 构造仅带消息的绑定异常。- Parameters:
message- the detail message | 详细消息
-
XmlBindException
-
-
Method Details
-
getTargetType
Returns the target type that failed to bind. 返回绑定失败的目标类型。- Returns:
- the target type, or null if not applicable | 目标类型,如果不适用则返回 null
-