Class YmlPlaceholderException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.yml.exception.OpenYmlException
cloud.opencode.base.yml.exception.YmlPlaceholderException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
YAML Placeholder Exception - Thrown when placeholder resolution fails
YAML 占位符异常 - 当占位符解析失败时抛出
This exception is thrown when a placeholder cannot be resolved.
当占位符无法解析时抛出此异常。
Features | 主要功能:
- Tracks the unresolved placeholder expression - 跟踪未解析的占位符表达式
- Circular reference detection - 循环引用检测
- Error code YML_PLACEHOLDER_001 - 错误码 YML_PLACEHOLDER_001
Usage Examples | 使用示例:
try {
resolver.resolve("${MISSING_KEY}");
} catch (YmlPlaceholderException e) {
System.err.println("Unresolved: " + e.getPlaceholder());
}
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构建后不可变)
- Null-safe: No (placeholder may be null) - 空值安全: 否(占位符可能为空)
- Since:
- JDK 25, opencode-base-yml V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionYmlPlaceholderException(String placeholder) Constructs a placeholder exception for unresolved placeholder.YmlPlaceholderException(String placeholder, String message) Constructs a placeholder exception with message.YmlPlaceholderException(String placeholder, String message, Throwable cause) Constructs a placeholder exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic YmlPlaceholderExceptioncircularReference(String placeholder) Creates an exception for circular reference.Gets the placeholder that caused the exception.Methods inherited from class OpenYmlException
getColumn, getLine, hasLocationMethods 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
-
YmlPlaceholderException
Constructs a placeholder exception for unresolved placeholder. 为未解析的占位符构造异常。- Parameters:
placeholder- the unresolved placeholder | 未解析的占位符
-
YmlPlaceholderException
-
YmlPlaceholderException
-
-
Method Details
-
getPlaceholder
Gets the placeholder that caused the exception. 获取导致异常的占位符。- Returns:
- the placeholder | 占位符
-
circularReference
Creates an exception for circular reference. 为循环引用创建异常。- Parameters:
placeholder- the placeholder | 占位符- Returns:
- the exception | 异常
-