Class XmlValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.xml.exception.OpenXmlException
cloud.opencode.base.xml.exception.XmlValidationException
- All Implemented Interfaces:
Serializable
XML Validation Exception - Thrown when XML validation fails
XML 验证异常 - 当 XML 验证失败时抛出
This exception is thrown when XML fails Schema or DTD validation. It contains the list of validation errors encountered.
当 XML 未通过 Schema 或 DTD 验证时抛出此异常。它包含遇到的验证错误列表。
Features | 主要功能:
- Exception for XML schema/DTD validation failures - XML Schema/DTD 验证失败的异常
- Extends OpenXmlException with specific context - 继承 OpenXmlException,带特定上下文
Usage Examples | 使用示例:
// Catch specific exception
try {
// XML operation
} catch (XmlValidationException 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.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXmlValidationException(String message) Constructs a validation exception with message.XmlValidationException(String message, Throwable cause) Constructs a validation exception with message and cause.XmlValidationException(String message, List<String> errors) Constructs a validation exception with message and error list.XmlValidationException(List<String> errors) Constructs a validation exception with error list. -
Method Summary
Methods inherited from class OpenXmlException
bindError, getColumn, getLine, hasLocation, parseError, transformError, validationError, xpathErrorMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
XmlValidationException
Constructs a validation exception with message. 构造带消息的验证异常。- Parameters:
message- the detail message | 详细消息
-
XmlValidationException
-
XmlValidationException
-
XmlValidationException
-
-
Method Details
-
getErrors
-
hasErrors
public boolean hasErrors()Returns whether there are any errors. 返回是否有任何错误。- Returns:
- true if there are errors | 如果有错误则返回 true
-