Package com.luna.common.replacer
Class LookupReplacer
java.lang.Object
com.luna.common.replacer.StrReplacer
com.luna.common.replacer.LookupReplacer
- All Implemented Interfaces:
Replacer<CharSequence>
,Serializable
查找替换器,通过查找指定关键字,替换对应的值
- Since:
- 4.1.5
- Author:
- looly
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
replace
(CharSequence str, int pos, StringBuilder out) 抽象的字符串替换方法,通过传入原字符串和当前位置,执行替换逻辑,返回处理或替换的字符串长度部分。Methods inherited from class com.luna.common.replacer.StrReplacer
replace
-
Constructor Details
-
LookupReplacer
构造- Parameters:
lookup
- 被查找的键值对
-
-
Method Details
-
replace
Description copied from class:StrReplacer
抽象的字符串替换方法,通过传入原字符串和当前位置,执行替换逻辑,返回处理或替换的字符串长度部分。- Specified by:
replace
in classStrReplacer
- Parameters:
str
- 被处理的字符串pos
- 当前位置out
- 输出- Returns:
- 处理的原字符串长度,0表示跳过此字符
-