public class ReplacementFormatter extends Object
Constructor and Description |
---|
ReplacementFormatter(String prefix,
String suffix) |
Modifier and Type | Method and Description |
---|---|
ReplacementFormatter |
defaultValue(Map<String,?> map)
添加默认值
|
ReplacementFormatter |
defaultValue(String key,
Object value)
添加默认值
|
ReplacementFormatter |
errorStrategy(ErrorStrategy errorStrategy)
设置错误处理策略
|
String |
format(String template,
Object o)
格式化
|
String |
format(String template,
String json)
格式化
|
Map<String,Object> |
getDefaults() |
ErrorStrategy |
getErrorStrategy() |
NoMatchStrategy |
getNoMatchStrategy() |
Pattern |
getPattern() |
String |
getPrefix() |
String |
getSuffix() |
ReplacementFormatter |
noMatchStrategy(NoMatchStrategy noMatchStrategy)
设置未匹配到策略
|
public ReplacementFormatter noMatchStrategy(NoMatchStrategy noMatchStrategy)
noMatchStrategy
- noMatchStrategypublic ReplacementFormatter errorStrategy(ErrorStrategy errorStrategy)
errorStrategy
- errorStrategypublic ReplacementFormatter defaultValue(String key, Object value)
key
- keyvalue
- valuepublic ReplacementFormatter defaultValue(Map<String,?> map)
map
- mappublic String format(String template, Object o)
template
- templateo
- opublic String format(String template, String json)
template
- templatejson
- jsonpublic Pattern getPattern()
public String getPrefix()
public String getSuffix()
public NoMatchStrategy getNoMatchStrategy()
public ErrorStrategy getErrorStrategy()
Copyright © 2024. All rights reserved.