Package | Description |
---|---|
org.dromara.hutool.core.text.placeholder |
字符串占位符相关封装,包括占位符替换变量和解析变量
|
org.dromara.hutool.core.text.placeholder.segment |
占位符节点
|
org.dromara.hutool.core.text.placeholder.template |
字符串模板
|
Modifier and Type | Field and Description |
---|---|
protected List<StrTemplateSegment> |
StrTemplate.segments
模板中的所有固定文本和占位符
|
Modifier and Type | Method and Description |
---|---|
protected List<StrTemplateSegment> |
StrTemplate.getSegments()
获取 模板中 所有segment
|
protected abstract List<StrTemplateSegment> |
StrTemplate.parseSegments(String template)
将 模板 解析为 Segment 列表
|
Modifier and Type | Method and Description |
---|---|
protected void |
StrTemplate.addLiteralSegment(boolean isLastLiteralSegment,
List<StrTemplateSegment> list,
String newText)
添加 固定文本segment,过滤 空字符串 并 合并相邻的固定文本
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractPlaceholderSegment
字符串模板-占位符-抽象 Segment
例如:{@literal "???"
|
class |
IndexedPlaceholderSegment
基字符串模板-基于下标的占位符 Segment
例如,"{1}"
|
class |
LiteralSegment
字符串模板-固定文本 Segment
|
class |
NamedPlaceholderSegment
字符串模板-有前后缀的变量占位符 Segment
例如,"{1}", "{name}", "#{id}"
|
class |
SinglePlaceholderSegment
字符串模板-单变量占位符 Segment
例如,"?"
|
Modifier and Type | Method and Description |
---|---|
protected List<StrTemplateSegment> |
SinglePlaceholderStrTemplate.parseSegments(String template) |
protected List<StrTemplateSegment> |
NamedPlaceholderStrTemplate.parseSegments(String template) |
Copyright © 2025. All rights reserved.