Class PlaceholderTemplate

java.lang.Object
cloud.opencode.base.string.template.PlaceholderTemplate

public final class PlaceholderTemplate extends Object
Placeholder Template - Template engine with placeholder-based substitution. 占位符模板 - 基于占位符替换的模板引擎。

Features | 主要功能:

  • Configurable prefix and suffix delimiters - 可配置前缀和后缀分隔符
  • Simple string replacement rendering - 简单字符串替换渲染

Usage Examples | 使用示例:

PlaceholderTemplate tpl = PlaceholderTemplate.of("Hello ${name}!", "${", "}");
String result = tpl.render(Map.of("name", "World")); // "Hello World!"

Security | 安全性:

  • Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
  • Null-safe: Yes (returns null for null template) - 空值安全: 是
Since:
JDK 25, opencode-base-string V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: