Class StringTemplate
java.lang.Object
cloud.opencode.base.string.template.StringTemplate
String Template - Simple string template implementation.
字符串模板 - 简单的字符串模板实现。
Features | 主要功能:
- Fluent variable setting API - 流式变量设置API
- Strict and lenient modes - 严格和宽松模式
- Default value support - 默认值支持
- Variable extraction - 变量提取
Usage Examples | 使用示例:
String result = StringTemplate.of("Hello ${name}!")
.set("name", "World")
.render(); // "Hello World!"
Security | 安全性:
- Thread-safe: No (mutable state) - 线程安全: 否(可变状态)
- Since:
- JDK 25, opencode-base-string V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefaultValue(String defaultValue) booleanhasVariable(String name) static StringTemplaterender()strict(boolean strict)
-
Method Details
-
of
-
set
-
setAll
-
defaultValue
-
strict
-
render
-
render
-
getVariables
-
hasVariable
-