public interface ReplacementSelector<MATCHRESULT>
This is called by a StringSearcher.findAndReplace(String, ReplacementSelector)
to replace instances
of patterns found in a string.
Modifier and Type | Method and Description |
---|---|
int |
apply(SafeAppendable dest,
MATCHRESULT mr,
java.lang.CharSequence src,
int startPos,
int endPos)
This will be called for each instance of each pattern found
|
int apply(SafeAppendable dest, MATCHRESULT mr, java.lang.CharSequence src, int startPos, int endPos)
dest
- The replacement text for the matching substring should be written heremr
- The MATCHRESULT produced by the matchsrc
- The string being searched, or a part of the stream being searched that contains the current matchstartPos
- the start index of the current match in srcendPos
- the end index of the current match in src